196 lines
12 KiB
CSS
196 lines
12 KiB
CSS
/* Retire Planner — light, mobile-first, system fonts, no frameworks */
|
|
:root{
|
|
--ink:#16233b; --ink2:#4c5b74; --line:#e3e8f0; --bg:#f7f9fc; --card:#ffffff;
|
|
--blue:#2563eb; --red:#dc2626; --amber:#d97706; --green:#059669; --violet:#7c3aed;
|
|
--r:14px;
|
|
--muted:#4c5b74; --chip:#eef2f8;
|
|
--sheet-h:218px; /* round 2 Fix 1: live bottom-sheet height; app.js keeps it current */
|
|
}
|
|
*{box-sizing:border-box}
|
|
html{scroll-behavior:smooth}
|
|
/* Round 2 Fix 3: in-page anchors must land below the sticky header (global; header is sticky on desktop too) */
|
|
[id]{scroll-margin-top:70px}
|
|
body{margin:0;font:16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink);background:var(--bg)}
|
|
main{max-width:1060px;margin:0 auto;padding:12px}
|
|
h1{font-size:clamp(26px,6vw,40px);line-height:1.15;margin:.4em 0 .3em}
|
|
h2{font-size:clamp(20px,4.5vw,26px);margin:1.2em 0 .3em}
|
|
h3{font-size:18px;margin:1.4em 0 .1em}
|
|
p{color:var(--ink2)}
|
|
b{color:var(--ink)}
|
|
|
|
/* header */
|
|
.hdr{position:sticky;top:0;z-index:30;background:#ffffffd9;backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
|
|
.hdr-in{max-width:1060px;margin:0 auto;display:flex;align-items:center;gap:10px;padding:10px 12px;flex-wrap:wrap}
|
|
.logo{font-size:17px}
|
|
.pill{font-size:12px;background:#e8f5ee;color:#0a5c36;border:1px solid #bfe6d0;border-radius:99px;padding:3px 10px;color:#0a5c36}
|
|
/* language toggle: compact EN|FR pill group; 44px touch targets (mobile pass rules) */
|
|
.lang-toggle{display:inline-flex;border:1px solid var(--line);border-radius:99px;overflow:hidden;flex:none;background:var(--card)}
|
|
.lang-btn{padding:4px 10px;border:0;background:transparent;font-size:13px;font-weight:700;color:var(--ink2);cursor:pointer;min-height:44px;line-height:1.2}
|
|
.lang-btn[aria-pressed="true"]{background:var(--blue);color:#fff}
|
|
.logo{font-size:17px;min-width:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
.ghost{background:none;border:1px solid var(--line);border-radius:10px;padding:7px 12px;font-size:14px;color:var(--ink2);cursor:pointer;min-height:44px}
|
|
button,input{touch-action:manipulation}
|
|
.ghost:hover{border-color:var(--blue);color:var(--blue)}
|
|
|
|
/* screens */
|
|
.scr{padding:8px 4px 80px}
|
|
.swipe{display:none} /* round 2 Fix 2: hint hidden on desktop; shown ≤860px (rule in the mobile block below — keep it after this line) */
|
|
.lede{font-size:18px}
|
|
.ticks{list-style:none;padding:0;margin:14px 0}
|
|
.ticks li{padding:7px 0 7px 30px;position:relative;color:var(--ink2)}
|
|
.ticks li::before{content:"✅";position:absolute;left:0;font-size:14px}
|
|
.privacy{font-size:14px;color:#0a5c36;background:#e8f5ee;border:1px solid #bfe6d0;border-radius:10px;padding:9px 12px}
|
|
.fine{font-size:13px}
|
|
.cta{display:block;width:100%;max-width:420px;margin:18px 0 0;background:var(--blue);color:#fff;border:0;border-radius:12px;padding:15px 20px;font-size:17px;font-weight:600;cursor:pointer}
|
|
.cta:hover{background:#1d4fd7}
|
|
.cta:disabled{background:#b6c4dd;cursor:default}
|
|
|
|
/* quiz */
|
|
.quiz-wrap{display:grid;grid-template-columns:1fr 320px;gap:20px;align-items:start}
|
|
#scrim{display:none}
|
|
@media(max-width:860px){
|
|
.quiz-wrap{grid-template-columns:1fr}
|
|
/* Fix 1: single-row compact header (mobile only; desktop untouched) */
|
|
.hdr{padding-top:env(safe-area-inset-top)}
|
|
.hdr-in{flex-wrap:nowrap;padding:5px 10px;gap:8px} /* 5px (not 6px) so .ghost's 44px min-height keeps the header ≤56px */
|
|
.logo{font-size:15px}
|
|
.hdr .ghost{padding:6px 9px;font-size:13px}
|
|
.hdr #btn-print{display:none}
|
|
/* Fix 2: charts keep desktop scale; scroll sideways on phones */
|
|
.chartbox{overflow-x:auto;overflow-y:hidden}
|
|
.chartbox svg{min-width:560px}
|
|
/* Round 2 Fix 2: "swipe →" lives in the chart card header (can never overlap SVG ticks);
|
|
sticky left:0 keeps it pinned while the card scrolls horizontally */
|
|
.chart-h{position:sticky;left:0}
|
|
.swipe{display:inline-block;font-size:11.5px;color:var(--muted);background:var(--chip);border-radius:99px;padding:3px 9px;white-space:nowrap;flex:none}
|
|
/* Fix 3: sheet height = its content; chips always visible; no transform peek */
|
|
.panel{position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));z-index:40;max-height:44vh;overflow:auto;box-shadow:0 -6px 24px #16233b22}
|
|
.panel .insight{display:none}
|
|
.panel.open .insight{display:block}
|
|
.panel-h{cursor:pointer;position:sticky;top:0;background:var(--card)}
|
|
.panel-h::after{content:" ▲";font-size:11px;color:var(--ink2)}
|
|
.panel.open .panel-h::after{content:" ▼"}
|
|
#scrim{position:fixed;inset:0;background:#16233b33;z-index:35}
|
|
#scrim.on{display:block}
|
|
/* Round 2 Fix 1: clearance = live sheet height (app.js sets --sheet-h) + gap + safe area */
|
|
.scr{padding-bottom:calc(var(--sheet-h) + 14px + env(safe-area-inset-bottom))}
|
|
/* Round 2 Fix 1: Back/Next rows stick above the sheet on tall steps; solid bg, below scrim(35)/sheet(40).
|
|
#btn-next (the primary CTA, last element of the flow) carries the pin at sheet+12px so it is on
|
|
screen at every scroll position of every step; .step-nav is pinned per spec and stays in flow
|
|
above it. margin-bottom:-6px nets out the base margin so the spec's 6px padding box does not
|
|
shift short steps at all (income step stays pixel-identical to round 1: CTA top 485).
|
|
At max scroll the doc's own padding + the CTA's 18px margin + 50px height keep the
|
|
last option's bottom ≈507 — clear of the CTA top (≈544) and the sheet (≥616). */
|
|
.step-nav{position:sticky;bottom:calc(var(--sheet-h) + 14px + env(safe-area-inset-bottom));background:var(--bg);z-index:20;padding:6px 0}
|
|
.quiz-main .step-nav{margin-bottom:-6px} /* specificity: base `.step-nav{margin-bottom:6px}` is later in file; net the padding box so round-1 flow is pixel-identical */
|
|
#btn-next{position:sticky;bottom:calc(var(--sheet-h) + 12px + env(safe-area-inset-bottom));z-index:21}
|
|
}
|
|
@media(max-width:700px){
|
|
.hdr .pill{display:none} /* privacy pill is repeated on the intro screen and the footer */
|
|
}
|
|
.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:14px}
|
|
.panel-h{font-weight:700;font-size:14px;margin-bottom:8px}
|
|
.chips{display:grid;grid-template-columns:1fr 1fr;gap:8px}
|
|
.chip{background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:9px 10px}
|
|
.chip .k{font-size:11px;color:var(--ink2);text-transform:uppercase;letter-spacing:.04em}
|
|
.chip .v{font-size:19px;font-weight:700}
|
|
.chip .v.bad{color:var(--red)} .chip .v.good{color:var(--green)}
|
|
.insight{margin-top:10px;font-size:13.5px;color:var(--ink2);border-left:3px solid var(--amber);padding:2px 0 2px 10px;min-height:20px}
|
|
.prog{height:6px;background:var(--line);border-radius:99px;overflow:hidden;margin:6px 0 10px}
|
|
#prog-bar{height:100%;width:0;background:var(--blue);transition:width .3s}
|
|
.step-nav{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
|
|
.step-count{font-size:13px;color:var(--ink2)}
|
|
#step-body{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:18px;min-height:320px}
|
|
#step-body h2{margin-top:.1em}
|
|
.hint{font-size:13.5px;color:var(--ink2)}
|
|
.fld{margin:14px 0}
|
|
.fld label{display:block;font-weight:600;font-size:15px;margin-bottom:5px}
|
|
.fld .unit{font-size:13px;color:var(--ink2)}
|
|
input[type=number]{width:100%;font-size:22px;padding:11px 12px;border:2px solid var(--line);border-radius:10px;color:var(--ink);background:#fff}
|
|
input[type=number]:focus{outline:0;border-color:var(--blue)}
|
|
.opts{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;margin-top:6px}
|
|
.opt{border:2px solid var(--line);background:#fff;border-radius:10px;padding:11px 8px;text-align:center;font-size:15px;cursor:pointer}
|
|
.opt.sel{border-color:var(--blue);background:#eef4ff;font-weight:700}
|
|
.opt small{display:block;font-size:12px;color:var(--ink2);font-weight:400}
|
|
.err{color:var(--red);font-size:13px;min-height:18px}
|
|
.range-row{display:flex;align-items:baseline;gap:10px}
|
|
input[type=range]{width:100%;accent-color:var(--blue)}
|
|
.range-val{font-size:21px;font-weight:700;min-width:120px}
|
|
.chips-pick{display:flex;flex-wrap:wrap;gap:8px}
|
|
|
|
/* results */
|
|
.verdict{font-size:18px}
|
|
.verdict.bad b{color:var(--red)} .verdict.good b{color:var(--green)}
|
|
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:14px 0 6px}
|
|
.gcard{background:var(--card);border:1px solid var(--line);border-left:4px solid var(--blue);border-radius:var(--r);padding:14px}
|
|
.gcard h4{margin:0 0 4px;font-size:14px;color:var(--ink2)}
|
|
.gcard .big{font-size:22px;font-weight:800}
|
|
.gcard p{font-size:13.5px;margin:6px 0 0}
|
|
.gcard.warn{border-left-color:var(--amber)} .gcard.save{border-left-color:var(--green)}
|
|
.cap{font-size:13.5px;margin:.2em 0 .6em}
|
|
.chartbox{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:10px;overflow:hidden}
|
|
.chartbox svg{display:block;width:100%;height:auto}
|
|
/* Round 2 Fix 2: chart card header = title+caption block with the swipe hint on its right.
|
|
.swipe is display:none on desktop (base rule above), so the flex row renders exactly like the old stacked block. */
|
|
.chart-h{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
|
|
.chart-h>div{min-width:0}
|
|
.legend{display:flex;flex-wrap:wrap;gap:12px;font-size:13px;color:var(--ink2);padding:4px 6px 0}
|
|
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}
|
|
|
|
/* vision */
|
|
.vision{margin:6px 0 2px;border-radius:var(--r);overflow:hidden;border:1px solid var(--line);background:var(--card)}
|
|
.vision img{display:block;width:100%;height:250px;object-fit:cover}
|
|
.vision .vcap{padding:12px 14px;font-size:15px}
|
|
.vision .vcap b{font-size:16px}
|
|
.vision.grad{color:#fff}
|
|
.vision.grad img{display:none}
|
|
.vision.grad .vcap{color:#fff}
|
|
.vision.grad .vcap b,.vision.grad .vcap{color:#fff}
|
|
|
|
/* what-if, table, disclaimer */
|
|
.whatif,.yearly{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;margin:16px 0}
|
|
.wi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;margin-top:10px}
|
|
.wi-grid label{font-size:14px;font-weight:600}
|
|
.wi-grid output{color:var(--blue);font-weight:800;float:right}
|
|
.tbl-wrap{overflow:auto;max-height:340px;border:1px solid var(--line);border-radius:8px;margin-top:8px}
|
|
table{border-collapse:collapse;font-size:12.5px;width:100%}
|
|
th,td{padding:5px 8px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}
|
|
th{position:sticky;top:0;background:var(--bg);text-align:right}
|
|
td:first-child,th:first-child{position:sticky;left:0;background:var(--bg)}
|
|
tr.dep td{color:var(--red)}
|
|
.disclaimer{font-size:13px;border-top:1px dashed var(--line);margin-top:26px;padding-top:12px}
|
|
.stamp{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px}
|
|
.btn-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
|
|
|
|
/* Fix 5: year-by-year table on small screens (placed after the base table rules so font-size wins) */
|
|
@media(max-width:560px){
|
|
th:nth-child(4),td:nth-child(4),th:nth-child(9),td:nth-child(9){display:none} /* Non-reg, GIS */
|
|
table{font-size:13px}
|
|
/* right-edge fade so the horizontal scroll is discoverable (::before = first child, pinned to the visible top-right) */
|
|
.tbl-wrap{position:relative}
|
|
.tbl-wrap::before{content:"";float:right;width:26px;height:340px;background:linear-gradient(90deg,transparent,var(--card));pointer-events:none}
|
|
}
|
|
|
|
/* Round 4: app-shell the quiz screen — #step-body is the only scroll container;
|
|
#btn-next + #panel form the fixed bottom cluster. Never overlaps content.
|
|
Appended at end of file (after ALL base rules) so the equal-specificity id rules
|
|
(#step-body min-height/padding, #btn-next, #panel) lose the source-order tie here. */
|
|
@media(max-width:700px){
|
|
#scr-quiz.scr{display:flex;flex-direction:column;height:calc(100vh - 69px);height:calc(100dvh - 69px);overflow:hidden;padding:0}
|
|
#scr-quiz.scr[hidden]{display:none} /* id+class display beats the UA [hidden] rule — restore it */
|
|
.quiz-wrap{display:flex;flex-direction:column;flex:1;min-height:0}
|
|
.quiz-main{display:flex;flex-direction:column;flex:1;min-height:0}
|
|
#step-body{flex:1;overflow-y:auto;min-height:0;padding:10px 12px 16px}
|
|
#btn-next{position:static;margin:10px 12px 12px}
|
|
#panel{position:static;margin:0 8px calc(8px + env(safe-area-inset-bottom,0px))}
|
|
/* the quiz section is exactly viewport-tall; main's 12px bottom padding would add
|
|
document scroll. Drop it ONLY while the quiz screen is shown — intro/results untouched. */
|
|
main:has(#scr-quiz:not([hidden])){padding-bottom:0}
|
|
}
|
|
|
|
@media print{
|
|
.hdr,.whatif,.btn-row,#scr-quiz{display:none!important}
|
|
body{background:#fff}
|
|
.chartbox,.gcard,.vision{break-inside:avoid}
|
|
}
|