/* Planning Software shell.
 *
 * The portal-ux skill ships its design system as a React + Tailwind kit.
 * The locked stack here is Jinja + vanilla JS, so the tokens below are
 * transcribed from that skill's tailwind-preset.ts and globals.css and
 * exposed as plain custom properties. Same palette, type and radii; no
 * build step. Keep these values in sync with the skill, do not re-pick.
 */

:root {
  --brand-navy: #1c5c9c;
  --brand-green: #08c13d;
  --brand-bright: #2b8aef;
  --brand-light: #e8f1fc;

  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: hsl(214 32% 91%);
  --destructive: #dc2626;

  --radius-lg: 0.625rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.375rem;

  --font-sans: "Poppins", system-ui, -apple-system, sans-serif;
  --container: 1280px;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1, h2, h3 { letter-spacing: -0.02em; margin: 0 0 0.5rem; }
h1 { font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 600; }
a { color: var(--brand-navy); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--brand-navy);
  text-decoration: none;
  font-size: 1.0625rem;
}
.wordmark .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-green);
}

/* Page scaffolding: PageHeader -> Card, as in the portal-ux kit. */
.page { padding-block: 2.5rem 4rem; }
.page-header { margin-bottom: 1.75rem; }
.page-header p { color: var(--muted-foreground); margin: 0; max-width: 60ch; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
.card + .card { margin-top: 1rem; }
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--brand-navy); color: #fff; }
.btn-primary:hover { background: var(--brand-bright); }
.btn-accent { background: var(--brand-green); color: #fff; }
.btn-secondary {
  background: var(--brand-light);
  color: var(--brand-navy);
  border-color: var(--brand-light);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-navy);
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-navy);
  font-size: 0.75rem;
  font-weight: 500;
}

.muted { color: var(--muted-foreground); }

/* Disclosure footer - required on every screen of the planning module. */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-block: 1.5rem 2.5rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.site-footer p { margin: 0 0 0.5rem; max-width: 80ch; }

/* Consumer loop (Ken's lane). The people using it are mostly 60 to 65, so
 * these screens read larger than the shell: 1.25rem text, 56px+ controls,
 * one question per screen. Same tokens as above; no new colours. */
.header-actions { display: flex; gap: 0.5rem; }
.flow { max-width: 40rem; margin-inline: auto; font-size: 1.25rem; }
.flow h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.25rem); line-height: 1.2; text-wrap: balance; }
.flow h2 { font-size: 1.375rem; }
.flow .page-header p { font-size: 1.125rem; }
.flow-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3rem; margin-bottom: 1rem; }
.back-link { font-weight: 500; text-decoration: none; padding: 0.5rem 0; }
.progress { flex: 1; max-width: 16rem; }
.progress-text { margin: 0 0 0.375rem; font-size: 1rem; color: var(--muted-foreground); text-align: right; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--brand-navy); border-radius: 999px; }
.flow-form { display: grid; gap: 1.25rem; }
.flow-actions { margin-top: 0.5rem; }
.btn-large { min-height: 3.5rem; padding-inline: 1.75rem; font-size: 1.125rem; width: 100%; }
.btn-accent:hover { filter: brightness(0.95); }
.btn-secondary:hover { border-color: var(--brand-navy); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.choice {
  display: flex; align-items: center; gap: 1rem; min-height: 3.75rem;
  padding: 0.75rem 1.125rem; border: 2px solid var(--border); border-radius: var(--radius-lg);
  background: #fff; cursor: pointer; font-weight: 500; line-height: 1.3;
}
.choice input { width: 1.5rem; height: 1.5rem; flex: none; accent-color: var(--brand-navy); margin: 0; }
.choice:has(input:checked) { border-color: var(--brand-navy); background: var(--brand-light); }
.choice:has(input:focus-visible) { outline: 3px solid var(--brand-navy); outline-offset: 2px; }
.choice:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.choice .rank {
  width: 2rem; height: 2rem; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-navy); color: #fff; font-weight: 600; font-size: 1rem;
}
.choice .rank:empty { display: none; }

.field { display: grid; gap: 0.5rem; }
.field label { font-weight: 500; }
.input {
  width: 100%; min-height: 3.5rem; padding: 0.75rem 1rem; font: inherit; font-size: 1.25rem;
  border: 2px solid var(--border); border-radius: var(--radius-md); background: #fff; color: var(--foreground);
}
textarea.input { min-height: 7rem; line-height: 1.45; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand-navy); box-shadow: 0 0 0 3px var(--brand-light); }
.input[aria-invalid="true"] { border-color: var(--destructive); }
.money { position: relative; }
.money > span { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-weight: 600; color: var(--muted-foreground); }
.money .input { padding-left: 2.25rem; font-variant-numeric: tabular-nums; }
.money em { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted-foreground); font-size: 1rem; }
.form-error { margin: 0; color: var(--destructive); font-weight: 500; }

