/* LeadLab-motoren – rolig, tillitvekkende, mobil først. Merkefarger og bolkfarger settes fra site.json (CSS-variabler). */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1e2a2f;
  --muted: #5d6b73;
  --border: #e3ded4;
  --brand: #1f5f66;
  --brand-ink: #14464b;
  --brand-soft: #e4f0ef;
  --auto: #2f7d5b;
  --auto-soft: #e7f3ec;
  --self: #2c5d9e;
  --self-soft: #e6eef9;
  --save: #8a5a1c;
  --save-soft: #f7ecdc;
  --danger: #8f3b2d;
  --danger-soft: #f8e9e5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 42, 47, .06), 0 6px 20px rgba(30, 42, 47, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 5.5vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 4.5vw, 1.9rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--brand); }
a:hover { color: var(--brand-ink); }
ul { padding-left: 1.2em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
[hidden] { display: none !important; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 18px; }

/* ---------- topp ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.brand strong { font-size: 1.15rem; letter-spacing: -.01em; }
.brand span { font-size: .8rem; color: var(--muted); }
.topnav a { font-size: .95rem; margin-left: 14px; }
@media (max-width: 520px) { .topnav { display: none; } }

.notice {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: .92rem;
  padding: 10px 0;
  border-bottom: 1px solid #d3e4e2;
}
.notice .wrap { display: flex; gap: 10px; align-items: flex-start; }
.notice svg { flex: none; margin-top: 3px; }

/* ---------- hero ---------- */
.hero { padding: 36px 0 12px; }
.hero h1 { margin-bottom: .5em; }
.hero .lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.hero .promise { display: grid; gap: 10px; margin: 22px 0 6px; }
.promise-item { display: flex; gap: 12px; align-items: flex-start; font-size: 1rem; }
.promise-item .pn { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .95rem; }

/* ---------- kort/skjema ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
  margin: 18px 0;
}
@media (min-width: 600px) { .card { padding: 28px 28px; } }

fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend, .field > label { font-weight: 600; display: block; margin-bottom: 8px; }
.choices { display: grid; gap: 8px; }
@media (min-width: 480px) { .choices { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.choice {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfaf7;
  cursor: pointer;
  font-weight: 500;
}
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:focus-visible) { outline: 3px solid #9ec9c6; outline-offset: 2px; }
.choice input { width: 20px; height: 20px; accent-color: var(--brand); margin: 0; }
.choices--tri .choice { padding: 9px 12px; font-weight: 500; }
.tri { margin-bottom: 14px; }
.tri legend { font-weight: 500; margin-bottom: 6px; }
.tri .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 320px; }

input[type="date"], input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid #c9c3b7;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus-visible { outline: 3px solid #9ec9c6; outline-offset: 1px; border-color: var(--brand); }
.field { margin-bottom: 14px; }
.field .hint { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.field--required .hint { color: var(--self); }
.req, .req-dyn { color: var(--danger); }
.fields { display: grid; gap: 4px; }
@media (min-width: 600px) { .fields { grid-template-columns: 1fr 1fr; column-gap: 16px; } }

details.more { margin: 6px 0 18px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--brand); list-style: none; padding: 6px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; }
details.more[open] > summary::before { content: "– "; }
details.more .inner { padding-top: 10px; }

.btn {
  display: inline-block;
  font: inherit; font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-ink); color: #fff; }
.btn--primary:disabled { opacity: .6; cursor: default; }
.btn--ghost { background: transparent; border-color: #c9c3b7; color: var(--ink); font-weight: 500; font-size: .95rem; padding: 9px 14px; }
.btn--ghost:hover { background: #fff; }
.btn--link { background: var(--brand-soft); color: var(--brand-ink); font-size: .95rem; padding: 9px 14px; margin: 6px 0 4px; }
.btn--link:hover { background: #d5e8e6; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 8px; }

.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #ebcfc8;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0;
  font-weight: 500;
}

/* ---------- resultat ---------- */
#resultat { padding-top: 12px; }
.result-head { margin: 20px 0 6px; }
.result-head .lead { font-size: 1.05rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }

.bolk { margin: 28px 0; }
.bolk-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.bolk-num {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 1.05rem; margin-top: 2px;
}
.bolk { --c: var(--brand); }
.bolk .bolk-num { background: var(--c); }
.bolk-ingress { color: var(--muted); margin: 0; max-width: 62ch; }
.bolk-note { font-size: .95rem; background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }

.items { display: grid; gap: 12px; }
.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 12px;
}
@media (min-width: 600px) { .item { padding: 20px 22px 14px; } }
.bolk .item { border-left-color: var(--c); }
.item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; margin-bottom: 6px; }
.item-head h4 { margin: 0; }
.aktor { font-size: .85rem; color: var(--muted); }

