:root {
  --auth-navy: #0b1633;
  --auth-blue: #2563eb;
  --auth-blue-dark: #1d4ed8;
  --auth-slate: #475569;
  --auth-border: #dbe3ef;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body.auth-page {
  margin: 0;
  background: #f8fafc;
  color: #334155;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.auth-theme-toggle {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 20;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #64748b;
  box-shadow: 0 4px 14px rgba(15,23,42,.08);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.auth-theme-toggle:hover { color: var(--auth-blue); transform: translateY(-1px); }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, .95fr) minmax(520px, 1.05fr); }
.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(36px, 5vw, 72px);
  background:
    radial-gradient(circle at 15% 10%, rgba(37,99,235,.34), transparent 35%),
    radial-gradient(circle at 90% 80%, rgba(245,158,11,.15), transparent 25%),
    linear-gradient(145deg, #0b1633, #071126 70%);
  color: #fff;
}
.auth-brand-panel::after {
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018);
  content: "";
}
.auth-brand-content { position: relative; z-index: 1; max-width: 590px; }
.auth-brand-logo { width: min(290px, 80%); margin-bottom: clamp(70px, 13vh, 150px); }
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 7px 11px;
  border: 1px solid rgba(147,197,253,.22);
  border-radius: 999px;
  background: rgba(37,99,235,.12);
  color: #bfdbfe;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.auth-brand-message h1 { max-width: 570px; margin: 0 0 20px; color: #fff; font-size: clamp(2rem, 3.6vw, 3.35rem); font-weight: 700; letter-spacing: -.045em; line-height: 1.08; }
