/* Mini design system. Plain consumer-advice look: black type on white, rules
   instead of boxes, one boxed offer (€19), a BER-style rating scale as the one
   loud element. Components use only the tokens below.

   1. Fonts         Schibsted Grotesk, self-hosted in /fonts (OFL, see fonts/OFL.txt)
   2. Tokens        colour, type scale, 4px spacing, radii; no shadows
   3. Page          body, main, headings, links
   4. Section       .card: a heavy top rule, no box
   5. Form          fields, .row, fieldset, numbered steps (h2 .step), option rows (.seg), .error
   6. Buttons       button, .btn, .secondary, .full
   7. Verdict       .verdict (+ fair / high / very-high)
   8. Scale         .scale, .scale-row (+ .is-yours)
   9. Stats         .stats: one oversized number, then two
   10. Breakdown    dl.nums, .note
   11. Offer        .paid (the only box), .price-row, .teaser (email preview)
   12. Checklist    .check li.ok / .ask / .flag: square tick boxes
   13. Report       textarea, method list, footer
   14. Layout       desktop two columns (960px+), phones (480px and under), print
   15. Articles   .article: guide pages, tables, the check call-to-action
*/

/* 1. Fonts */
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/schibsted-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/schibsted-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/schibsted-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/schibsted-grotesk-800.woff2") format("woff2"); }

/* 2. Tokens. No tabular-nums: this font's tabular commas are very wide ("€7 , 000"). */
:root {
  --bg: #ffffff; --surface: #f4f3f0; --ink: #000000; --muted: #57534e; --line: #d8d4ce; --field-line: #8c867e;
  --accent: #1d3fd1; --action: #000000; --action-ink: #ffffff;
  --fair: #0a7a3e; --high: #b45309; --very-high: #c8102e;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --t-small: 400 0.875rem/1.45 var(--font);
  --t-body: 400 1.0625rem/1.55 var(--font);
  --t-head: 700 1.375rem/1.25 var(--font);
  --t-display: 800 2.5rem/1.04 var(--font);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px; --s-12: 48px;
  --r-control: 4px; --r-box: 8px;
  --page: 680px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --surface: #222120; --ink: #f5f4f1; --muted: #aaa49c; --line: #3a3835; --field-line: #79736b;
    --accent: #9cb0ff; --action: #f5f4f1; --action-ink: #000000;
    --fair: #4cc38a; --high: #f2a254; --very-high: #ff7080;
  }
}

/* 3. Page */
* { box-sizing: border-box; }
body { margin: 0; padding: 0 var(--s-4); background: var(--bg); color: var(--ink); font: var(--t-body); }
main { max-width: var(--page); margin: 0 auto; padding: var(--s-8) 0 var(--s-12); }
h1 { font: var(--t-display); letter-spacing: -0.025em; margin: 0 0 var(--s-4); text-wrap: balance; }
h2 { font: var(--t-head); letter-spacing: -0.01em; margin: 0 0 var(--s-4); text-wrap: balance; }
h3 { font: 700 1.0625rem/1.3 var(--font); margin: var(--s-8) 0 var(--s-2); }
p.lede { font-weight: 500; margin: 0 0 var(--s-8); max-width: 60ch; }
a { color: var(--accent); text-underline-offset: 0.15em; }
[hidden] { display: none !important; }

/* 4. Section: a heavy rule, no box */
.card { border-top: 3px solid var(--ink); padding-top: var(--s-6); margin: 0 0 var(--s-12); }