.promise { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 1rem; }
.promise li { padding-left: 1.75rem; position: relative; }
.promise li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--brand-green); }

.sketch { display: grid; gap: 0.25rem; }
.sketch p { margin: 0; }
.sketch-line { font-size: 1.25rem; font-weight: 500; }
.sketch-figure { font-size: clamp(2.75rem, 2rem + 4vw, 3.5rem); font-weight: 600; line-height: 1.1; color: var(--brand-navy); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sketch-figure.is-short, .sketch-inline.is-short { color: var(--destructive); }
.sketch-inline { color: var(--brand-navy); }
.sketch-later { margin-top: 0.75rem !important; color: var(--muted-foreground); }
.whatif { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 1rem 0; }
.whatif p { margin: 0; }

.rows { margin: 0; border-top: 1px solid var(--border); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.875rem 0; border-bottom: 1px solid var(--border); }
.row dt { font-weight: 500; }
.row dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.row p { margin: 0.125rem 0 0; }
.row-total dt, .row-total dd { font-weight: 600; }
.plan-part { margin-top: 2rem; }
.goal-list { margin: 0; padding-left: 1.5rem; }
.advisor-cta { margin-top: 2rem; background: var(--brand-light); border-color: var(--brand-light); }

@media (max-width: 40rem) {
  .row { align-items: flex-start; }
  .sketch .row, .card .row { flex-direction: column; gap: 0.25rem; }
  .row dd { text-align: left; }
}

/* Advisor-share consent, beside the booking CTA. */
.share-consent {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.share-consent label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-weight: 500;
  cursor: pointer;
}
.share-consent input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex: none;
}
.share-consent p { margin: 0.5rem 0 0 1.775rem; font-size: 0.9375rem; }

/* Savings-duration questions and result. */
.input-short { max-width: 9rem; font-size: 1.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.choices.chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.chips .choice { justify-content: center; gap: 0.625rem; font-variant-numeric: tabular-nums; }
.choices.chips .chip-wide { grid-column: 1 / -1; }
.duration { margin-top: 1rem; display: grid; gap: 0.5rem; }
.duration p, .duration h3 { margin: 0; }
.duration h3 { font-size: 1.0625rem; margin-top: 0.75rem; }
.duration-range { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem); font-weight: 600; line-height: 1.15; color: var(--brand-navy); }
.assumptions { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.5rem; font-size: 1.0625rem; }

/* Public landing page (Ken's lane). Same tokens; reads larger because the
 * people arriving from ads are mostly 60 to 65. */
.landing { font-size: 1.125rem; display: grid; gap: 4.5rem; }
.landing h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem); margin-bottom: 1rem; }
.landing h3 { font-size: 1.1875rem; margin: 0 0 0.25rem; }
.landing p { margin: 0; }

.hero { display: grid; gap: 3rem; align-items: center; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); padding-top: 1rem; }
.hero h1 { font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.5rem); line-height: 1.08; letter-spacing: -0.03em; margin: 1rem 0 1.25rem; text-wrap: balance; }
.hero-lead { font-size: 1.25rem; color: var(--muted-foreground); max-width: 34rem; text-wrap: pretty; }
.hero-actions { margin-top: 2rem; display: grid; gap: 0.875rem; justify-items: start; }
.hero-actions .btn-large { width: auto; padding-inline: 2.25rem; }
.hero-signin { font-size: 1rem; color: var(--muted-foreground); }
.hero-facts { list-style: none; padding: 0; margin: 1.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 1rem; font-weight: 500; color: var(--foreground); }
.hero-facts li { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero-facts li::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--brand-green); }

.hero-sample { margin: 0; display: grid; gap: 0.75rem; }
.sample-sheet {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.75rem; display: grid; gap: 0.25rem; transform: rotate(-1deg);
  box-shadow: 0 2px 4px rgb(15 23 42 / 0.04), 0 24px 48px -24px rgb(28 92 156 / 0.35);
}
.sample-sheet hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0 0.75rem; width: 100%; }
.sample-line { font-weight: 500; }
.sample-figure { font-size: clamp(2.5rem, 2rem + 2vw, 3.25rem); font-weight: 600; line-height: 1.1; color: var(--brand-navy); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sample-label { font-size: 0.9375rem; font-weight: 600; color: var(--muted-foreground); }
.sample-range { font-size: 1.375rem; font-weight: 600; color: var(--brand-navy); }
.sample-note { font-size: 0.875rem; color: var(--muted-foreground); }
.hero-sample figcaption { font-size: 0.9375rem; color: var(--muted-foreground); text-align: center; }

.landing-section { max-width: 52rem; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1.75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps li { counter-increment: step; display: grid; gap: 0.375rem; align-content: start; }
.steps li::before {
  content: counter(step); width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-light); color: var(--brand-navy); font-weight: 600; margin-bottom: 0.5rem;
}
.steps p { color: var(--muted-foreground); }

.privacy-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.privacy-list li { padding-left: 1.75rem; position: relative; color: var(--muted-foreground); }
.privacy-list li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--brand-green); }
.privacy-list strong { color: var(--foreground); }