.badge { display: inline-block; font-size: .82rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin: 0 0 8px; }
.badge--auto { background: var(--auto-soft); color: var(--auto); }
.badge--status { background: var(--auto-soft); color: var(--auto); }
.badge--status::before { content: "✓ "; }

.timing { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 2px; font-size: .98rem; }
.timing .dot { width: 10px; height: 10px; border-radius: 50%; background: #b7b1a5; flex: none; }
.timing--naa .dot { background: var(--self); }
.timing--senere .dot { background: #8fb3d9; }
.timing--passert .dot { background: var(--save); }
.timing--passert { color: var(--save); }
.item .hint { margin: 0 0 8px; font-size: .88rem; color: var(--muted); }
.do { margin: 6px 0 8px; }
.detaljer { margin: 4px 0 8px; padding-left: 1.1em; font-size: .95rem; color: #2e3b41; }
.detaljer li { margin-bottom: 4px; }
details.mer { margin: 0 0 8px; }
details.mer > summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--brand); list-style: none; padding: 2px 0; }
details.mer > summary::-webkit-details-marker { display: none; }
details.mer > summary::before { content: "+ "; }
details.mer[open] > summary::before { content: "– "; }
details.mer > .detaljer { margin-top: 6px; }
.kanal { font-size: .95rem; margin: 6px 0; }
.kanal-label { color: var(--muted); }
.kilder { font-size: .8rem; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.kilder a { color: var(--muted); }
.hentet { white-space: nowrap; }

/* ---------- opt-in ---------- */
.optin {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  background: #fbfaf7;
  border: 1px solid var(--border);
}
.optin--partner { background: var(--save-soft); border-color: #ead7bb; }
.optin--sjekkliste { background: var(--brand-soft); border-color: #cfe1df; margin: 14px 0 18px; }
.optin-kicker { font-size: .88rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--brand); }
.check-text { display: flex; flex-direction: column; gap: 4px; }
.consent-text { font-size: .9rem; color: #3b474d; }

.lead-form h3 { margin-bottom: .3em; }
.confirm { border-left: 5px solid var(--auto); }

/* ---------- forklaring/footer ---------- */
.explain { padding: 10px 0 20px; }
.explain h2 { font-size: 1.35rem; }
.explain .grid { display: grid; gap: 14px; }
@media (min-width: 600px) { .explain .grid { grid-template-columns: 1fr 1fr; } }
.explain .card { margin: 0; padding: 18px; }
.explain h3 { font-size: 1.05rem; }

footer { border-top: 1px solid var(--border); margin-top: 30px; padding: 24px 0 40px; font-size: .9rem; color: var(--muted); background: var(--surface); }
footer .wrap { display: grid; gap: 8px; }
footer .nullkroner { font-weight: 600; color: var(--ink); }
footer a { color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .92rem;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- personvern ---------- */
.doc { padding: 24px 0 40px; }
.doc h2 { font-size: 1.25rem; margin-top: 1.6em; }
.doc table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 10px 0 16px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 8px; border-bottom: 1px solid var(--border); }
.doc th { background: #fbfaf7; }
.table-wrap { overflow-x: auto; }

/* ---------- print ---------- */
@media print {
  body { background: #fff; font-size: 12pt; }
  .topbar, .notice, .hero, .sjekk-card, .toolbar, .lead-section, .explain, #toast, .link-btn, .steps { display: none !important; }
  .item, .card { box-shadow: none; break-inside: avoid; }
  .btn--link { display: none; }
  a[href]::after { content: ""; }
  .kilder a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ---------- steg-skjema (generert fra site.json) ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.step + .step::before { content: ""; width: 14px; height: 1px; background: var(--border); margin-right: 2px; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: #eee9df; color: var(--muted); flex: none; }
.step--current .step-dot { background: var(--brand); color: #fff; }
.step--current .step-name { color: var(--ink); font-weight: 600; }
.step--done .step-dot { background: var(--auto-soft); color: var(--auto); }
.step--link { cursor: pointer; }
.step--link:hover .step-name { text-decoration: underline; }
@media (max-width: 480px) { .step-name { display: none; } .step--current .step-name { display: inline; } }
.step-title { font-size: 1.35rem; margin: 0 0 14px; outline: none; }
.step-panel .field { margin-bottom: 18px; }
.choice { min-height: 56px; }
.choice--kort { min-height: 62px; font-size: 1.05rem; }
.choice-text { display: flex; flex-direction: column; gap: 2px; }
.choice-desc { font-size: .85rem; color: var(--muted); font-weight: 400; }
.choices--tall, .choices--many { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.choice--tall { justify-content: center; padding: 10px 6px; min-height: 52px; }
.choice--tall input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice { position: relative; }
.choices--tri .choice--tri { min-height: 48px; }
.tri .choices, .field--tri .choices { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); max-width: 420px; }
select {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #c9c3b7; border-radius: 10px; background: #fff; color: var(--ink); min-height: 56px;
}
select:focus-visible { outline: 3px solid #9ec9c6; outline-offset: 1px; border-color: var(--brand); }
input[type="date"], input[type="text"], input[type="email"], input[type="tel"] { min-height: 56px; }
.postnr-row { display: flex; align-items: center; gap: 12px; }
.postnr-row input { max-width: 160px; }
.poststed { color: var(--muted); font-weight: 500; }
.field-error { color: var(--danger); font-size: .9rem; font-weight: 500; margin: 6px 0 0; }
.field--error input, .field--error select { border-color: var(--danger); }
.field--error .choice { border-color: #ebcfc8; }
.actions--steps { margin-top: 18px; }
.btn--big { min-height: 56px; font-size: 1.1rem; padding: 14px 24px; }
@media (max-width: 600px) { .actions--steps .btn--big, .lead-form .btn--big { width: 100%; } }
.back { margin-left: auto; }
.trust { font-size: .88rem; color: var(--muted); margin: 14px 0 0; }
.microtext { margin: 8px 0 0; }
.tag { display: inline-block; margin-left: 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); }
.kampanje { font-weight: 600; color: var(--save); margin: 0 0 8px; }

/* ---------- resultat: verdict, utvalgte, ring meg, kontakt ---------- */
.countdown { font-weight: 600; color: var(--brand-ink); margin: 0 0 4px; }
.verdict { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin: 10px 0 6px; box-shadow: var(--shadow); }
.verdict h3 { margin: 0 0 .3em; }
.verdict p { margin: 0; color: #2e3b41; }
.verdict-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #fff; }
.verdict--ok { border-left: 6px solid var(--auto); }
.verdict--ok .verdict-icon { background: var(--auto); }
.verdict--nei { border-left: 6px solid var(--danger); }
.verdict--nei .verdict-icon { background: var(--danger); }
.bolk-empty { background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; padding: 12px 14px; }
.utvalgte { margin: 14px 0 18px; }
.utvalgte h3 { margin-bottom: .2em; }
.optin--utvalgt { margin-top: 10px; }
.optin--vilkaar { background: var(--save-soft); border-color: #ead7bb; margin: 14px 0 18px; }
.optin-kicker { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.ring-meg { margin: 10px 0 0 34px; padding-top: 10px; border-top: 1px dashed var(--border); }
.check--small input { width: 20px; height: 20px; }
.check--small .check-text > span:first-child { font-weight: 600; font-size: .95rem; }
.contact { margin-top: 14px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.trust-line { margin-top: 12px; }
