/* Onlinegeldkompas — gedeelde opmaak
   Rustig, modern, mobiel-eerst. */

:root {
  --bg: #f7f6f1;
  --bg-soft: #efece2;
  --card: #ffffff;
  --ink: #17201b;
  --muted: #667069;
  --line: #e3e0d5;
  --accent: #1f6f4a;
  --accent-dark: #175638;
  --accent-soft: #e6f1ea;
  --warm: #b4642a;
  --warm-soft: #fbeee4;
  --danger: #a5372c;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(23, 32, 27, .04), 0 10px 26px rgba(23, 32, 27, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 18px;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; margin: 0 0 10px; }
h1 { font-size: clamp(2rem, 7vw, 2.9rem); }
h2 { font-size: clamp(1.3rem, 4vw, 1.6rem); }
h3 { font-size: 1.08rem; }

p { margin: 0 0 14px; }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 246, 241, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
  padding: 2px;
}

.nav::-webkit-scrollbar { display: none; }

.nav-link {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover { background: var(--bg-soft); color: var(--ink); }

.nav-link.is-active { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- hero ---------- */

.hero { padding: 44px 0 32px; }

/* de hero op de homepage heeft ook .wrap: houd dezelfde zijmarge als de kaarten */
.hero.wrap { padding-left: 18px; padding-right: 18px; }

.eyebrow {
  margin: 0 0 12px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.lead {
  max-width: 60ch;
  font-size: 1.08rem;
  color: #45504a;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
  font-size: .97rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .14s ease, transform .1s ease, border-color .14s ease;
}

.btn:hover { background: var(--accent-dark); }
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.btn.secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.btn.secondary:hover { background: var(--bg-soft); }

.btn.ghost {
  background: transparent;
  color: var(--accent-dark);
  border-color: #cfdcd4;
}
.btn.ghost:hover { background: var(--accent-soft); }

.btn.small { padding: 8px 14px; font-size: .86rem; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- secties en kaarten ---------- */

.section-title { margin: 26px 0 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 16px;
}

.card.soft { background: var(--accent-soft); border-color: #cfe3d7; box-shadow: none; }
.card.warm { background: var(--warm-soft); border-color: #eed9c6; box-shadow: none; }

.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.grid {
  display: grid;
  gap: 14px;
}

.tools { grid-template-columns: 1fr; }

@media (min-width: 700px) {
  .tools { grid-template-columns: 1fr 1fr; }
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform .14s ease, border-color .14s ease;
}

.tool-card:hover { transform: translateY(-2px); border-color: #c9d9d0; }

.tool-card h3 { margin: 0; }

.tool-card p { margin: 0; color: var(--muted); font-size: .95rem; }

.tool-card .card-go {
  margin-top: 6px;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 650;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 1.1rem;
}

.steps { margin: 0; padding-left: 20px; color: #45504a; }
.steps li { margin-bottom: 8px; }

/* ---------- toolindeling ---------- */

.tool-layout { display: grid; gap: 16px; }

/* houdt een brede tabel binnen de kaart op smalle schermen */
.tool-layout > * { min-width: 0; }

@media (min-width: 860px) {
  .tool-layout { grid-template-columns: 1.15fr .85fr; align-items: start; }
  .tool-layout .result-col { position: sticky; top: 76px; }
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: .92rem;
  font-weight: 620;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 400;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fdfcf9;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder { color: #a6aea8; }

/* Euro-invoer */
.money { position: relative; }
.money input { padding-left: 30px; }
.money::before {
  content: "€";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
}

.two-fields { display: grid; gap: 12px; }
@media (min-width: 520px) { .two-fields { grid-template-columns: 1fr 1fr; } }

/* Periode-schakelaar */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf6;
}

.seg {
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .93rem;
  font-weight: 620;
  cursor: pointer;
}

.seg[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Rijen met naam + bedrag */
.rows { display: grid; gap: 8px; margin-bottom: 10px; }

.row-item {
  display: grid;
  grid-template-columns: 1fr 100px 44px;
  gap: 8px;
  align-items: center;
}

.row-item input[type="text"] { min-width: 0; }
.row-item .money input { text-align: right; }

.remove {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdfcf9;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.remove:hover { background: var(--warm-soft); border-color: #eed9c6; color: var(--warm); }
.remove:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.add-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px dashed #cfc9b9;
  border-radius: 12px;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: .88rem;
  font-weight: 620;
  cursor: pointer;
}

.add-row:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- resultaat ---------- */

.result-box {
  padding: 20px;
  border-radius: 16px;
  background: #f6f5ef;
  border: 1px solid var(--line);
}

.result-box.pos { background: var(--accent-soft); border-color: #cfe3d7; }
.result-box.neg { background: var(--warm-soft); border-color: #eed9c6; }

.big-number {
  display: block;
  margin: 4px 0 2px;
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  font-weight: 720;
  letter-spacing: -.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.result-label { display: block; color: var(--muted); font-size: .86rem; }

.sum-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: .94rem;
}

.sum-row:last-child { border-bottom: 0; padding-bottom: 0; }

.sum-row strong { font-variant-numeric: tabular-nums; }

.formula {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fbfaf6;
  border: 1px dashed #d8d3c4;
  color: #4b544e;
  font-size: .88rem;
  line-height: 1.65;
}

.formula code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }

.bar {
  height: 9px;
  margin-top: 14px;
  border-radius: 999px;
  background: #e7e4d8;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .2s ease;
}

.bar.over > span { background: var(--warm); }

.note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: .88rem;
}

.warn {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #eed9c6;
  background: var(--warm-soft);
  color: #8a4c1e;
  font-size: .9rem;
}

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .78rem; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- tabellen ---------- */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

table.data th,
table.data td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid #d8d3c4;
  white-space: nowrap;
}

table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr.is-focus { background: var(--accent-soft); }
table.data tr.is-focus td { font-weight: 620; }

/* ---------- quiz ---------- */

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: .82rem;
  color: var(--muted);
}

.quiz-dots { display: flex; gap: 5px; }

.quiz-dots span {
  width: 22px;
  height: 5px;
  border-radius: 999px;
  background: #e0dccd;
}

.quiz-dots span.done { background: var(--accent); }

.question { font-size: 1.15rem; font-weight: 650; line-height: 1.4; margin-bottom: 16px; }

.options { display: grid; gap: 9px; }

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fdfcf9;
  color: var(--ink);
  font: inherit;
  font-size: .97rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}

.option:hover:not(:disabled) { border-color: #c5d5cc; background: #f9f8f3; }
.option:disabled { cursor: default; }
.option:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.option.correct { border-color: var(--accent); background: var(--accent-soft); font-weight: 620; }
.option.wrong { border-color: #d9b2a9; background: #fbeeee; }

.option-mark { font-weight: 700; }

.feedback {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f6f5ef;
  border: 1px solid var(--line);
  font-size: .93rem;
}

.feedback.good { background: var(--accent-soft); border-color: #cfe3d7; }
.feedback.bad { background: var(--warm-soft); border-color: #eed9c6; }

.feedback strong { display: block; margin-bottom: 4px; }

.quiz-actions { margin-top: 16px; }

.score-big {
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  font-weight: 720;
  letter-spacing: -.03em;
  color: var(--accent);
  line-height: 1;
  margin: 6px 0 6px;
}

/* ---------- bronnen ---------- */

.bron-groep { padding: 16px 0; border-bottom: 1px dashed #d8d3c4; }
.bron-groep:last-of-type { border-bottom: 0; padding-bottom: 0; }
.bron-groep h3 { margin-bottom: 8px; }

.bron-lijst {
  margin: 0;
  padding-left: 20px;
  color: #45504a;
  font-size: .94rem;
}

.bron-lijst li { margin-bottom: 8px; overflow-wrap: anywhere; }
.bron-lijst li:last-child { margin-bottom: 0; }
.bron-lijst a { color: var(--accent-dark); }
.bron-lijst a:hover { color: var(--accent); }

/* duidelijke markering bij een ongeldige invoer */
input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fdf3f1;
}

/* ---------- footer ---------- */

.site-foot {
  margin-top: 40px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: .88rem;
}

.site-foot p { margin: 0 0 10px; }
.site-foot a { color: var(--accent-dark); }
.site-foot .maker { font-size: .86rem; color: #5b665f; }

@media (min-width: 700px) {
  .card { padding: 26px; }
  .hero { padding: 60px 0 36px; }
}

/* abonnementen */
.abonnement {
  padding: 10px 0;
  border-bottom: 1px dashed #e0dccd;
}

.abonnement:first-child { padding-top: 0; }
.abonnement:last-child { border-bottom: 0; padding-bottom: 0; }

.opzeg-knop { margin-top: 8px; }
.opzeg-info { margin-top: 8px; }

/* quiz */
.quiz-score-tekst { color: var(--muted); font-size: .9rem; }

/* ---------- menu op smalle schermen ---------- */

@media (max-width: 800px) {
  .head-inner { flex-wrap: wrap; row-gap: 6px; }
  .nav { width: 100%; margin-left: 0; flex-wrap: wrap; gap: 4px; }
  .nav-link { font-size: .84rem; padding: 6px 10px; }
}

/* ---------- hero met illustratie ---------- */

.hero-grid { display: grid; gap: 24px; align-items: center; }

@media (min-width: 820px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 34px; }
}

.hero-grid .hero-actions { margin-top: 20px; }

.illus {
  padding: 16px 16px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #ffffff 0%, var(--bg-soft) 100%);
  box-shadow: var(--shadow);
}

.illus svg { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; }

.hero-legend {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: .82rem;
  color: var(--muted);
}

.hero-legend li { display: flex; align-items: center; gap: 8px; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dot-uit { background: #1f6f4a; }
.dot-spaar { background: #b4642a; }
.dot-leuk { background: #c2a03c; }

/* ---------- voorbeeldbudgetten ---------- */

.example-budgets { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 10px; }

.example-btn {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fdfcf9;
  color: var(--accent-dark);
  font: inherit;
  font-size: .88rem;
  font-weight: 620;
  cursor: pointer;
  text-align: left;
}

.example-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.example-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.example-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- geldkeuzelab ---------- */

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: .82rem;
  font-weight: 620;
}

.pill.warm { background: var(--warm-soft); color: #8a4c1e; }

.lab-budget {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f6f5ef;
  margin-bottom: 16px;
}

.lab-budget.pos { background: var(--accent-soft); border-color: #cfe3d7; }
.lab-budget.neg { background: var(--warm-soft); border-color: #eed9c6; }

.lab-budget .big-number { font-size: clamp(1.5rem, 6vw, 2rem); margin: 2px 0 0; }

.lab-progress { display: flex; gap: 5px; margin-bottom: 12px; }
.lab-progress span { width: 26px; height: 5px; border-radius: 999px; background: #e0dccd; }
.lab-progress span.done { background: var(--accent); }

.choice-grid { display: grid; gap: 10px; margin-top: 14px; }

.choice {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fdfcf9;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}

.choice:hover { border-color: #c5d5cc; background: #f9f8f3; }
.choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice strong { display: block; font-size: .97rem; margin-bottom: 2px; }
.choice .choice-sub { display: block; color: var(--muted); font-size: .87rem; line-height: 1.5; }
.choice .choice-cost { display: inline-block; margin-top: 6px; color: var(--accent-dark); font-size: .84rem; font-weight: 650; }

.choice-uitleg {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: #1d5c40;
  font-size: .92rem;
}

.choice-uitleg strong { display: block; margin-bottom: 4px; }

/* ---------- uitlegkaarten ---------- */

.explain-grid { display: grid; gap: 14px; }

@media (min-width: 760px) {
  .explain-grid { grid-template-columns: 1fr 1fr; }
}

.explain-card { display: flex; flex-direction: column; }
.explain-card h2 { font-size: 1.15rem; margin-bottom: 8px; }
.explain-card .explain-links { margin-top: auto; padding-top: 10px; font-size: .88rem; }

.source-line {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #d8d3c4;
  font-size: .79rem;
  color: var(--muted);
}

/* ---------- hulp bij geldstress ---------- */

.help-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.help-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fdfcf9;
}

.help-item h3 { margin-bottom: 6px; }
.help-item p { margin-bottom: 6px; font-size: .93rem; color: #45504a; }
.help-item p:last-child { margin-bottom: 0; }

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

@media print {
  .site-head, .site-foot, .btn, .add-row, .remove { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
