/* ── login.css — split-panel sign-in design ──────────────────────
   Self-contained: this is the only stylesheet the /login page loads.
   Theme switches via [data-theme="light"] / [data-theme="dark"] on <html>.  */

:root {
  --lg-accent: #5eb588;
  --lg-accent-strong: #4ea577;
  --lg-accent-soft-22: rgba(94, 181, 136, 0.13);
  --lg-accent-soft-33: rgba(94, 181, 136, 0.2);
  --lg-accent-soft-44: rgba(94, 181, 136, 0.27);
  --lg-accent-soft-66: rgba(94, 181, 136, 0.4);
  --lg-accent-soft-88: rgba(94, 181, 136, 0.53);
  --lg-success: oklch(0.7 0.14 165);
}

/* Light theme (default) */
:root, [data-theme="light"] {
  --lg-bg-page: oklch(0.97 0.005 80);
  --lg-bg-panel: oklch(0.99 0.005 80);
  --lg-fg: oklch(0.2 0.02 250);
  --lg-muted: oklch(0.5 0.01 250);
  --lg-field-bg: oklch(0.97 0.005 80);
  --lg-field-border: oklch(0.88 0.01 80);
  --lg-divider: oklch(0.9 0.01 80);
  --lg-card-bg: oklch(0.98 0.005 80 / 0.7);
  --lg-card-border: oklch(0.88 0.01 80);
  --lg-brand-bg: radial-gradient(ellipse 90% 60% at 30% 30%, oklch(0.99 0.01 80) 0%, oklch(0.96 0.005 80) 100%);
  --lg-grid: oklch(0.85 0.01 250);
  --lg-toggle-bg: oklch(0.98 0.005 80);
  --lg-shadow-card: 0 30px 80px -30px oklch(0.5 0.02 250 / 0.2);
}

[data-theme="dark"] {
  --lg-bg-page: oklch(0.16 0.015 250);
  --lg-bg-panel: oklch(0.18 0.015 250);
  --lg-fg: oklch(0.95 0.01 80);
  --lg-muted: oklch(0.65 0.01 250);
  --lg-field-bg: oklch(0.21 0.015 250);
  --lg-field-border: oklch(0.3 0.015 250);
  --lg-divider: oklch(0.24 0.015 250);
  --lg-card-bg: oklch(0.22 0.015 250 / 0.5);
  --lg-card-border: oklch(0.28 0.015 250);
  --lg-brand-bg: radial-gradient(ellipse 90% 60% at 30% 30%, oklch(0.22 0.025 260) 0%, oklch(0.14 0.015 250) 100%);
  --lg-grid: oklch(0.28 0.01 250);
  --lg-toggle-bg: oklch(0.22 0.015 250);
  --lg-shadow-card: 0 30px 80px -30px oklch(0 0 0 / 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--lg-bg-page);
  color: var(--lg-fg);
  min-height: 100vh;
}
input, button, select, textarea { font-family: inherit; }
input::placeholder { color: oklch(0.5 0.01 250 / 0.6); }

/* ─ Layout ───────────────────────────────────────────────────── */
.lg-page {
  min-height: 100vh;
  display: flex;
  position: relative;
}
.lg-brand {
  flex: 1.1;
  position: relative;
  background: var(--lg-brand-bg);
  border-right: 1px solid var(--lg-divider);
  overflow: hidden;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.lg-form-wrap {
  flex: 1;
  background: var(--lg-bg-panel);
  display: grid;
  place-items: center;
  padding: 48px 56px;
  position: relative;
}

/* ─ Theme toggle ─────────────────────────────────────────────── */
.lg-theme-btn {
  position: absolute; top: 24px; right: 24px; z-index: 10;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--lg-toggle-bg);
  border: 1px solid var(--lg-field-border);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--lg-fg);
  transition: all .2s ease;
}
.lg-theme-btn:hover { border-color: var(--lg-muted); }

/* ─ Logo ─────────────────────────────────────────────────────── */
.lg-logo { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.lg-logo-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--lg-accent) 0%, oklch(0.62 0.14 30) 100%);
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 8px 24px -10px var(--lg-accent-soft-66);
  position: relative;
}
.lg-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.lg-logo-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.lg-logo-sub { font-size: 12px; opacity: 0.55; margin-top: 3px; }

