:root {
  color-scheme: light;
  --bg: #F8FFFD;
  --bg-2: #ECFBF7;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --text: #03363A;
  --text-muted: #5D7975;
  --text-dim: #486C67;
  --teal-core: #0F766E;
  --teal-mid: #14B8A6;
  --primary: #2DD4BF;
  --primary-light: #5EEAD4;
  --on-primary: #042422;
  --border: rgba(15, 118, 110, 0.16);
  --border-2: rgba(15, 118, 110, 0.24);
  --border-3: rgba(15, 118, 110, 0.34);
  --danger: #F87171;
  --grad-teal: linear-gradient(135deg, #5EEAD4 0%, #2DD4BF 50%, #0F766E 100%);
  --body-aura:
    radial-gradient(1200px 600px at 80% -10%, rgba(45,212,191,0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(15,118,110,0.08), transparent 60%);
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --r-sm: 6px;
  --r: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 30px 80px -40px rgba(3, 54, 58, 0.32);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #031F1C;
  --bg-2: #052724;
  --surface: #082F2B;
  --card: #082F2B;
  --text: #E6F4F1;
  --text-muted: #9DB8B3;
  --text-dim: #B4CBC7;
  --border: rgba(94, 234, 212, 0.14);
  --border-2: rgba(94, 234, 212, 0.22);
  --border-3: rgba(94, 234, 212, 0.34);
  --body-aura:
    radial-gradient(1200px 600px at 80% -10%, rgba(45,212,191,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(15,118,110,0.10), transparent 60%);
  --shadow: 0 30px 80px -34px rgba(0,0,0,0.70);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--body-aura);
  pointer-events: none;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 520px);
  gap: 64px;
  align-items: center;
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 48px 0;
}
.auth-shell.compact { grid-template-columns: minmax(360px, 1fr) minmax(360px, 480px); }
.auth-brand-panel {
  min-width: 0;
  padding: 40px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 76px;
}
.brand img {
  height: 58px;
  width: auto;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--primary);
}
.auth-copy h1 {
  margin: 18px 0 18px;
  max-width: 680px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: -0.035em;
}
.auth-copy p {
  max-width: 600px;
  margin: 0;
  color: var(--text-dim);
  font-size: 17px;
}
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 42px;
}
.proof-grid div {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: rgba(255,255,255,0.32);
  padding: 16px;
}
html[data-theme="dark"] .proof-grid div { background: rgba(0,0,0,0.14); }
.proof-grid b {
  display: block;
  color: var(--primary-light);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
}
.proof-grid span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-card {
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(45,212,191,0.07), transparent 38%), var(--card);
  box-shadow: var(--shadow);
  padding: 38px;
}
.auth-card-head h2 {
  margin: 14px 0 8px;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.auth-card-head p {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 14px;
}
.auth-form {
  display: grid;
  gap: 16px;
}
.auth-form label {
  display: grid;
  gap: 7px;
}
.auth-form label span {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}
.auth-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.70);
  color: var(--text);
  padding: 0 14px;
  outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
html[data-theme="dark"] .auth-form input { background: rgba(0,0,0,0.16); }
.auth-form input:focus {
  border-color: var(--border-3);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.16);
}
.auth-form input::placeholder { color: var(--text-muted); }
.form-error {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--danger);
  font-size: 13px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 0;
  border-radius: var(--r);
  padding: 0 20px;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary {
  background: var(--grad-teal);
  color: var(--on-primary);
  box-shadow: 0 10px 34px -16px rgba(45,212,191,0.70);
}
.auth-link {
  margin: 22px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}
.auth-link a {
  color: var(--primary-light);
  font-weight: 600;
}

@media (max-width: 920px) {
  .auth-shell,
  .auth-shell.compact {
    grid-template-columns: 1fr;
    gap: 24px;
    width: min(680px, calc(100vw - 36px));
    padding: 28px 0;
  }
  .auth-brand-panel { padding: 16px 0 0; }
  .brand { margin-bottom: 34px; }
  .auth-copy h1 { font-size: clamp(34px, 9vw, 48px); }
}
@media (max-width: 560px) {
  .proof-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 26px; }
  .brand img { height: 44px; }
}

/* ===========================================================================
   Auth additions 2026-07 — SSO, password reset, strength meter, notices.
   =========================================================================== */
.auth-row-links {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 0;
}
.auth-row-links a,
.auth-inline-link {
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
html[data-theme="light"] .auth-row-links a,
html[data-theme="light"] .auth-inline-link { color: var(--teal-core); }

.form-success {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--teal-mid);
  font-size: 13px;
}

.auth-notice {
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: rgba(45,212,191,0.07);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.auth-notice.is-error {
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.07);
  color: var(--danger);
}

/* SSO section */
.sso-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.sso-divider::before,
.sso-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.sso-buttons { display: grid; gap: 10px; }
.btn-sso {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.btn-sso:hover { border-color: var(--border-3); background: var(--bg-2); }
.btn-sso svg { flex: 0 0 auto; }

/* Password strength meter + policy checklist (register / reset) */
.pw-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 8px;
}
.pw-meter span {
  height: 5px;
  border-radius: 3px;
  background: var(--border-2);
  transition: background .2s ease;
}
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: #F59E0B; }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: var(--teal-mid); }
.pw-meter[data-score="4"] span:nth-child(-n+4) { background: var(--primary); }
.pw-meter-label {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}
.pw-policy {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.pw-policy li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.pw-policy li::before {
  content: "•";
  color: var(--border-3);
  line-height: 1.4;
}
.pw-policy li.is-problem { color: var(--danger); }
.pw-policy li.is-problem::before { content: "✕"; color: var(--danger); font-size: 10px; margin-top: 2px; }
.pw-policy li.is-ok { color: var(--teal-mid); }
.pw-policy li.is-ok::before { content: "✓"; color: var(--teal-mid); font-size: 11px; margin-top: 1px; }

/* Secondary auth views (reset request / confirm) share the login card */
.auth-view[hidden] { display: none !important; }
.auth-view-back {
  margin-top: 18px;
  text-align: center;
}