.auth-brand-message p { max-width: 540px; margin: 0; color: #aebbd0; font-size: clamp(.95rem, 1.25vw, 1.08rem); line-height: 1.75; }
.auth-benefits { display: grid; gap: 13px; margin-top: 38px; color: #cbd5e1; font-size: .82rem; }
.auth-benefits div { display: flex; align-items: center; gap: 10px; }
.auth-benefits i { color: #60a5fa; }
.auth-brand-version { position: relative; z-index: 1; color: #526482; font-size: .7rem; }

.auth-form-panel { display: grid; min-height: 100vh; place-items: center; padding: 42px clamp(28px, 6vw, 96px); background: #fff; }
.auth-form-wrap { width: 100%; max-width: 500px; }
.auth-mobile-logo { display: none; width: 220px; margin: 0 auto 38px; filter: drop-shadow(0 1px 1px rgba(15,23,42,.08)); }
.auth-heading { margin-bottom: 30px; }
.auth-kicker { display: block; margin-bottom: 9px; color: var(--auth-blue); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.auth-heading h2 { margin: 0 0 9px; color: #0f172a; font-size: clamp(1.65rem, 2.5vw, 2rem); font-weight: 700; letter-spacing: -.035em; }
.auth-heading p { max-width: 470px; margin: 0; color: #64748b; font-size: .86rem; line-height: 1.65; }
.auth-form { display: grid; gap: 19px; }
.auth-form-compact { gap: 14px; }
.form-label { margin-bottom: 7px; color: #334155; font-size: .76rem; font-weight: 600; }
.auth-input-wrap { position: relative; }
.auth-input-wrap > i { position: absolute; top: 50%; left: 15px; z-index: 2; width: 16px; color: #94a3b8; text-align: center; transform: translateY(-50%); }
.auth-input-wrap .form-control {
  height: 48px;
  padding: 10px 14px 10px 44px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: .83rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.auth-input-wrap .form-control::placeholder { color: #94a3b8; }
.auth-input-wrap .form-control:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.auth-input-wrap:focus-within > i { color: var(--auth-blue); }
.auth-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-inline-link, .auth-back-link, .auth-bottom-link a { color: var(--auth-blue); font-size: .73rem; font-weight: 600; text-decoration: none; }
.auth-inline-link:hover, .auth-back-link:hover, .auth-bottom-link a:hover { color: var(--auth-blue-dark); }
.auth-primary-btn, .auth-secondary-btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 700;
}
.auth-primary-btn { border-color: var(--auth-blue); background: var(--auth-blue); color: #fff; box-shadow: 0 7px 18px rgba(37,99,235,.2); }
.auth-primary-btn:hover { border-color: var(--auth-blue-dark); background: var(--auth-blue-dark); color: #fff; transform: translateY(-1px); }
.auth-secondary-btn { width: 100%; border: 1px solid var(--auth-border); background: #fff; color: #334155; }
.auth-secondary-btn:hover { border-color: #94a3b8; background: #f8fafc; color: #0f172a; }
.auth-divider { display: flex; align-items: center; gap: 13px; margin: 24px 0 16px; color: #94a3b8; font-size: .68rem; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: #e2e8f0; content: ""; }
.auth-bottom-link { margin: 20px 0 0; color: #64748b; font-size: .75rem; text-align: center; }
.auth-back-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 24px; }
.auth-terms { margin: -2px 0 0; color: #64748b; font-size: .68rem; }
.auth-terms i { margin-right: 5px; color: #059669; }
.auth-footer { margin-top: 40px; color: #94a3b8; font-size: .67rem; text-align: center; }
.auth-state { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; padding: 15px; border-radius: 10px; }
.auth-state > i { margin-top: 2px; }
.auth-state strong { display: block; margin-bottom: 3px; }
.auth-state p { margin: 0; font-size: .76rem; }
.auth-state-error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.alert { margin-bottom: 22px; padding: 11px 13px; border-radius: 9px; font-size: .76rem; }

html[data-theme="dark"] { color-scheme: dark; background: #080f1f; }
html[data-theme="dark"] body.auth-page { background: #0a1222; color: #cbd5e1; }
html[data-theme="dark"] .auth-form-panel { background: #0a1222; }
html[data-theme="dark"] .auth-theme-toggle { border-color: #334155; background: rgba(17,28,48,.94); color: #fbbf24; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
html[data-theme="dark"] .auth-heading h2 { color: #f8fafc; }
html[data-theme="dark"] .auth-heading p,
html[data-theme="dark"] .auth-bottom-link,
html[data-theme="dark"] .auth-terms { color: #94a3b8; }
html[data-theme="dark"] .form-label { color: #cbd5e1; }
html[data-theme="dark"] .auth-input-wrap .form-control { border-color: #334155; background: #0d1728; color: #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,.24); }
html[data-theme="dark"] .auth-input-wrap .form-control::placeholder { color: #64748b; }
html[data-theme="dark"] .auth-input-wrap .form-control:focus { border-color: #3b82f6; background: #111c30; box-shadow: 0 0 0 4px rgba(59,130,246,.16); }
html[data-theme="dark"] .auth-input-wrap > i { color: #64748b; }
html[data-theme="dark"] .auth-input-wrap:focus-within > i { color: #60a5fa; }
html[data-theme="dark"] .auth-secondary-btn { border-color: #334155; background: #111c30; color: #cbd5e1; }
html[data-theme="dark"] .auth-secondary-btn:hover { border-color: #475569; background: #18253a; color: #fff; }
html[data-theme="dark"] .auth-divider { color: #64748b; }
html[data-theme="dark"] .auth-divider::before,
html[data-theme="dark"] .auth-divider::after { background: #26334a; }
html[data-theme="dark"] .auth-footer { color: #64748b; }
html[data-theme="dark"] .auth-state-error { border-color: #7f1d1d; background: #321b23; color: #fecaca; }
html[data-theme="dark"] .alert-success { border-color: #065f46; background: #082b2a; color: #a7f3d0; }
html[data-theme="dark"] .alert-info { border-color: #075985; background: #102b43; color: #bae6fd; }
html[data-theme="dark"] .alert-warning { border-color: #78350f; background: #2d2112; color: #fde68a; }
html[data-theme="dark"] .alert-danger { border-color: #7f1d1d; background: #321b23; color: #fecaca; }

@media (max-width: 1000px) {
  .auth-shell { grid-template-columns: minmax(350px, .78fr) minmax(480px, 1.22fr); }
  .auth-brand-panel { padding: 40px; }
  .auth-brand-logo { margin-bottom: 80px; }
  .auth-brand-message h1 { font-size: 2.3rem; }
}
/* Mantém o acesso inteiro visível em notebooks sem comprimir telas espaçosas. */
@media (min-width: 821px) and (max-height: 900px) {
  .auth-brand-panel { padding: 28px clamp(30px, 4vw, 54px); }
  .auth-brand-logo { width: min(240px, 72%); margin-bottom: clamp(28px, 6vh, 48px); }
  .auth-eyebrow { margin-bottom: 12px; padding: 6px 10px; }
  .auth-brand-message h1 { margin-bottom: 14px; font-size: clamp(1.75rem, 3vw, 2.55rem); line-height: 1.04; }
  .auth-brand-message p { font-size: .9rem; line-height: 1.55; }
  .auth-benefits { gap: 9px; margin-top: 22px; font-size: .76rem; }

  .auth-form-panel { padding: 24px clamp(30px, 5vw, 72px); }
  .auth-form-wrap { max-width: 460px; }
  .auth-heading { margin-bottom: 20px; }
  .auth-heading h2 { margin-bottom: 6px; font-size: 1.6rem; }
  .auth-heading p { line-height: 1.45; }
  .auth-form { gap: 14px; }
  .form-label { margin-bottom: 5px; }
  .auth-input-wrap .form-control { height: 44px; }
  .auth-primary-btn, .auth-secondary-btn { min-height: 44px; }
  .auth-divider { margin: 18px 0 12px; }
  .auth-footer { margin-top: 22px; }
  .alert { margin-bottom: 14px; }
}
@media (max-width: 820px) {
  .auth-shell { display: block; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; padding: 38px 24px; background: linear-gradient(180deg, #f8fafc, #fff 28%); }
  .auth-mobile-logo { display: block; }
  html[data-theme="dark"] .auth-form-panel { background: linear-gradient(180deg, #0d1728, #0a1222 28%); }
}
@media (max-width: 520px) {
  .auth-form-panel { align-items: start; padding: 28px 18px; }
  .auth-mobile-logo { width: 190px; margin-bottom: 30px; }
  .auth-two-columns { grid-template-columns: 1fr; }
  .auth-heading { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
