/* ============================================================
   SmartTag — Kystverk
   Pilot Kristiansand, høsten 2026
   Design direction 01 "Kystverk": myndig & presis.
   Palette and type ported 1:1 from the approved design file
   (SmartTag Kystverk.dc.html), then made responsive + accessible.
   ============================================================ */

:root {
  /* Surfaces */
  --cream:        #f4f1e9;
  --cream-card:   #fbfaf5;
  --white:        #ffffff;

  /* Ink / text */
  --navy:         #0c2233;
  --navy-2:       #16384d;
  --ink:          #16181a;
  --body:         #45525a;
  --muted:        #5a6168;
  --muted-2:      #656d73; /* WCAG AA on cream/white (was #7a8389, failed contrast) */
  --faint:        #6a655c; /* WCAG AA on cream/white/card (was #9a968d, failed contrast) */
  --on-navy:      #d6dee2;
  --on-navy-mute: #93a3ab;
  --on-navy-mute2:#8ea0a9;

  /* Lines */
  --line:         #e3ddd0;
  --line-2:       #d8d2c6;
  --line-soft:    #eee7d9;
  --line-track:   #e7e0d1;

  /* Accent */
  --coral:        #e2552b;
  --coral-dark:   #c8451f;
  --coral-tint:   #fdf1ec;
  --coral-tint-2: #fdeee8;
  --coral-disabled:#e7c9bb;

  /* Status */
  --green:        #1b8a5a;
  --green-bright: #23b26d;
  --gold:         #f3c14a;

  /* Illustration */
  --illu-1:       #eaf1f3;
  --illu-2:       #dce9ec;

  --shadow-card:  0 22px 44px -30px rgba(12, 34, 51, 0.4);
  --shadow-float: 0 26px 50px -18px rgba(12, 34, 51, 0.5);

  --maxw:         1180px;
  --radius:       14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3, h4 { margin: 0; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font-family: inherit;
  outline: none;
}
input::placeholder { color: #787266; }

.mono { font-family: 'Space Mono', ui-monospace, monospace; }

/* Visible focus for keyboard users */
:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- view switching ---------- */
.view { display: none; }
.view.is-active { display: block; animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   Header
   ============================================================ */
.partner-strip {
  background: var(--navy);
  color: var(--on-navy);
  text-align: center;
  padding: 8px 20px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.partner-strip strong { color: #fff; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 6vw;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: none;
}
.brand .diamond {
  width: 14px; height: 14px;
  background: var(--navy);
  transform: rotate(45deg);
  display: inline-block;
}
.brand .wordmark {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.nav-links {
  display: flex;
  gap: 30px;
  font-size: 14.5px;
  font-weight: 500;
}
.navlink {
  font: inherit;
  color: #34424a;
  background: none;
  cursor: pointer;
  padding: 0;
}
.navlink:hover { color: var(--coral); }

/* inline link-styled button (real button for a11y, looks like a link) */
.linklike {
  font: inherit;
  background: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  color: inherit;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, filter .15s ease;
  white-space: nowrap;
  font-size: 15px;
  padding: 13px 24px;
}
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: var(--coral-dark); }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] { background: var(--coral-disabled); color: #7a4b3a; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid rgba(12,34,51,.19); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-lg { font-size: 16px; padding: 15px 28px; border-radius: 9px; }
.btn-block { display: flex; width: 100%; }

/* ============================================================
   Landing — hero
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  max-width: 1400px;
  margin: 0 auto;
}
.hero-copy {
  padding: 84px 4vw 80px 6vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eyebrow {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
}
.hero h1 {
  font-size: clamp(40px, 7vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--navy);
  margin: 22px 0;
}
.hero-lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--body);
  margin: 0 0 32px;
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.hero-note {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted-2);
}
.hero-note .check { color: var(--green); font-weight: 700; }

.hero-media {
  position: relative;
  min-height: 560px;
  background-image: linear-gradient(180deg, rgba(12,34,51,.12), rgba(12,34,51,.34)), url('assets/hero-fjord.jpg');
  background-size: cover;
  background-position: center;
}
.tag-card {
  position: absolute;
  left: -54px;
  bottom: 60px;
  width: 272px;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-float);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.tag-card-row { display: flex; gap: 14px; align-items: center; }
.tag-card .label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #6c7277;
}
.tag-card .serial { font-weight: 700; font-size: 17px; color: var(--navy); margin: 3px 0; }
.tag-card .status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); font-weight: 600; }
.tag-card .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); }

/* ---------- stats band ---------- */
.stats {
  background: var(--navy);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 30px 6vw; /* align content with the page's 6vw margin (matches hero) */
}
.stat { padding-right: 32px; border-right: 1px solid rgba(255,255,255,.09); }
.stat + .stat { padding-left: 32px; }
.stat:last-child { border-right: none; padding-right: 0; }
.stat .num { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: #fff; }
.stat .num span { color: var(--coral); }
.stat .cap { font-size: 13px; line-height: 1.3; color: var(--on-navy-mute); margin-top: 5px; }

/* ---------- section heading ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 86px 6vw 40px; }
.section-tight { padding: 48px 6vw 40px; }
.section h2 {
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--navy);
  margin: 0 0 44px;
  max-width: 18ch;
}

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
}
.step .idx { font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 700; color: var(--coral); margin-bottom: 18px; }
.step .ico { width: 46px; height: 46px; margin-bottom: 16px; }
.step h3 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 0 0 8px; }
.step p { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0; }

/* ---------- value grid ---------- */
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.value { border-top: 2px solid var(--navy); padding-top: 16px; }
.value.accent { border-top-color: var(--coral); }
.value h4 { font-size: 16px; font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.value p { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin: 0; }

/* ---------- cta band ---------- */
.cta-wrap { max-width: var(--maxw); margin: 40px auto 0; padding: 0 6vw; }
.cta {
  background: var(--navy);
  border-radius: 18px;
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cta h2 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -0.02em; color: #fff; margin: 0 0 8px; }
.cta p { font-size: 16px; color: var(--on-navy-mute); margin: 0; max-width: 48ch; }

/* ---------- footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 6vw 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer .brand-sm { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--navy); }
.footer .brand-sm .diamond { width: 12px; height: 12px; background: var(--navy); transform: rotate(45deg); display: inline-block; }
.footer .legal { font-size: 13px; color: #6d685e; max-width: 60ch; }
.footer .legal .linklike { color: var(--muted); }

/* ============================================================
   Flow shells (register / quiz / result / confirm)
   ============================================================ */
.flow { max-width: 760px; margin: 0 auto; padding: 54px 24px 90px; }
.flow-narrow { max-width: 620px; }
.flow-quiz { max-width: 720px; }

.back-link {
  font-size: 14px; color: var(--muted-2);
  cursor: pointer; margin-bottom: 28px;
  display: inline-flex; align-items: center; gap: 6px; background: none;
}
.back-link:hover { color: var(--navy); }

.stepper { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stepper .tag { font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; color: var(--coral); }
.stepper .tag.done { color: var(--green); }
.stepper .bar { height: 4px; width: 56px; background: var(--line); border-radius: 2px; }
.stepper .bar.on { background: var(--coral); }
.stepper .bar.done { background: var(--green); }

.flow h1 { font-size: clamp(30px, 6vw, 40px); font-weight: 800; letter-spacing: -0.025em; color: var(--navy); margin: 0 0 8px; }
.flow .sub { font-size: 16px; line-height: 1.5; color: var(--muted); margin: 0 0 34px; max-width: 52ch; }

/* ---------- form card ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px;
  box-shadow: var(--shadow-card);
}
.field { display: flex; flex-direction: column; }
.field + .field, .form-grid, .field-row { margin-top: 20px; }
.field label, .field-label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--body); margin-bottom: 7px;
}
.field-label .hint { color: var(--faint); font-weight: 400; }
.field input {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 13px 15px;
  font-size: 15px;
  color: var(--ink);
  background: var(--cream-card);
  transition: border-color .15s ease;
}
.field input:focus { border-color: var(--coral); }
.field input[aria-invalid="true"] { border-color: var(--coral); background: var(--coral-tint); }
.field .error { font-size: 12.5px; color: var(--coral-dark); margin-top: 6px; min-height: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.form-grid .field { margin-top: 0; } /* keep E-post & Telefon top-aligned (override .field + .field) */

/* quantity stepper */
.quota {
  border-top: 1px solid var(--line-soft);
  padding-top: 22px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.qty { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; width: fit-content; }
.qty button { padding: 11px 18px; font-size: 20px; color: var(--navy); background: var(--cream); user-select: none; line-height: 1; }
.qty button:hover { background: #ece5d6; }
.qty button:disabled { color: #c9c2b4; cursor: not-allowed; }
.qty .count { padding: 11px 24px; font-size: 18px; font-weight: 800; color: var(--navy); min-width: 64px; text-align: center; }
.price { text-align: right; }
.price .x { font-size: 13px; color: var(--faint); }
.price .total { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }

/* consent */
.consent {
  display: flex; gap: 12px; align-items: flex-start;
  border-top: 1px solid var(--line-soft); padding-top: 22px; margin-top: 22px;
}
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--coral); flex-shrink: 0; }
.consent label { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.consent .linklike { color: var(--coral-dark); }

.notice {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 2px 0; font-size: 13.5px; color: var(--muted-2);
}
.notice .bang { color: var(--coral); font-weight: 700; }

.form-hint { text-align: center; font-size: 13px; color: var(--faint); margin-top: 10px; }
.form-error {
  background: var(--coral-tint); border: 1px solid var(--coral);
  color: var(--coral-dark); border-radius: 9px; padding: 12px 14px;
  font-size: 14px; margin-top: 16px;
}

/* ============================================================
   Quiz
   ============================================================ */
.quiz-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quiz-meta .q { font-size: 13px; font-weight: 700; color: var(--navy); }
.quiz-meta .c { font-size: 13px; color: #6d685e; }
.progress { height: 6px; background: var(--line-track); border-radius: 3px; overflow: hidden; margin-bottom: 28px; }
.progress > span { display: block; height: 100%; background: var(--coral); border-radius: 3px; transition: width .3s ease; }

.illu { border-radius: 12px; overflow: hidden; margin-bottom: 22px; background: var(--illu-1); border: 1px solid var(--line); }
.illu img { width: 100%; display: block; }
.illu svg { width: 100%; display: block; }
.quiz-q { font-size: 22px; font-weight: 800; line-height: 1.3; color: var(--navy); margin: 0 0 20px; }

.options { display: flex; flex-direction: column; gap: 11px; border: none; padding: 0; margin: 0; }
.opt {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--body);
  border-radius: 11px; padding: 15px 18px; font-size: 16px; font-weight: 500;
  cursor: pointer; transition: all .15s ease; text-align: left; width: 100%;
}
.opt:hover { border-color: var(--line-2); }
.opt.sel { border: 1.5px solid var(--coral); background: var(--coral-tint); color: var(--navy); font-weight: 600; }
.opt .mark {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #cfc8ba; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; color: var(--faint);
}
.opt.sel .mark { border-color: var(--coral); background: var(--coral); color: #fff; }
.opt .opt-text { flex: 1; }

.quiz-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.quiz-nav .prev { font-weight: 700; font-size: 15px; padding: 13px 22px; border-radius: 9px; color: var(--navy); border: 1.5px solid rgba(12,34,51,.19); }
.quiz-nav .prev:disabled { color: #c3bcae; border-color: transparent; cursor: default; }

/* ============================================================
   Result / Confirm
   ============================================================ */
.result { text-align: center; }
.badge {
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 26px; font-size: 40px; color: #fff;
}
.badge.pass { background: var(--green); }
.badge.fail { background: #f4ece0; border: 2px solid var(--coral); color: var(--coral); font-size: 38px; }
.result h1 { margin-bottom: 12px; }
.result .score { font-size: 18px; line-height: 1.5; color: var(--muted); margin: 0 0 8px; }
.result .score strong { color: var(--navy); }
.result .hint { font-size: 15px; color: var(--muted-2); margin: 0 auto 34px; max-width: 44ch; }

.receipt {
  background: var(--navy);
  border-radius: 16px;
  padding: 28px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.receipt .row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.receipt .row + .row { border-top: 1px solid rgba(255,255,255,.09); padding-top: 14px; }
.receipt .k { font-size: 14px; color: var(--on-navy-mute2); }
.receipt .v { font-size: 15px; font-weight: 600; color: #fff; text-align: right; }
.receipt .v.mono { font-family: 'Space Mono', monospace; font-weight: 700; }
.receipt .v.prod { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--gold); }
.receipt .v.prod .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.confirm-note { font-size: 14.5px; line-height: 1.6; color: var(--muted-2); margin: 0 0 28px; }
.confirm-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   Personvern / modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(12,34,51,.55);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--cream);
  border-radius: 16px;
  max-width: 620px; width: 100%;
  max-height: 86vh; overflow-y: auto;
  padding: 36px;
  box-shadow: 0 40px 80px -20px rgba(12,34,51,.6);
}
.modal h2 { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; margin-bottom: 8px; }
.modal .modal-sub { font-size: 13px; color: var(--faint); margin: 0 0 20px; }
.modal h3 { font-size: 15px; font-weight: 700; color: var(--navy); margin: 20px 0 6px; }
.modal p, .modal li { font-size: 14px; line-height: 1.6; color: var(--body); }
.modal ul { margin: 6px 0; padding-left: 20px; }
.modal .modal-close { margin-top: 24px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 56px 6vw 40px; }
  .hero-media { min-height: 320px; order: -1; }
  .tag-card { left: auto; right: 16px; bottom: -28px; width: 240px; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .stat { padding: 0; border-right: none; }
  .stat:nth-child(odd) { padding-right: 24px; border-right: 1px solid rgba(255,255,255,.09); }
  .stat:nth-child(even) { padding-left: 24px; }
  .steps { grid-template-columns: 1fr; }
  .values { grid-template-columns: 1fr 1fr; }
  .cta { padding: 36px; }
  .section { padding: 64px 6vw 32px; }
}

@media (max-width: 520px) {
  .partner-strip { font-size: 11px; }
  .stats { grid-template-columns: 1fr; row-gap: 20px; }
  .stat, .stat:nth-child(odd), .stat:nth-child(even) { padding: 0; border-right: none; }
  .values { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .quota { flex-direction: column; align-items: flex-start; }
  .price { text-align: left; }
  .flow { padding: 36px 18px 72px; }
  .card { padding: 24px; }
  .modal { padding: 26px; }
}

/* ============================================================
   Print (receipt)
   ============================================================ */
@media print {
  .partner-strip, .nav, .footer, .confirm-actions, .stepper, .back-link { display: none !important; }
  body { background: #fff; }
  .receipt { background: #fff; color: #000; border: 1px solid #ccc; }
  .receipt .k, .receipt .v, .receipt .v.prod { color: #000 !important; }
  .flow { padding-top: 0; }
}
