@import url('https://fonts.googleapis.com/css2?family=Uncial+Antiqua&display=swap');

/* InstaSSEL — Folha de estilos compartilhada (painel + páginas de auth) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1e1e2e;
  line-height: 1.5;
}

/* ============================================================
   PÁGINAS DE AUTH (login, cadastro, recuperar, redefinir, política)
   ============================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #6d28d9;
  letter-spacing: -.5px;
  margin-bottom: 4px;
  text-align: center;
}
.auth-logo span { color: #a78bfa; }
.auth-logo-sub {
  font-size: .78rem;
  color: #9ca3af;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 28px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 36px 40px;
  width: 100%;
  max-width: 460px;
}

.auth-titulo {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.auth-sub {
  font-size: .88rem;
  color: #6b7280;
  margin-bottom: 24px;
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: .85rem;
  color: #6b7280;
}
.auth-footer a { color: #6d28d9; text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  font-size: .85rem;
  text-align: center;
}
.auth-links a { color: #6d28d9; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT DO PAINEL (sidebar + main)
   ============================================================ */
.painel-wrap {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #6d28d9;
  border-bottom: 1px solid #f3f4f6;
  letter-spacing: -.3px;
}
.sidebar-logo span { color: #a78bfa; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: .88rem;
  color: #374151;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: background .12s;
}
.sidebar-nav a:hover { background: #f5f3ff; color: #6d28d9; }
.sidebar-nav a.ativo  { background: #f5f3ff; color: #6d28d9; font-weight: 600; }
.sidebar-nav a.disabled {
  color: #c4c4c4;
  cursor: default;
  pointer-events: none;
}
.sidebar-nav .nav-badge {
  margin-left: auto;
  font-size: .7rem;
  background: #e5e7eb;
  color: #6b7280;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #f3f4f6;
}
.sidebar-footer .sf-nome  { font-size: .82rem; font-weight: 700; color: #374151; margin-bottom: 2px; }
.sidebar-footer .sf-email {
  font-size: .75rem;
  color: #9ca3af;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-footer a.sair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: #dc2626;
  text-decoration: none;
  font-weight: 600;
}
.sidebar-footer a.sair:hover { text-decoration: underline; }

/* Área principal */
.painel-main {
  flex: 1;
  padding: 0 40px 70px;
  overflow-x: hidden;
}

/* Header do painel */
.painel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid #e5e7eb;
}
.ph-usuario {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f5f3ff;
  color: #6d28d9;
  border-radius: 20px;
  padding: 6px 14px 6px 9px;
  font-size: .84rem;
  font-weight: 600;
}
.ph-sair {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 20px;
  padding: 6px 14px 6px 10px;
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.ph-sair:hover { background: #fecaca; }

/* Ícones user/sair na sidebar (visíveis só no mobile) */
.sidebar-mobile-user { display: none; }
.sb-user-icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: #f5f3ff; color: #6d28d9; border-radius: 50%;
}
.sb-sair-icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: #fee2e2; color: #dc2626; border-radius: 50%;
  text-decoration: none; transition: background .15s;
}
.sb-sair-icon:hover { background: #fecaca; }

.painel-footer {
  position: fixed;
  bottom: 0;
  left: 240px;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 10px 24px;
  font-size: .72rem;
  color: #9ca3af;
  text-align: center;
  z-index: 50;
}
.painel-footer a { color: #6b7280; text-decoration: none; font-weight: 600; }
.painel-footer a:hover { color: #374151; }

.painel-titulo {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.painel-sub {
  color: #6b7280;
  font-size: .9rem;
  margin-bottom: 32px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 28px;
  margin-bottom: 20px;
}
.card-titulo {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: #1e1e2e;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 12px;
}
.card-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}
.card-placeholder .placeholder-icone { font-size: 2.5rem; margin-bottom: 12px; }
.card-placeholder p { font-size: .9rem; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.campo { margin-bottom: 18px; }

label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
label .opc { font-weight: 400; color: #9ca3af; }
label .req { color: #dc2626; font-weight: 700; margin-left: 2px; }

input[type=text],
input[type=email],
input[type=password] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  color: #111;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
input:disabled,
input[readonly] {
  background: #f9fafb;
  color: #6b7280;
  border-color: #e5e7eb;
  cursor: not-allowed;
}
.campo-hint { font-size: .77rem; color: #9ca3af; margin-top: 4px; }

.check-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .88rem;
  color: #374151;
  margin-bottom: 20px;
}
.check-wrap input[type=checkbox] { margin-top: 3px; accent-color: #6d28d9; flex-shrink: 0; }
.check-wrap a { color: #6d28d9; text-decoration: none; font-weight: 600; }

/* Campo somente leitura estilizado */
.dado-readonly {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .95rem;
  color: #6b7280;
  letter-spacing: .03em;
}

/* Linha de dados (meus dados) */
.dado-linha {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: center;
}
.dado-linha:last-child { border-bottom: none; }
.dado-chave { font-size: .82rem; font-weight: 600; color: #6b7280; min-width: 120px; flex-shrink: 0; }
.dado-valor { font-size: .92rem; color: #1e1e2e; }

@media (max-width: 480px) {
  .dado-linha { flex-direction: column; align-items: flex-start; gap: 2px; }
  .dado-chave { min-width: unset; }
}

/* Divisor de seção */
.secao-titulo {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin: 28px 0 14px;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 9px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; }

.btn-primary { background: #6d28d9; color: #fff; }
.btn-outline  { background: transparent; color: #6d28d9; border: 1.5px solid #6d28d9; }
.btn-danger   { background: #dc2626; color: #fff; }
.btn-neutral  { background: #e5e7eb; color: #374151; }
.btn-full     { width: 100%; }
.btn-sm       { padding: 7px 14px; font-size: .82rem; }

/* ============================================================
   ALERTAS / FLASH
   ============================================================ */
.alerta {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 20px;
  line-height: 1.5;
}
.alerta-erro   { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }
.alerta-ok     { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alerta-aviso  { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.alerta-info   { background: #eff6ff; border: 1px solid #93c5fd; color: #1d4ed8; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 640px) {
  .auth-card { padding: 28px 20px; }
  .cards-duplo { grid-template-columns: 1fr !important; }
  .painel-wrap { flex-direction: column; }

  /* Sidebar vira coluna: logo+ícones no topo, nav abaixo com texto */
  .sidebar {
    width: 100%;
    height: auto;
    padding: 0;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: column;
  }
  .sidebar-logo {
    padding: 12px 16px;
    border-bottom: none;
    justify-content: space-between;
  }
  /* Mostra user-ícone + sair-ícone inline com a logo */
  .sidebar-mobile-user { display: flex !important; align-items: center; gap: 8px; }
  /* Nav abaixo — mantém texto visível */
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    padding: 6px 10px 8px;
    gap: 4px;
    border-top: 1px solid #f3f4f6;
    flex: 0 0 auto;
    overflow-x: auto;
  }
  .sidebar-nav a {
    font-size: .82rem;
    padding: 8px 12px;
    margin-bottom: 0;
    white-space: nowrap;
  }
  .sidebar-nav a svg { margin-right: 5px !important; }
  /* Esconde o header desktop no mobile */
  .painel-header { display: none !important; }

  .painel-main { padding: 20px 16px 60px; }
  .painel-footer { left: 0; }
}
