/* Retirement Growth Strategy — design system
   Register: product. Feel: warm & human, built for 65+ eyes.
   Warmth comes from accent + deep espresso + type, never a cream-washed bg. */

:root {
  /* Surfaces — controlled near-white, warmth carried by accent not the bg */
  --bg:            oklch(0.982 0.004 80);
  --surface:       oklch(1 0 0);
  --sunken:        oklch(0.965 0.006 78);
  --deep:          oklch(0.28 0.028 55);   /* warm espresso, for rich moments */
  --deep-2:        oklch(0.24 0.026 52);

  /* Ink — warm near-blacks, high contrast for older eyes */
  --ink:           oklch(0.26 0.014 60);   /* ~13.5:1 on --bg */
  --ink-soft:      oklch(0.44 0.014 62);   /* ~6.3:1, secondary text */
  --ink-onDeep:    oklch(0.95 0.012 82);   /* text on espresso */
  --ink-onDeepSoft:oklch(0.82 0.02 80);

  /* Accent — earthy amber, not shiny fintech gold */
  --gold:          oklch(0.74 0.115 72);
  --gold-strong:   oklch(0.52 0.11 62);    /* AA text/links on light */
  --gold-onDeep:   oklch(0.80 0.115 78);

  /* Lines & semantic state */
  --line:          oklch(0.9 0.008 75);
  --line-strong:   oklch(0.83 0.01 74);
  --focus:         oklch(0.62 0.13 68);
  --danger:        oklch(0.55 0.17 28);
  --success:       oklch(0.58 0.11 150);

  /* Chart series — part of the system so results.html stops hardcoding hex.
     Two contrasts: dull "do nothing" vs amber "the plan"; pre-tax vs Roth.
     Distinguished by hue AND value (never color alone — legends carry text). */
  --chart-nothing: oklch(0.62 0.018 70);   /* muted warm taupe: the dull path */
  --chart-plan:    oklch(0.60 0.132 58);   /* amber: the plan (AA line on white) */
  --chart-pretax:  oklch(0.68 0.118 74);   /* still-taxed pre-tax money */
  --chart-roth:    oklch(0.56 0.092 150);  /* tax-free Roth (warm green) */

  --radius:        12px;
  --radius-sm:     9px;
  --maxw:          720px;

  --ease:          cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out-quart */
  --dur:           200ms;

  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;              /* generous base for 65+ */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography ------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
p { text-wrap: pretty; }
.serif { font-family: var(--font-serif); }

/* Focus — visible, warm, consistent everywhere ---------------------------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 15px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--dur) var(--ease), transform 120ms var(--ease), border-color var(--dur) var(--ease);
}
.btn-primary {
  background: var(--gold);
  color: oklch(0.28 0.05 60);
}
.btn-primary:hover { background: oklch(0.7 0.12 70); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--line-strong); color: var(--ink-soft); cursor: not-allowed; }
.btn-block { width: 100%; }

/* Form controls — one vocabulary, all states --------------------------- */
.label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}
.control {
  width: 100%;
  height: 52px;                 /* large targets */
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.control::placeholder { color: var(--ink-soft); opacity: 0.7; }
.control:hover { border-color: var(--ink-soft); }
.control:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px oklch(0.62 0.13 68 / 0.2);
}
.control:disabled { background: var(--sunken); color: var(--ink-soft); cursor: not-allowed; }

/* Money / percent adornments */
.adorn { position: relative; }
.adorn > .control { padding-left: 30px; }
.adorn > .sym {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gold-strong); font-weight: 700; pointer-events: none;
}
.adorn.pct > .control { padding-left: 14px; padding-right: 34px; }
.adorn.pct > .sym { left: auto; right: 14px; color: var(--ink-soft); font-weight: 600; }

/* Segmented toggle (filing status) */
.segmented {
  display: inline-flex;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}
.segmented button {
  font: inherit; font-weight: 600; font-size: 0.95rem;
  border: none; background: transparent; color: var(--ink-soft);
  padding: 10px 18px; border-radius: 7px; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px oklch(0.28 0.03 55 / 0.12); }
.segmented button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* Field message (helper / error) */
.hint { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.field-msg { font-size: 0.85rem; color: var(--danger); margin: 6px 0 0; min-height: 1em; }

/* Utilities */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.deep { background: var(--deep); color: var(--ink-onDeep); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