/* ─ Trajectory chart ─────────────────────────────────────────── */
.lg-chart {
  border-radius: 16px;
  padding: 20px;
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-card-border);
  backdrop-filter: blur(8px);
}
.lg-chart-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.lg-chart-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--lg-muted); margin-bottom: 6px; }
.lg-chart-amount { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--lg-fg); font-feature-settings: "tnum"; }
.lg-chart-pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--lg-accent-soft-22); color: var(--lg-accent);
  border: 1px solid var(--lg-accent-soft-44); font-weight: 500;
}
.lg-chart-svg { width: 100%; height: auto; display: block; }
.lg-chart-grid { stroke: var(--lg-grid); stroke-dasharray: 2 4; stroke-width: 1; fill: none; }
.lg-chart-goal-area { fill: url(#lg-goal-grad); opacity: 0; animation: lg-fadeIn 1.8s ease-out forwards; }
.lg-chart-goal-line {
  fill: none; stroke: var(--lg-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 800; stroke-dashoffset: 800;
  animation: lg-draw 1.8s ease-out forwards;
}
.lg-chart-debt-line {
  fill: none; stroke: var(--lg-muted); stroke-width: 1.6; stroke-dasharray: 3 4; stroke-linecap: round;
  opacity: 0; animation: lg-fadeIn 1.8s ease-out forwards; animation-delay: .15s;
}
.lg-chart-end-dot, .lg-chart-end-glow { opacity: 0; animation: lg-fadeIn .5s ease-out forwards; animation-delay: 1.5s; }
.lg-chart-mlabel { font-size: 9px; fill: var(--lg-muted); font-family: Inter, sans-serif; }
.lg-chart-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 11px; color: var(--lg-muted); }
.lg-chart-legend-item { display: flex; align-items: center; gap: 6px; }
.lg-chart-legend-bar { width: 10px; height: 2px; border-radius: 2px; background: var(--lg-accent); }
.lg-chart-legend-dash { width: 10px; border-top: 1.5px dashed var(--lg-muted); }
@keyframes lg-draw { to { stroke-dashoffset: 0; } }
@keyframes lg-fadeIn { to { opacity: var(--lg-fade-target, 1); } }

/* ─ Headline + pitch ─────────────────────────────────────────── */
.lg-mid { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 32px; max-width: 540px; }
.lg-headline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 48px; font-weight: 400; letter-spacing: -0.02em;
  color: var(--lg-fg); margin: 0; line-height: 1.05;
}
.lg-headline em { font-style: italic; color: var(--lg-accent); }
.lg-pitch { color: var(--lg-muted); margin: 16px 0 0 0; font-size: 15px; line-height: 1.55; max-width: 460px; }

/* ─ Changelog (collapsible) ─────────────────────────────────── */
.lg-changelog {
  position: relative; z-index: 1;
  border-radius: 14px;
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-card-border);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: all .25s ease;
}
.lg-changelog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid transparent;
}
.lg-changelog.open .lg-changelog-head { border-bottom-color: var(--lg-card-border); }
.lg-changelog-title { display: flex; align-items: center; gap: 10px; }
.lg-changelog-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lg-muted); }
.lg-changelog-pill {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: var(--lg-accent-soft-22); color: var(--lg-accent); font-weight: 600;
  border: 1px solid var(--lg-accent-soft-33);
}
.lg-changelog-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--lg-muted); font-size: 12px; font-family: inherit;
  display: flex; align-items: center; gap: 4px; padding: 0;
}
.lg-changelog-toggle .lg-chev { transition: transform .2s; display: inline-block; }
.lg-changelog.open .lg-changelog-toggle .lg-chev { transform: rotate(180deg); }
.lg-changelog-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 16px;
  max-height: none; overflow: visible;
}
.lg-changelog.open .lg-changelog-body { max-height: 280px; overflow-y: auto; }
.lg-cl-entry { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: flex-start; }
.lg-cl-meta { padding-top: 2px; }
.lg-cl-ver { font-size: 12px; font-weight: 600; color: var(--lg-fg); font-feature-settings: "tnum"; }
.lg-cl-date { font-size: 10px; color: var(--lg-muted); margin-top: 2px; font-feature-settings: "tnum"; }
.lg-cl-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.lg-cl-item { font-size: 12.5px; color: var(--lg-muted); line-height: 1.5; display: flex; gap: 8px; }
.lg-cl-bullet { margin-top: 7px; flex-shrink: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--lg-muted); }
.lg-cl-entry.is-latest .lg-cl-bullet { background: var(--lg-accent); }

/* ─ Starfield (dark mode only) ─────────────────────────────── */
.lg-stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
[data-theme="light"] .lg-stars { display: none; }
@keyframes lg-twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.8; } }

/* ─ Auth form ───────────────────────────────────────────────── */
.lg-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.lg-h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 44px; font-weight: 400; letter-spacing: -0.015em;
  color: var(--lg-fg); margin: 0; line-height: 1.05;
}
.lg-h1-sub { color: var(--lg-muted); margin: 8px 0 0 0; font-size: 14px; }

