/* RetirePay site. Colours match the app (retirement-planner-mobile/src/theme.ts). */
:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #eceef3;
  --ink: #0e1320;
  --ink-2: #465067;
  --muted: #666f84;
  --line: #dfe2ea;
  --accent: #1f5fa9;
  --accent-ink: #174a85;
  --accent-wash: #e8eefa;
  --good-ink: #006300;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(14, 19, 32, .06), 0 8px 24px rgba(14, 19, 32, .06);
  /* income source colours, same order as the app's chart */
  --cpp: #2a78d6; --oas: #eb6834; --gis: #1baf7a; --pen: #eda100;
  --rrsp: #e87ba4; --nr: #008300; --tfsa: #4a3aa7; --allowance: #76512b;
  --radius: 16px;
  --max: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1118; --surface: #151b25; --surface-2: #1d2531; --ink: #eef1f6; --ink-2: #b6bfce;
    --muted: #8f99ab; --line: #28313f; --accent: #6ea8f0; --accent-ink: #9cc3f5; --accent-wash: #16263d;
    --good-ink: #5fd35f; --on-accent: #0d1118; --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 19px; }
.brand img { width: 32px; height: 32px; }
.top nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.top nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.top nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .top nav .hide-sm { display: none; } }

/* buttons */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 18px 8px 14px;
  border-radius: 12px; background: var(--ink); color: var(--bg); text-decoration: none; line-height: 1.15;
}
.store svg { width: 24px; height: 24px; flex: none; }
.store small { display: block; font-size: 11px; opacity: .8; }
.store strong { display: block; font-size: 17px; }
.store[aria-disabled="true"] { background: var(--surface-2); color: var(--ink-2); cursor: default; }
.store[aria-disabled="true"] small { opacity: 1; color: var(--muted); }
.btn-sm { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent) !important; text-decoration: none; font-weight: 700; font-size: 15px; }
.fine { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* hero */
.hero { padding: 64px 0 56px; }
.hero .wrap { display: grid; gap: 48px; align-items: start; grid-template-columns: 1.15fr .85fr; }
/* line the eyebrow up with the card's label (card padding + border) */
.hero .wrap > div:first-child { padding-top: 23px; }
@media (max-width: 880px) { .hero .wrap > div:first-child { padding-top: 0; } }
@media (max-width: 880px) { .hero { padding: 36px 0 40px; } .hero .wrap { grid-template-columns: 1fr; gap: 36px; } }
.eyebrow { color: var(--accent); font-weight: 800; font-size: 15px; letter-spacing: .02em; margin-bottom: 14px; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 850; }
.hero .lead { color: var(--ink-2); font-size: clamp(18px, 2.2vw, 21px); margin: 20px 0 28px; max-width: 34em; }
.hero .lead b { color: var(--ink); }

/* illustrative paycheque card */
.cheque { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.cheque .label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cheque .total { font-size: 44px; font-weight: 850; letter-spacing: -.03em; margin: 4px 0 2px; }
.cheque .per { color: var(--ink-2); font-size: 15px; margin-bottom: 16px; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rows li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.rows .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.rows .v { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.cheque .note { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
/* income-by-age trend under the example paycheque (same look as the app's chart) */
.trend { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.trend-title { margin: 0 0 22px; font-size: 16px; font-weight: 800; }
.trend-plot { position: relative; display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; height: 120px; }
.trend-plot .col { display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.trend-plot .col span { display: block; min-height: 0; }
.trend-plot .goal { position: absolute; left: 0; right: 0; top: -2px; margin: 0; border-top: 2px dashed var(--ink-2); pointer-events: none; }
.trend-plot .goal span { position: absolute; right: 0; bottom: 3px; font-size: 12px; font-weight: 700; color: var(--ink); }
.trend-ages { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-ages span:first-child { text-align: left; }
.trend-ages span { text-align: center; white-space: nowrap; }
.trend-ages span:last-child { text-align: right; }
.trend-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.trend-legend li { display: flex; align-items: center; gap: 6px; }
.trend-legend .sw { width: 11px; height: 11px; border-radius: 3px; }
.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; }

/* sections */
section { padding: 64px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kicker { color: var(--accent); font-weight: 800; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 820; max-width: 22em; }
.sub { color: var(--ink-2); font-size: 18px; margin-top: 14px; max-width: 38em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 36px; }
@media (max-width: 780px) { .grid2 { grid-template-columns: 1fr; gap: 28px; } section { padding: 48px 0; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
section.alt .card { background: var(--bg); }
.card h3 { font-size: 19px; margin-bottom: 14px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-wash); color: var(--accent-ink); font-weight: 800; font-size: 14px; margin-top: 1px; }
.qs { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.qs li { background: var(--accent-wash); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-weight: 700; }

.maybe { display: grid; gap: 14px; margin-top: 28px; max-width: 40em; }
.maybe p { font-size: 20px; color: var(--ink-2); padding-left: 18px; border-left: 3px solid var(--line); }
.deserve { margin-top: 28px; font-size: clamp(22px, 3vw, 28px); font-weight: 820; }

.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 32px; }
.src { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
section.alt .src { background: var(--bg); }
.src .dot { width: 14px; height: 14px; border-radius: 4px; margin-top: 5px; flex: none; }
.src b { display: block; font-size: 17px; }
.src span { color: var(--ink-2); font-size: 15px; line-height: 1.45; }


.private { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 28px; }
.private .card { padding: 20px; }
.private b { display: block; margin-bottom: 4px; }
.private span { color: var(--ink-2); font-size: 15.5px; }

.cta { background: var(--accent); color: var(--on-accent); border-radius: 24px; padding: 48px 32px; text-align: center; }
.cta h2 { margin: 0 auto; color: inherit; }
.cta .formula { font-size: clamp(17px, 2.4vw, 22px); font-weight: 800; margin: 18px 0 8px; letter-spacing: .01em; }
.cta p { opacity: .92; font-size: 18px; }
.cta .stores { justify-content: center; margin-top: 26px; }
.cta .store { background: var(--on-accent); color: var(--accent-ink); }
.cta .store[aria-disabled="true"] { background: color-mix(in srgb, var(--on-accent) 18%, transparent); color: var(--on-accent); }
.cta .store[aria-disabled="true"] small { color: inherit; opacity: .85; }

.support { text-align: center; }
.support .mail { font-size: 22px; font-weight: 800; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
footer .links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; }
footer .links a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
footer .links a:hover { text-decoration: underline; }
footer .disc { max-width: 60em; }

/* legal pages */
.doc { max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); font-weight: 850; }
.doc .updated { color: var(--muted); margin: 10px 0 28px; }
.doc h2 { font-size: 22px; margin: 34px 0 10px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 22px; margin: 10px 0 0; }
.doc li + li { margin-top: 6px; }
.doc .summary { background: var(--accent-wash); border-left: 4px solid var(--accent); border-radius: 12px; padding: 18px 20px; color: var(--ink); }
.doc .summary p { color: var(--ink); }

/* FAQ assistant (faq.js) — scripted answers, runs entirely in the browser */
.faqbot { position: fixed; right: 20px; bottom: 20px; z-index: 20; }
.faqbot-open { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px 0 16px; border: 0;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 800; font-size: 16px;
  cursor: pointer; box-shadow: 0 6px 20px rgba(14, 19, 32, .22); }
.faqbot-open svg { width: 22px; height: 22px; }
.faqbot.is-open .faqbot-open { display: none; }
.faqbot-panel { width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(14, 19, 32, .22); }
.faqbot-panel[hidden] { display: none; }
.faqbot-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 12px 18px; background: var(--accent); color: var(--on-accent); }
.faqbot-head div { flex: 1; }
.faqbot-head strong { display: block; font-size: 16px; }
.faqbot-head small { display: block; font-size: 12.5px; opacity: .88; margin-top: 2px; }
.faqbot-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
.faqbot-close:hover { background: rgba(255, 255, 255, .15); }
.faqbot-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.faqbot-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.5; }
.faqbot-msg p + p { margin-top: 8px; }
.faqbot-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.faqbot-msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.faqbot-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.faqbot-chip { min-height: 36px; padding: 6px 12px; border: 1px solid var(--accent); border-radius: 999px; background: var(--surface);
  color: var(--accent-ink); font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.faqbot-chip:hover { background: var(--accent-wash); }
.faqbot-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.faqbot-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.faqbot-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.faqbot-form button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 800; cursor: pointer; }
.faqbot-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.faqbot button:focus-visible, .faqbot-chip:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; }
@media (max-width: 480px) {
  .faqbot { right: 12px; bottom: 12px; }
  .faqbot.is-open { left: 8px; right: 8px; bottom: 8px; }
  .faqbot.is-open .faqbot-panel { width: 100%; height: calc(100vh - 16px); }
}

/* quick retirement paycheque estimate (calc.js) */
.try { margin-top: 10px; font-size: 15px; font-weight: 700; }
.try a { text-decoration: none; }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; align-items: start; }
@media (max-width: 780px) { .calc { grid-template-columns: 1fr; } }
@media (min-width: 781px) { .calc-out { position: sticky; top: 88px; } }
.calc-in { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.calc-in label { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
.calc-in label[hidden] { display: none; }
.calc-in small { color: var(--muted); font-weight: 500; font-size: 13px; }
.calc-in select, .calc-in input { min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; font-weight: 500; width: 100%; }
.calc-in select:focus, .calc-in input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.money { display: flex; align-items: center; gap: 6px; }
.money > span { color: var(--muted); }
.calc-out { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.calc-out .label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.calc-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.calc-total span { color: var(--ink-2); font-weight: 700; }
.calc-total strong { font-size: 40px; font-weight: 850; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.calc-step { font-weight: 800; font-size: 17px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.calc-target { border-top: 2px solid var(--line); margin-top: 14px; padding-top: 12px; font-size: 15px; color: var(--ink-2); }
.calc-target b { color: var(--ink); }
.calc-status { margin-top: 6px; font-weight: 800; color: var(--ink-2); }
.calc-status.is-good { color: var(--good-ink); }
.calc-line { color: var(--ink-2); font-size: 15px; margin-top: 8px; }
.calc-line:empty { display: none; }
.calc-out .note { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.calc-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px;
  background: var(--accent-wash); border-radius: var(--radius); padding: 22px 24px; }
.calc-more > div:first-child { flex: 1 1 380px; }
.calc-more h3 { font-size: 21px; margin-bottom: 8px; }
.calc-more p { color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 800; font-size: 16px; }

/* Common questions (generated into index.html from faq.js) */
#questions .sub { margin-bottom: 26px; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; box-shadow: var(--shadow); }
.qa summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; min-height: 52px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--accent); font-size: 24px; font-weight: 700; line-height: 1; flex: none; }
.qa[open] summary::after { content: "–"; }
.qa summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
.qa h3 { font-size: 17px; line-height: 1.35; margin: 0; color: var(--ink); }
.qa p { color: var(--ink-2); font-size: 16px; line-height: 1.6; margin: 0 20px 14px; max-width: 46em; }
.qa p:last-child { margin-bottom: 18px; }
#questions { scroll-margin-top: 72px; }

/* Guides and calculators */
.guide h2 { margin-top: 38px; }
.guide .summary { margin-bottom: 8px; }
.guide .fine { color: var(--muted); font-size: 14px; margin-top: 30px; }
.sources { font-size: 15px; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 16px; margin-top: 12px; }
.tool-field { display: grid; gap: 6px; }
.tool-field > span:first-child { font-weight: 700; color: var(--ink); }
.tool-field small { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.tool-field select, .tool-field input { min-height: 48px; width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 17px; }
.money-in { position: relative; display: block; }
.money-in > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-in input { padding-left: 26px; }
.tool-field select:focus, .tool-field input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.tool-out { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.out-row { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.out-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.out-row.strong { font-size: 19px; }
.out-row.strong b { color: var(--accent); font-size: 22px; }
.out-note { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.table-wrap.narrow { max-width: 360px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th, .table-wrap td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap thead th { background: var(--surface-2); color: var(--ink); font-size: 13.5px; }
.table-wrap tbody th { color: var(--ink); font-weight: 600; }
.table-wrap td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.table-wrap tr:last-child th, .table-wrap tr:last-child td { border-bottom: 0; }
.tool .table-wrap { margin-top: 0; }
.cta-box { margin-top: 36px; background: var(--accent-wash); border-radius: var(--radius); padding: 22px; }
.cta-box p { color: var(--ink); }
.cta-box .btn { margin: 6px 8px 0 0; }
.btn.ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.guide-list { display: grid; gap: 12px; margin-top: 22px; }
.guide-card { display: grid; gap: 4px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-decoration: none; }
.guide-card strong { color: var(--accent); font-size: 18px; }
.guide-card span { color: var(--ink-2); }
.guide-card:hover strong { text-decoration: underline; }
@media (min-width: 760px) { .guide-list.home { grid-template-columns: 1fr 1fr; } }
.qa .qa-more a { font-weight: 700; }
/* Keep the header on one line on narrow phones. */
.brand, .btn-sm { white-space: nowrap; }
.top nav { flex-shrink: 0; }
@media (max-width: 380px) { .brand { font-size: 17px; gap: 8px; } .top .wrap { gap: 10px; } }
