/* ============================================================
   /css/auth.css  — zelador.me Auth
   Standalone: não depende de global.css.
   ============================================================ */

/* ── RESET & VARIÁVEIS ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --burple:      #5b6af5;
  --burple-dim:  rgba(91,106,245,.15);
  --burple-glow: rgba(91,106,245,.35);
  --green:       #34d863;
  --yellow:      #ffcc00;
  --red:         #ff453a;
  --surface:     rgba(14,19,42,.58);
  --border:      rgba(255,255,255,.08);
  --text-dim:    rgba(160,175,220,.6);
  --text-muted:  rgba(120,135,185,.5);
}

/* ── BASE ──────────────────────────────────────────────────── */
html, body {
  height: 100%;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #080d1c;
  color: #e8ecf8;
  /* overflow:hidden removido — cadastro precisa de scroll vertical */
}

body {
  background:
    radial-gradient(ellipse 55% 45% at 78% 18%, rgba(90,60,220,.28) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 18% 72%, rgba(30,60,200,.20) 0%, transparent 55%),
    radial-gradient(ellipse 60% 35% at 55% 88%, rgba(50,80,255,.14) 0%, transparent 55%),
    linear-gradient(160deg, #080c1e 0%, #0b1025 40%, #0d1230 70%, #080c1a 100%);
  background-attachment: fixed;
}

canvas#estrelas-auth {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── CENÁRIO CENTRAL ────────────────────────────────────────── */
.auth-cenario {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

/* ── CARD BASE ──────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 460px;          /* login e recuperação */
  background: rgba(10,14,32,.78);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px 36px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 32px 80px rgba(0,0,0,.55),
    0 0 0 1px rgba(91,106,245,.06);
  transition: max-width .35s cubic-bezier(.4,0,.2,1);
}

/* Card alargado para o painel de cadastro (2 colunas) */
.auth-card.modo-cadastro {
  max-width: 820px;
}

/* ── CABEÇALHO ──────────────────────────────────────────────── */
.auth-marca {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
}
.auth-marca-ic {
  width: 34px; height: 34px;
  background: #11183a;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #c8d4ff;
  flex-shrink: 0;
}
.auth-marca-nome {
  font-size: 17px; font-weight: 600;
  color: #dce6ff; letter-spacing: -.2px;
}

.auth-titulo {
  font-size: 22px; font-weight: 600;
  color: #e8eeff; letter-spacing: -.4px;
  margin-bottom: 4px;
}
.auth-subtitulo {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 24px; line-height: 1.5;
}

/* ── PAINÉIS ────────────────────────────────────────────────── */
.auth-painel { display: none; }
.auth-painel.ativo {
  display: block;
  animation: auth-entrar .3s cubic-bezier(.34,1.2,.64,1);
}

@keyframes auth-entrar {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── GRID DE CADASTRO (2 COLUNAS) ───────────────────────────── */
/*
  No painel de cadastro os campos são divididos em duas colunas.
  Cada .auth-col ocupa metade. Separadas por um divisor vertical.
*/
.cad-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 28px;
  align-items: start;
}
.cad-divisor-v {
  background: var(--border);
  height: 100%;
  min-height: 200px;
  align-self: stretch;
}
.auth-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-col-titulo {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(160,175,220,.45);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-col-titulo::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── GRUPOS DE INPUT ────────────────────────────────────────── */
.auth-grupo { position: relative; }

.auth-label {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 7px;
  letter-spacing: .02em;
}
.auth-label-link {
  margin-left: auto;
  background: none; border: none;
  color: #8b97f8;
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px; font-weight: 500;
  cursor: pointer; padding: 0;
  transition: color .15s;
}
.auth-label-link:hover { color: #aab4ff; }

.auth-input {
  box-sizing: border-box;
  width: 100%; height: 44px;
  padding: 0 42px 0 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #e8eeff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.auth-input.sem-icone { padding-right: 14px; }
.auth-input::placeholder { color: var(--text-muted); }
.auth-input:focus {
  border-color: rgba(91,106,245,.55);
  background: rgba(91,106,245,.05);
  box-shadow: 0 0 0 3px rgba(91,106,245,.1);
}
.auth-input.valido   { border-color: rgba(52,216,99,.4); }
.auth-input.invalido { border-color: rgba(255,69,58,.4); }

/* Wrapper para posicionar o botão de olho */
.auth-input-wrap { position: relative; }
.auth-toggle-senha {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .18s; padding: 0;
}
.auth-toggle-senha:hover { color: #dde6ff; }

/* ── BARRA DE FORÇA DE SENHA ────────────────────────────────── */
.senha-forca-wrap { margin-top: 7px; }
.senha-forca-label { display: flex; justify-content: space-between; margin-bottom: 5px; }
.senha-forca-texto {
  font-size: 11px; color: var(--text-dim);
  transition: color .3s;
}
.senha-forca-barra-bg {
  height: 3px; background: rgba(255,255,255,.07);
  border-radius: 999px; overflow: hidden;
}
.senha-forca-barra {
  height: 100%; width: 0%;
  border-radius: 999px;
  transition: width .35s cubic-bezier(.4,0,.2,1), background .35s;
}
.senha-forca-barra.nivel-1 { width:25%;  background: var(--red);    }
.senha-forca-barra.nivel-2 { width:50%;  background: #ff7b2e;       }
.senha-forca-barra.nivel-3 { width:75%;  background: var(--yellow); }
.senha-forca-barra.nivel-4 { width:100%; background: var(--green);  }
.senha-forca-texto.nivel-1 { color: var(--red);    }
.senha-forca-texto.nivel-2 { color: #ff7b2e;       }
.senha-forca-texto.nivel-3 { color: var(--yellow); }
.senha-forca-texto.nivel-4 { color: var(--green);  }

.senha-forca-reqs {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px;
}
.senha-req {
  display: flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--text-muted); transition: color .2s;
}
.senha-req.ok { color: var(--green); }
.senha-req::before { content: '○'; font-size: 9px; }
.senha-req.ok::before { content: '●'; }

/* ── CHECKBOXES DE TERMOS ───────────────────────────────────── */
.auth-termos-lista {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 4px;
}
.auth-termo-row {
  display: flex; align-items: flex-start;
  gap: 10px; user-select: none;
}
.auth-termo-row input[type="checkbox"] { display: none; }

.auth-checkbox {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
  cursor: pointer;
}
/* Checkbox marcada via JS (não :checked direto pois o input está hidden) */
.auth-checkbox.marcada {
  background: var(--burple);
  border-color: var(--burple);
}
.auth-checkbox-check { opacity: 0; transition: opacity .15s; }
.auth-checkbox.marcada .auth-checkbox-check { opacity: 1; }

.auth-termo-texto {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.5;
}
.auth-termo-link {
  color: #8b97f8; font-weight: 500; cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color .15s, color .15s;
  text-decoration: none;
}
.auth-termo-link:hover { color: #aab4ff; border-bottom-color: rgba(139,151,248,.4); }

/* ── BOTÃO PRINCIPAL ────────────────────────────────────────── */
.auth-btn-principal {
  width: 100%; height: 46px;
  border-radius: 11px; border: none;
  background: var(--burple); color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .2s, transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 20px rgba(91,106,245,.35);
  letter-spacing: .01em;
}
.auth-btn-principal:hover:not(:disabled) {
  background: #6e7dff;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(91,106,245,.5);
}
.auth-btn-principal:active:not(:disabled) { transform: scale(.98); }
.auth-btn-principal:disabled {
  opacity: .4; cursor: not-allowed; box-shadow: none;
}

/* ── LINK DE ALTERNÂNCIA ────────────────────────────────────── */
.auth-link-alterar {
  text-align: center; font-size: 13px;
  color: var(--text-dim); margin-top: 20px;
}
.auth-link-alterar button {
  background: none; border: none;
  color: #8b97f8; font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0;
  transition: color .15s;
}
.auth-link-alterar button:hover { color: #aab4ff; }

/* ── MENSAGENS INLINE ───────────────────────────────────────── */
.auth-mensagem {
  display: none;
  align-items: center; gap: 8px;
  padding: 10px 13px; border-radius: 9px;
  font-size: 12.5px; line-height: 1.4;
}
.auth-mensagem.erro    { display:flex; background:rgba(255,69,58,.1);  border:1px solid rgba(255,69,58,.25);  color:#ff8a83; }
.auth-mensagem.sucesso { display:flex; background:rgba(52,216,99,.1);  border:1px solid rgba(52,216,99,.25);  color:#5de88a; }
.auth-mensagem.info    { display:flex; background:rgba(91,106,245,.1); border:1px solid rgba(91,106,245,.25); color:#8b97f8; }
.auth-mensagem svg { flex-shrink: 0; }

/* ── BOTÃO VOLTAR ───────────────────────────────────────────── */
.auth-btn-voltar {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none;
  color: var(--text-dim); font-family: 'DM Sans', sans-serif;
  font-size: 12.5px; font-weight: 500;
  cursor: pointer; padding: 0;
  margin-bottom: 20px;
  transition: color .15s, transform .15s;
}
.auth-btn-voltar:hover { color: #dde6ff; transform: translateX(-2px); }

/* ── MODAL DE TERMOS ─────────────────────────────────────────── */
.termos-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(4,8,20,.82);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.termos-overlay.aberto { display: flex; }

.termos-modal {
  width: 100%; max-width: 500px; max-height: 82vh;
  background: rgba(10,15,36,.97);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.65);
  animation: modal-entrar .28s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
@keyframes modal-entrar {
  from { transform: scale(.92) translateY(14px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.termos-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
}
.termos-header h2 { font-size: 15px; font-weight: 600; color: #e8eeff; flex: 1; }
.termos-header-icone {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--burple-dim);
  border: 1px solid rgba(91,106,245,.25);
  display: flex; align-items: center; justify-content: center;
  color: #8b97f8; flex-shrink: 0;
}

/* Badge que indica o modo (Leitura / Aceite) */
.termos-modo-badge {
  font-size: 10px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  flex-shrink: 0;
}
.termos-modo-badge.leitura {
  background: rgba(160,175,220,.1);
  color: rgba(160,175,220,.7);
  border: 1px solid rgba(160,175,220,.15);
}
.termos-modo-badge.aceite {
  background: rgba(91,106,245,.12);
  color: #8b97f8;
  border: 1px solid rgba(91,106,245,.25);
}

/* Barra de progresso de leitura */
.termos-progresso-leitura {
  height: 2px; background: rgba(255,255,255,.06); flex-shrink: 0;
}
.termos-progresso-barra {
  height: 100%; background: var(--burple);
  transform-origin: left; transform: scaleX(0);
  transition: transform .1s linear;
}

.termos-corpo {
  flex: 1; overflow-y: scroll;
  padding: 18px 22px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent;
  font-size: 12.5px; color: rgba(180,195,240,.7); line-height: 1.7;
}
.termos-corpo::-webkit-scrollbar { width: 4px; }
.termos-corpo::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.termos-corpo h3 { font-size: 13px; font-weight: 600; color: #dde6ff; margin: 16px 0 7px; }
.termos-corpo h3:first-child { margin-top: 0; }
.termos-corpo p { margin-bottom: 10px; }

.termos-footer {
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
/* Rodapé no modo leitura: só botão de fechar, centralizado */
.termos-footer.modo-leitura { justify-content: flex-end; }

.termos-aviso-leitura {
  font-size: 11.5px; color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
  transition: opacity .3s;
}
.termos-aviso-leitura.concluido { opacity: 0; pointer-events: none; }

.termos-btn-fechar,
.termos-btn-cancelar {
  padding: 9px 16px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--text-dim);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .18s, color .18s;
}
.termos-btn-fechar:hover,
.termos-btn-cancelar:hover { background: rgba(255,255,255,.08); color: #dde6ff; }

.termos-btn-concordar {
  padding: 9px 20px; border-radius: 9px; border: none;
  background: var(--burple); color: #fff;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background .18s, transform .18s, opacity .2s;
  box-shadow: 0 4px 14px rgba(91,106,245,.3);
}
.termos-btn-concordar:hover:not(:disabled) { background: #6e7dff; transform: translateY(-1px); }
.termos-btn-concordar:disabled { opacity: .32; cursor: not-allowed; box-shadow: none; transform: none; }

/* ── RESPONSIVIDADE ─────────────────────────────────────────── */
@media (max-width: 680px) {
  .auth-card.modo-cadastro { max-width: 460px; }
  .cad-grid { grid-template-columns: 1fr; gap: 0; }
  .cad-divisor-v { display: none; }
  .auth-card { padding: 28px 22px 26px; }
}