/* Dark mode das páginas SEM o shell (login, cadastro, recuperar/redefinir senha, verificação e Termos/Privacidade).
   Mesma paleta do resto do sistema: os tokens --dk-* abaixo são CÓPIA dos de client-shell.css (este arquivo não carrega o shell) e um teste
   (DarkTokensTest) falha se os valores divergirem. A escolha vem do mesmo `shellTheme` do navegador (ou da preferência do sistema). */
html[data-bs-theme="dark"] {
  --dk-page: #0c0e13;
  --dk-surface: #161922;
  --dk-surface-2: #1d212c;
  --dk-surface-3: #242936;
  --dk-border: #2a2f3d;
  --dk-text: #e7e9ee;
  --dk-text-muted: #9aa2b5;
  color-scheme: dark;
}

/* ── login / cadastro / recuperar / redefinir / verificação ── */
html[data-bs-theme="dark"] body.authx-body { background: var(--dk-page); color: var(--dk-text); }
html[data-bs-theme="dark"] .authx-side { background: linear-gradient(160deg, var(--dk-surface-2) 0%, var(--dk-surface) 55%, var(--dk-page) 100%); }
html[data-bs-theme="dark"] .authx-tagline h2 { color: var(--dk-text); }
html[data-bs-theme="dark"] .authx-tagline p { color: var(--dk-text-muted); }
html[data-bs-theme="dark"] .authx-form-side { background: var(--dk-surface); }
html[data-bs-theme="dark"] .authx-form-card h1 { color: var(--dk-text); }
html[data-bs-theme="dark"] .authx-sub,
html[data-bs-theme="dark"] .authx-field label,
html[data-bs-theme="dark"] .authx-form-footer,
html[data-bs-theme="dark"] .authx-consent label,
html[data-bs-theme="dark"] .authx-resend,
html[data-bs-theme="dark"] .authx-hint,
html[data-bs-theme="dark"] .authx-step-label,
html[data-bs-theme="dark"] .authx-divider,
html[data-bs-theme="dark"] .authx-oauth-consent,
html[data-bs-theme="dark"] .authx-oauth-consent a,
html[data-bs-theme="dark"] .authx-copyright { color: var(--dk-text-muted); }
html[data-bs-theme="dark"] .authx-resend button:disabled { color: var(--dk-text-muted); opacity: .6; }
html[data-bs-theme="dark"] .authx-step-item.active .authx-step-label { color: var(--dk-text); }
html[data-bs-theme="dark"] .authx-step-circle { background: var(--dk-surface-3); color: var(--dk-text-muted); }
html[data-bs-theme="dark"] .authx-step-item.active .authx-step-circle { color: #fff; }
html[data-bs-theme="dark"] .authx-step-item.done .authx-step-circle { background: color-mix(in srgb, var(--authx-accent) 24%, var(--dk-surface-3)); }
html[data-bs-theme="dark"] .authx-step-line { background: var(--dk-border); }

/* campos */
html[data-bs-theme="dark"] .authx-input,
html[data-bs-theme="dark"] .authx-input-plain,
html[data-bs-theme="dark"] .otp-box { background: var(--dk-surface-2); border-color: var(--dk-border); color: var(--dk-text); }
html[data-bs-theme="dark"] .authx-input:focus-within,
html[data-bs-theme="dark"] .authx-input-plain:focus,
html[data-bs-theme="dark"] .otp-box:focus { background: var(--dk-surface-3); }
html[data-bs-theme="dark"] .authx-input > i:first-child,
html[data-bs-theme="dark"] .toggle-password { color: var(--dk-text-muted); }
html[data-bs-theme="dark"] .toggle-password:hover { color: var(--authx-accent); }
html[data-bs-theme="dark"] .authx-input input,
html[data-bs-theme="dark"] .authx-input-plain { color: var(--dk-text); }
html[data-bs-theme="dark"] .authx-input input::placeholder { color: color-mix(in srgb, var(--dk-text-muted) 70%, transparent); }
html[data-bs-theme="dark"] .authx-input:has(input.is-invalid),
html[data-bs-theme="dark"] .authx-input-plain.is-invalid { background: color-mix(in srgb, #e5484d 12%, var(--dk-surface-2)); border-color: color-mix(in srgb, #e5484d 60%, var(--dk-border)); }

/* botões e divisores */
html[data-bs-theme="dark"] .authx-divider::before,
html[data-bs-theme="dark"] .authx-divider::after { background: var(--dk-border); }
html[data-bs-theme="dark"] .authx-btn-google { background: var(--dk-surface-2); border-color: var(--dk-border); color: var(--dk-text); }
html[data-bs-theme="dark"] .authx-btn-google:hover { background: var(--dk-surface-3); }
html[data-bs-theme="dark"] .authx-btn-ghost { background: var(--dk-surface-3); color: var(--dk-text-muted); }
html[data-bs-theme="dark"] .authx-btn-ghost:hover { background: var(--dk-border); color: var(--dk-text); }

/* avisos (mesmos tons de aviso/sucesso/erro do resto do dark) */
html[data-bs-theme="dark"] .authx-alert-warning { background: color-mix(in srgb, #ffc857 12%, var(--dk-surface)); border-color: color-mix(in srgb, #ffc857 35%, var(--dk-border)); color: #ffc857; }
html[data-bs-theme="dark"] .authx-alert-success { background: color-mix(in srgb, #4ade9c 12%, var(--dk-surface)); border-color: color-mix(in srgb, #4ade9c 35%, var(--dk-border)); color: #4ade9c; }
html[data-bs-theme="dark"] .authx-alert-danger { background: color-mix(in srgb, #f5b3b0 10%, var(--dk-surface)); border-color: color-mix(in srgb, #f5b3b0 35%, var(--dk-border)); color: #f5b3b0; }

/* ── Termos de Uso / Política de Privacidade ── */
html[data-bs-theme="dark"] body { background: var(--dk-page); color: var(--dk-text); }
html[data-bs-theme="dark"] .legal-card { background: var(--dk-surface); box-shadow: none; border: 1px solid var(--dk-border); }
html[data-bs-theme="dark"] .legal-updated { color: var(--dk-text-muted); }
html[data-bs-theme="dark"] .legal-content { color: var(--dk-text); }
html[data-bs-theme="dark"] .legal-content h1,
html[data-bs-theme="dark"] .legal-content h2,
html[data-bs-theme="dark"] .legal-content h3,
html[data-bs-theme="dark"] .legal-title { color: var(--dk-text); }