.advisor-note { border-top: 1px solid var(--border); padding-top: 2.5rem; }
.advisor-note p + p { margin-top: 1.25rem; }
.advisor-note > p:first-of-type { color: var(--muted-foreground); max-width: 40rem; }

.landing-final { background: var(--brand-light); border-radius: var(--radius-lg); padding: 3rem 2rem; text-align: center; display: grid; gap: 1rem; justify-items: center; }
.landing-final h2 { margin: 0; }
.landing-final p { color: var(--muted-foreground); }
.landing-final .btn-large { width: auto; padding-inline: 2.25rem; margin-top: 0.5rem; }

@media (max-width: 52rem) {
  .landing { gap: 3.5rem; }
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .sample-sheet { transform: none; }
  .steps, .privacy-list { grid-template-columns: 1fr; }
  .hero-actions, .hero-actions .btn-large, .landing-final .btn-large { width: 100%; justify-items: stretch; }
}

/* Phone / code sign-in. Large targets and type: the audience is 60+. */
.auth-card { max-width: 28rem; }
.auth-card label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.375rem;
}
.auth-card input[type="tel"],
.auth-card input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.auth-card input:focus-visible {
  outline: none;
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.auth-card .code-input {
  letter-spacing: 0.4em;
  font-size: 1.75rem;
  text-align: center;
}
.auth-card .btn { width: 100%; margin-top: 1rem; }
.auth-card .field-note { margin: 0.4rem 0 0; font-size: 0.875rem; color: var(--muted-foreground); }
.auth-card .auth-alt { margin-top: 1rem; font-size: 0.875rem; }
.form-error {
  margin: 0 0 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: var(--destructive);
}

/* Money lists and the gap (Hans, 29 Oct). */
.lines { display: grid; gap: 1rem; }
.line { display: grid; gap: 0.375rem; }
.line > label { font-weight: 500; }
.line-amount { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.line-year { margin: 0; font-size: 1rem; min-width: 8.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.line-custom { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0.75rem; }
.add-line { justify-self: start; }
.line-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; padding: 1rem 0 0; border-top: 2px solid var(--foreground); font-weight: 600; }
.line-total strong { font-size: 1.25rem; color: var(--brand-navy); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.gap-card { display: grid; gap: 1rem; }
.gap-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gap-head h2 { margin: 0; }
.period-toggle { display: inline-flex; border: 2px solid var(--border); border-radius: var(--radius-md); padding: 2px; }
.period-btn { border: 0; background: none; font: inherit; font-size: 1rem; font-weight: 500; padding: 0.5rem 0.875rem; min-height: 2.75rem; border-radius: var(--radius-sm); cursor: pointer; color: var(--muted-foreground); }
.period-btn[aria-pressed="true"] { background: var(--brand-navy); color: #fff; }
.period-btn:focus-visible { outline: 3px solid var(--brand-navy); outline-offset: 2px; }
.gap-table { margin: 0; display: grid; }
.gap-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.gap-row dt { font-weight: 500; display: grid; gap: 0.125rem; }
.gap-row dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-weight: 600; }
.gap-row small { font-weight: 400; color: var(--muted-foreground); }
.gap-note { font-size: 0.9375rem; font-weight: 400; color: var(--muted-foreground); }
.gap-total { font-size: 1.25rem; border-bottom: 2px solid var(--foreground); }
.gap-subhead { padding-bottom: 0.25rem; border-bottom: 0; color: var(--muted-foreground); font-size: 1rem; text-transform: none; }
.gap-income { padding-left: 1.5rem; }
.gap-income.is-faded { opacity: 0.55; }
.gap-result { font-size: 1.375rem; border-bottom: 0; padding-top: 1rem; }
.gap-result.is-gap dt, .gap-result.is-gap dd { color: var(--destructive); }
.gap-result.is-covered dd { color: var(--brand-navy); }
.gap-explain { margin: 0; font-weight: 500; }
.plan-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 1.5rem 0 0; }
.review-lines { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.25rem; font-size: 1rem; color: var(--muted-foreground); }
.review-lines li { display: flex; justify-content: space-between; gap: 1rem; }

@media (max-width: 40rem) {
  .line-amount { grid-template-columns: 1fr; gap: 0.25rem; }
  .line-year { text-align: left; }
  .line-custom { grid-template-columns: 1fr; }
  .gap-income { padding-left: 0.75rem; }
}