.lg-sso { display: flex; gap: 8px; }
.lg-sso-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 10px; font-size: 13px; font-weight: 500;
  background: var(--lg-field-bg);
  border: 1px solid var(--lg-field-border);
  border-radius: 10px; color: var(--lg-fg);
  cursor: pointer; transition: all .15s ease;
}
.lg-sso-btn:hover { border-color: var(--lg-accent); }
.lg-sso-btn[disabled] { cursor: not-allowed; opacity: .55; }
.lg-sso-btn[disabled]:hover { border-color: var(--lg-field-border); }
.lg-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--lg-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
}
.lg-divider::before, .lg-divider::after { content: ""; flex: 1; height: 1px; background: var(--lg-field-border); }

.lg-field { display: block; }
.lg-field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lg-label { font-size: 12px; font-weight: 500; color: var(--lg-fg); display: block; letter-spacing: -0.005em; margin-bottom: 6px; }
.lg-field-row .lg-label { margin-bottom: 0; }
.lg-input {
  width: 100%; padding: 14px 16px; font-size: 14px;
  background: var(--lg-field-bg);
  border: 1px solid var(--lg-field-border);
  border-radius: 10px; color: var(--lg-fg); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lg-input:focus { border-color: var(--lg-accent); box-shadow: 0 0 0 4px var(--lg-accent-soft-22); }
.lg-input.has-eye { padding-right: 44px; }
.lg-pw-wrap { position: relative; }
.lg-eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--lg-muted); display: grid; place-items: center;
}
.lg-link {
  font-size: 12px; color: var(--lg-muted); background: none; border: none;
  cursor: pointer; padding: 0; font-family: inherit;
}
.lg-link:hover { color: var(--lg-fg); }

.lg-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.lg-remember { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--lg-muted); cursor: pointer; user-select: none; }
.lg-checkbox {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--lg-field-border);
  background: transparent;
  display: grid; place-items: center;
  transition: all .15s ease;
}
.lg-remember.is-on .lg-checkbox { border-color: var(--lg-accent); background: var(--lg-accent); }
.lg-checkbox svg { display: none; }
.lg-remember.is-on .lg-checkbox svg { display: block; }

.lg-submit {
  padding: 14px 20px; font-size: 14px; font-weight: 600;
  background: var(--lg-accent); color: oklch(0.15 0.02 250);
  border: none; border-radius: 10px; cursor: pointer;
  letter-spacing: -0.005em;
  transition: background .2s ease, transform .1s ease;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 24px -10px var(--lg-accent-soft-88);
}
.lg-submit:active { transform: scale(0.98); }
.lg-submit:disabled { cursor: wait; }
.lg-submit.is-success { background: var(--lg-success); }
.lg-submit-arrow { opacity: 0.5; }

.lg-spinner { width: 16px; height: 16px; animation: lg-spin .8s linear infinite; }
@keyframes lg-spin { to { transform: rotate(360deg); } }

.lg-msg-err {
  font-size: 12px; color: oklch(0.55 0.18 25); background: oklch(0.95 0.04 25);
  padding: 10px 14px; border-radius: 8px;
  display: none;
}
[data-theme="dark"] .lg-msg-err { color: oklch(0.78 0.14 25); background: oklch(0.3 0.08 25 / .4); }
.lg-msg-err.show { display: block; }
.lg-msg-ok {
  font-size: 12px; color: oklch(0.5 0.13 145); background: oklch(0.95 0.05 145);
  padding: 10px 14px; border-radius: 8px;
  display: none;
}
[data-theme="dark"] .lg-msg-ok { color: oklch(0.78 0.13 145); background: oklch(0.3 0.08 145 / .4); }
.lg-msg-ok.show { display: block; }

.lg-foot { text-align: center; font-size: 13px; color: var(--lg-muted); }
.lg-foot button.lg-link-strong { color: var(--lg-fg); font-weight: 500; font-size: 13px; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }

/* Legal footnote — sits below whichever auth form is showing. Keeps the
   Terms / Privacy links present on every state of the page (sign-in,
   sign-up, password-reset request, set-new-password) without crowding
   the primary CTA. */
.lg-legal-foot { text-align: center; font-size: 11px; color: var(--lg-muted); margin-top: 24px; line-height: 1.55; }
.lg-legal-foot a { color: var(--lg-fg); text-decoration: underline; text-underline-offset: 2px; }
.lg-legal-foot a:hover { color: var(--lg-accent-strong); }

/* ─ Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .lg-page { flex-direction: column; }
  .lg-brand { padding: 32px 28px; border-right: none; border-bottom: 1px solid var(--lg-divider); }
  .lg-form-wrap { padding: 36px 28px 56px; }
  .lg-headline { font-size: 36px; }
  .lg-h1 { font-size: 36px; }
}
@media (max-width: 560px) {
  .lg-pitch { display: none; }
  .lg-chart { display: none; }
  .lg-headline { font-size: 28px; }
  .lg-brand { padding: 24px 20px; gap: 20px; }
  .lg-form-wrap { padding: 24px 20px 48px; }
  .lg-h1 { font-size: 28px; }
}