/* 5. Form */
label { display: block; font-weight: 700; margin: var(--s-6) 0 var(--s-2); }
.hint { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: var(--t-body); color: var(--ink); background: var(--bg); border: 1px solid var(--field-line); border-radius: var(--r-control); }
input, select { height: 48px; padding: 0 var(--s-3); }
input[aria-invalid="true"] { border: 2px solid var(--very-high); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); align-items: end; }
fieldset { border: 0; padding: 0; margin: var(--s-6) 0 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin: 0 0 var(--s-2); }
form h2 { display: flex; align-items: center; gap: var(--s-3); }
form h2:not(:first-child) { margin-top: var(--s-12); }
h2 .step { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; background: var(--ink); color: var(--bg); font: 800 1rem/1 var(--font); border-radius: var(--r-control); }
.seg { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); column-gap: var(--s-6); border-top: 1px solid var(--line); }
.seg label { display: flex; align-items: center; gap: var(--s-3); margin: 0; min-height: 48px; padding: var(--s-2) 0; font-weight: 400; border-bottom: 1px solid var(--line); cursor: pointer; }
.seg label:has(input:checked) { font-weight: 700; }
.seg input { width: 20px; height: 20px; margin: 0; padding: 0; flex: none; accent-color: var(--ink); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
details { margin-top: var(--s-6); }
summary { cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
.error { color: var(--very-high); font-weight: 700; border-left: 4px solid var(--very-high); padding: var(--s-1) 0 var(--s-1) var(--s-3); margin: var(--s-6) 0 0; }

/* 6. Buttons */
button, .btn { display: inline-block; font: 700 1.0625rem/1.2 var(--font); background: var(--action); color: var(--action-ink); border: 2px solid var(--action); border-radius: var(--r-control); padding: 14px 20px; cursor: pointer; text-align: center; text-decoration: none; }
button:hover, .btn:hover { background: var(--accent); border-color: var(--accent); color: var(--action-ink); }
button.secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.full { width: 100%; margin-top: var(--s-6); }

/* 7. Verdict: the headline takes its band's colour */
.verdict { margin: 0 0 var(--s-4); }
.verdict.fair, .scale-row.fair { --band: var(--fair); }
.verdict.high, .scale-row.high { --band: var(--high); }
.verdict.very-high, .scale-row.very-high { --band: var(--very-high); }
.verdict strong { display: block; font: var(--t-display); font-size: 2.25rem; letter-spacing: -0.02em; color: var(--band); }
.verdict p { margin: var(--s-2) 0 0; font-weight: 500; }
#results > .card:first-of-type { border-top: 0; padding-top: 0; }

/* 8. Scale: one arrow per verdict band, longer as the price rises (after the BER certificate).
   The quote's band is solid and labelled. Decorative: the verdict text is the accessible answer. */
.scale { display: grid; gap: var(--s-1); margin: 0 0 var(--s-8); }
.scale-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center; gap: var(--s-3); }
.scale .bar { display: block; height: 34px; padding: 0 var(--s-6) 0 var(--s-3); font: 700 0.875rem/34px var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; background: color-mix(in srgb, var(--band) 22%, var(--bg)); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); }
.scale-row.fair .bar { width: 64%; } .scale-row.high .bar { width: 82%; } .scale-row.very-high .bar { width: 100%; }
.scale .tag { font: var(--t-small); color: var(--muted); }
.scale-row.is-yours .bar { background: var(--band); color: var(--bg); }
.scale-row.is-yours .tag { font-weight: 700; color: var(--ink); }
.scale-row.is-yours .tag::before { content: "◀ "; }

/* 9. Stats: one oversized number, then two */
.stats { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 var(--s-6); border-block: 1px solid var(--line); }
.stats div { padding: var(--s-4) var(--s-4) var(--s-4) 0; }
.stats div:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
.stats div:nth-child(3) { border-left: 1px solid var(--line); padding-left: var(--s-4); }
.stats span { display: block; font: var(--t-small); color: var(--muted); }
.stats strong { display: block; font: 800 1.625rem/1.15 var(--font); letter-spacing: -0.015em; margin-top: var(--s-1); text-wrap: balance; }
.stats div:first-child strong { font-size: 4rem; line-height: 1; letter-spacing: -0.035em; }

/* 10. Breakdown */
dl.nums { display: grid; grid-template-columns: 1fr auto; margin: 0; }
dl.nums dt, dl.nums dd { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
dl.nums dt { color: var(--muted); }
dl.nums dd { margin: 0; text-align: right; font-weight: 700; }
.note { font: var(--t-small); color: var(--muted); }

/* 11. The €19 offer: the one boxed element */
.paid { border: 2px solid var(--ink); border-radius: var(--r-box); padding: var(--s-6); }
.paid ul { padding-left: 1.2em; margin: var(--s-2) 0 0; }
.paid li { margin: var(--s-1) 0; }
.price-row { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; margin: 0; }
.price { font: var(--t-display); letter-spacing: -0.02em; }
.price-row + .btn { margin-top: var(--s-4); }
.teaser { white-space: pre-line; font: var(--t-small); background: var(--surface); padding: var(--s-4); max-height: 12em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }

/* 12. Checklist: square tick boxes; solid for a problem, outline for done or something to ask */
.check { list-style: none; padding: 0; margin: var(--s-2) 0 0; }
.paid .check { padding-left: 0; }
.check li { position: relative; padding: var(--s-3) 0 var(--s-3) 40px; border-top: 1px solid var(--line); margin: 0; }
.check li::before { position: absolute; left: 0; top: var(--s-3); width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: var(--r-control); font: 800 0.875rem/1 var(--font); }
.check li.ok::before { content: "✓"; color: var(--fair); }
.check li.ask::before { content: "?"; color: var(--high); }
.check li.flag::before { content: "!"; background: var(--very-high); border-color: var(--very-high); color: var(--bg); }

/* 13. Report, method, footer */
textarea { min-height: 240px; padding: var(--s-3); line-height: 1.5; }
#copyEmail { margin-top: var(--s-3); }
#method p { max-width: 65ch; }
#method ul { padding-left: 1.2em; font: var(--t-small); }
footer { font: var(--t-small); color: var(--muted); border-top: 1px solid var(--line); padding-top: var(--s-4); }
footer a { color: inherit; }
footer nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin: 0 0 var(--s-4); }
footer nav a { font-weight: 700; }

