:root {
  color-scheme: light;
  --auth-bg: #f7f7f5;
  --auth-panel: #ffffff;
  --auth-card: #f1f2ee;
  --auth-text: #171815;
  --auth-muted: #656861;
  --auth-border: #dfe1da;
  --auth-accent: #a9d34f;
  --auth-accent-strong: #86b62d;
  --auth-danger: #b94738;
  --auth-success: #247747;
  --auth-shadow: 0 24px 70px rgba(22, 28, 18, .12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.auth-dark {
  color-scheme: dark;
  --auth-bg: #0f100f;
  --auth-panel: #181a18;
  --auth-card: #20231f;
  --auth-text: #f4f5f1;
  --auth-muted: #a9ada5;
  --auth-border: #33372f;
  --auth-accent: #b4dc58;
  --auth-accent-strong: #c4eb6d;
  --auth-danger: #ff9b8b;
  --auth-success: #85d9a8;
  --auth-shadow: 0 24px 80px rgba(0, 0, 0, .36);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--auth-bg);
  color: var(--auth-text);
}

.auth-layout {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .75fr);
  gap: 64px;
  align-items: center;
  padding: 48px 0;
}

.auth-intro { display: grid; gap: 52px; padding: 24px; }
.auth-brand, .auth-mobile-brand { display: flex; align-items: center; gap: 14px; color: var(--auth-text); text-decoration: none; }
.auth-brand span { font-size: 28px; font-weight: 760; letter-spacing: -.04em; }
.auth-intro h1 { max-width: 640px; margin: 10px 0 16px; font-size: clamp(42px, 6vw, 72px); line-height: .98; letter-spacing: -.06em; }
.auth-intro p { max-width: 570px; margin: 0; color: var(--auth-muted); font-size: 18px; line-height: 1.65; }
.auth-eyebrow { margin: 0; color: var(--auth-accent-strong); font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.auth-benefits { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; color: var(--auth-muted); }
.auth-benefits li { position: relative; padding-left: 28px; }
.auth-benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--auth-accent-strong); font-weight: 900; }

.auth-panel {
  width: 100%;
  max-width: 480px;
  justify-self: end;
  padding: 32px;
  border: 1px solid var(--auth-border);
  border-radius: 28px;
  background: var(--auth-panel);
  box-shadow: var(--auth-shadow);
}

.auth-mobile-brand { display: none; margin-bottom: 28px; font-size: 21px; }
.auth-mobile-brand.always { display: flex; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--auth-card); }
.auth-tabs button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--auth-muted); font: inherit; font-weight: 700; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--auth-panel); color: var(--auth-text); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.auth-tabs button:focus-visible, .auth-primary:focus-visible, .auth-link:focus-visible, .password-field button:focus-visible, .auth-field input:focus-visible { outline: 3px solid rgba(134, 182, 45, .58); outline-offset: 2px; }

#authForm, #resetForm { display: grid; gap: 18px; margin-top: 28px; }
.auth-heading { margin-bottom: 4px; }
.auth-heading h1, .auth-heading h2 { margin: 7px 0 8px; color: var(--auth-text); font-size: 30px; line-height: 1.12; letter-spacing: -.035em; }
.auth-heading p:last-child { margin: 0; color: var(--auth-muted); line-height: 1.5; }
.auth-field { display: grid; gap: 8px; }
.auth-field label { font-size: 13px; font-weight: 750; }
.auth-field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--auth-border);
  border-radius: 13px;
  background: var(--auth-bg);
  color: var(--auth-text);
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
}
.auth-field input:disabled { opacity: .58; cursor: wait; }
.password-field { position: relative; }
.password-field input { padding-right: 82px; }
.password-field button { position: absolute; right: 7px; top: 7px; min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--auth-muted); font-weight: 750; cursor: pointer; }
.auth-primary { min-height: 50px; border: 0; border-radius: 13px; background: var(--auth-accent); color: #182006; font: inherit; font-weight: 850; cursor: pointer; }
.auth-primary:hover:not(:disabled) { background: var(--auth-accent-strong); }
.auth-primary:active:not(:disabled) { transform: translateY(1px); }
.auth-primary:disabled, .auth-tabs button:disabled, .auth-link:disabled { opacity: .56; cursor: wait; }
.auth-link { justify-self: center; min-height: 40px; border: 0; background: transparent; color: var(--auth-text); font: inherit; font-weight: 700; cursor: pointer; }
.auth-link-anchor { display: grid; place-items: center; text-decoration: none; }
.pwa-auth-install { margin-top: -4px; }
.pwa-install-status { margin: -8px 0 0; color: var(--auth-muted); font-size: .78rem; line-height: 1.45; text-align: center; }
.auth-message { padding: 12px 14px; border: 1px solid; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.auth-error { border-color: rgba(185, 71, 56, .38); background: rgba(185, 71, 56, .09); color: var(--auth-danger); }
.auth-success { border-color: rgba(36, 119, 71, .38); background: rgba(36, 119, 71, .09); color: var(--auth-success); }
.auth-privacy { margin: 22px 0 0; color: var(--auth-muted); font-size: 12px; line-height: 1.5; text-align: center; }
.auth-single { width: min(480px, calc(100% - 32px)); min-height: 100vh; min-height: 100dvh; margin: 0 auto; display: grid; place-items: center; padding: 30px 0; }

.auth-gate { position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 28px; background: #f7f7f5; color: #171815; text-align: center; }
.auth-gate h1 { margin: 4px 0 0; font-size: 28px; }
.auth-gate p { max-width: 480px; margin: 0 0 10px; color: #656861; line-height: 1.5; }
html:not(.auth-pending) .auth-gate[hidden] { display: none; }
html.auth-pending body > :not(.auth-gate):not(script) { visibility: hidden; }
html.auth-pending .auth-gate { visibility: visible; }
.account-status { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; background: rgba(134, 182, 45, .14); color: #688f20; font-size: 12px; font-weight: 800; }
body.dark .account-status { color: #b4dc58; }

@media (max-width: 800px) {
  .auth-layout { width: min(100% - 28px, 480px); grid-template-columns: 1fr; gap: 0; padding: 20px 0; }
  .auth-intro { display: none; }
  .auth-panel { justify-self: stretch; max-width: none; padding: 24px 20px; border-radius: 22px; }
  .auth-mobile-brand { display: flex; }
}

@media (max-width: 390px) {
  .auth-layout { width: 100%; padding: 0; }
  .auth-panel { min-height: 100vh; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
/* Páginas públicas de privacidade e termos */
.auth-privacy a{color:inherit;font-weight:750}.legal-page{overflow:auto}.legal-shell{width:min(760px,calc(100% - 32px));margin:0 auto;padding:34px 0 70px}.legal-shell>.auth-brand{margin-bottom:24px}.legal-card{width:100%;padding:clamp(24px,5vw,48px)}.legal-card h1{font-size:clamp(28px,5vw,44px);line-height:1.05;margin:8px 0 14px}.legal-card h2{font-size:18px;margin:28px 0 6px}.legal-card p{color:var(--auth-muted);line-height:1.7}.auth-link-button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;margin-top:22px;padding:13px 18px}