/* 14. Layout. Desktop: the form left, the answer right. Rows are explicit so an empty
   #paidNote (row 3) or #results (row 4) collapses to nothing; the last row absorbs the
   form's extra height, so the right column never opens gaps. Before the first check
   the right column shows "How this works" beside the form. */
@media (min-width: 960px) {
  main:not(.article) { --page: 1120px; display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); grid-template-rows: repeat(6, auto) 1fr; column-gap: 64px; align-items: start; }
  main:not(.article) > * { grid-column: 1 / -1; }
  main:not(.article) > h1, main:not(.article) > .lede, main:not(.article) > #paidNote { max-width: 680px; }
  main:not(.article) > #paidNote { grid-row: 3; }
  main:not(.article) > form { grid-column: 1; grid-row: 4 / -1; }
  main:not(.article) > #results { grid-column: 2; grid-row: 4; }
  main:not(.article) > #sources { grid-column: 2; grid-row: 5; }
  main:not(.article) > footer { grid-column: 2; grid-row: 6; }
  #results > .card:first-of-type { border-top: 3px solid var(--ink); padding-top: var(--s-6); }
}
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  .row { grid-template-columns: 1fr; }
  .verdict strong { font-size: 1.875rem; }
  .stats div:first-child strong { font-size: 3.25rem; }
  .stats strong { font-size: 1.375rem; }
  .scale-row { grid-template-columns: 1fr; gap: 2px; }
  .scale-row .tag { display: none; }
  .scale-row.is-yours .tag { display: block; margin-bottom: var(--s-1); }
  .scale-row.is-yours .tag::before { content: "▲ "; }
  .paid { padding: var(--s-4); }
}
@media print {
  :root {
    --bg: #ffffff; --surface: #f4f3f0; --ink: #000000; --muted: #57534e; --line: #d8d4ce;
    --accent: #1d3fd1; --fair: #0a7a3e; --high: #b45309; --very-high: #c8102e;
  }
  body { background: #fff; color: #000; padding: 0; }
  main { display: block; max-width: none; padding: 0; }
  form, .paid, footer, .no-print { display: none !important; }
  .card { border: 0; padding: 0; }
  .scale .bar, .check li.flag::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  textarea { field-sizing: content; }
}

/* 15. Articles: one column, the same rules as the tool; a table for prices; a CTA that is not a box */
.article { max-width: var(--page); margin: 0 auto; padding: var(--s-8) 0 var(--s-12); }
.article p, .article li { max-width: 65ch; }
.article h2 { margin-top: var(--s-12); }
.article h2:first-of-type { margin-top: 0; }
.article ul, .article ol { padding-left: 1.2em; }
.article li { margin: var(--s-2) 0; }
.article table { width: 100%; border-collapse: collapse; margin: var(--s-4) 0 var(--s-6); font: var(--t-body); }
.article th, .article td { text-align: left; padding: var(--s-2) var(--s-3) var(--s-2) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th { font-weight: 700; border-bottom: 2px solid var(--ink); }
.article td.num, .article th.num { text-align: right; padding-left: var(--s-4); padding-right: 0; white-space: nowrap; }
.article td.num.wrap { white-space: normal; }
.article .cta { border-top: 3px solid var(--ink); padding-top: var(--s-6); margin: var(--s-12) 0; }
.article .cta .btn { margin-top: var(--s-4); }
.article .meta { font: var(--t-small); color: var(--muted); margin: 0 0 var(--s-8); }
.article .meta a { color: inherit; }
.article footer { margin-top: var(--s-12); }
.article .back { font: var(--t-small); display: inline-block; margin-bottom: var(--s-6); }
@media (max-width: 480px) {
  .article table { font-size: 0.875rem; }
  .article th, .article td, .article td.num, .article th.num { white-space: normal; padding-left: 0; padding-right: var(--s-2); }
  .article td.num, .article th.num { padding-left: var(--s-2); padding-right: 0; }
}
