:root {
  --paper: #F3F6F5;
  --surface: #FFFFFF;
  --ink: #1B2F3A;
  --ink-soft: #4A5B63;
  --line: #CED8D6;
  --cobalt: #2147C4;
  --cobalt-dark: #183694;
  --sun: #F2C230;
  --loss: #A8361F;
  --radius: 14px;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
}

.result-value, .bar-num, output, .stepper input { font-variant-numeric: tabular-nums; }

img, svg { display: block; }
a { color: var(--cobalt); text-underline-offset: 0.18em; }
a:hover { color: var(--cobalt-dark); }

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 1rem; }

.wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(44rem, 100% - 2rem); }

h1, h2, h3 { line-height: 1.1; margin: 0 0 0.6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); font-weight: 750; }
p { margin: 0 0 1em; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand-mark { width: 46px; height: 24px; }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { text-decoration: underline; }
@media (max-width: 640px) {
  .nav a:not(.btn) { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cobalt); color: #fff; text-decoration: none;
  font: inherit; font-weight: 700; border: 0; cursor: pointer;
  border-radius: 999px; padding: 0.85rem 1.5rem;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--cobalt-dark); color: #fff; }
.btn-small { padding: 0.55rem 1.1rem; font-size: 1rem; white-space: nowrap; }
@media (max-width: 400px) { .btn-small { padding: 0.5rem 0.85rem; font-size: 0.95rem; } .brand { font-size: 1.1rem; } }
.btn-large { padding: 1rem 1.9rem; font-size: 1.15rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-date { font-weight: 700; color: var(--loss); margin-bottom: 0.75rem; font-size: 1.15rem; }
.lead { font-size: clamp(1.2rem, 2vw, 1.4rem); color: var(--ink-soft); max-width: 34rem; }
.trust { font-weight: 600; margin-top: 1.5rem; padding-left: 1rem; border-left: 4px solid var(--sun); max-width: 30rem; }

/* Check */
.check {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.check-title { font-size: 1.35rem; margin-bottom: 1.25rem; }

.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.optional { font-weight: 400; color: var(--ink-soft); }
.hint { font-size: 0.95rem; color: var(--ink-soft); margin: 0.4rem 0 0; }
.error { font-size: 0.95rem; color: var(--loss); font-weight: 600; margin: 0.4rem 0 0; }

input[type="text"], input[type="email"], input[type="number"], input[type="tel"], select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  min-height: 3rem;
}
input:hover, select:hover { border-color: #A9B7B4; }
input[aria-invalid="true"] { border-color: var(--loss); }

.stepper { display: grid; grid-template-columns: 3rem 1fr 3rem; gap: 0.5rem; max-width: 15rem; }
.stepper input { text-align: center; font-weight: 700; font-size: 1.25rem; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step {
  font: inherit; font-size: 1.4rem; font-weight: 700; line-height: 1;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 10px; cursor: pointer;
}
.step:hover { border-color: var(--ink); }

.input-unit { display: flex; align-items: center; gap: 0.5rem; max-width: 15rem; }
.input-unit span { color: var(--ink-soft); font-weight: 600; }

input[type="range"] { width: 100%; accent-color: var(--cobalt); height: 2rem; }
output { float: right; font-weight: 700; }

/* The switch: the one memorable element */
.switch-row {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin: 1.75rem 0 1.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.switch-label { font-weight: 700; color: var(--ink-soft); transition: color 0.2s ease; white-space: nowrap; }
@media (max-width: 400px) { .switch-row { gap: 0.6rem; } .switch-label { font-size: 0.95rem; } }
.switch-label.is-active { color: var(--ink); }
.switch {
  position: relative; flex: none;
  width: 6.5rem; height: 3.4rem; border-radius: 999px;
  background: var(--ink); border: 0; cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.08);
}
.switch-knob {
  position: absolute; top: 0.35rem; left: 0.35rem;
  width: 2.7rem; height: 2.7rem; border-radius: 50%;
  background: url("/sun.svg") center / 100% no-repeat;
  box-shadow: 0 0 0 0 rgba(242,194,48,0.55);
  transition: transform 0.45s cubic-bezier(.3,1.4,.5,1), opacity 0.3s ease;
}
.switch[aria-checked="true"] { background: var(--loss); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(3.1rem) rotate(90deg); opacity: 0.85; }
.switch.nudge .switch-knob { animation: nudge 1.6s ease-in-out 1.2s 2; }
@keyframes nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242,194,48,0.55); }
  50% { box-shadow: 0 0 0 10px rgba(242,194,48,0); }
}

.result { text-align: center; }
.result-caption { color: var(--ink-soft); margin-bottom: 0.25rem; }
.result-value { font-size: clamp(2.8rem, 7vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 0.6rem; }
.result-value.is-after { color: var(--loss); }
.result-diff { font-weight: 600; min-height: 1.6em; }

.assumptions { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.assumptions summary { cursor: pointer; font-weight: 600; color: var(--cobalt); }
.assumptions-body { padding-top: 1rem; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.field-inline label { margin: 0; }
.field-inline .input-unit { max-width: 8rem; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }

.kwh { background: var(--ink); color: #E9EFEE; border-top: 0; }
.kwh + .section { border-top: 0; }
.kwh h2 { color: #fff; }
.bars { margin: 2rem 0 0; }
.bar-row { display: grid; grid-template-columns: 11rem 1fr 4.5rem; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.bar-name { font-weight: 600; }
.bar { height: 1.6rem; background: rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--w); border-radius: 6px; }
.bar-buy { background: #E9EFEE; }
.bar-sell { background: var(--sun); }
.bar-num { font-weight: 800; font-size: 1.2rem; text-align: right; }
.bars figcaption { font-size: 0.9rem; color: #A9BBC0; margin-top: 1.25rem; }
@media (max-width: 560px) {
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-name { grid-column: 1 / -1; margin-bottom: -0.5rem; }
}

.levers { margin: 1.5rem 0 0; }
.levers > div { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.levers > div:first-child { border-top: 0; padding-top: 0.5rem; }
.levers dt { font-weight: 750; font-size: 1.25rem; margin-bottom: 0.35rem; }
.levers dd { margin: 0; color: var(--ink-soft); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 2rem 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.5rem 3.5rem; color: var(--ink-soft); }
.steps li strong { display: block; color: var(--ink); font-size: 1.15rem; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.1rem;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--ink); font-weight: 800; color: var(--ink);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 1.1rem; top: 2.4rem; bottom: 0.2rem; width: 2px; background: var(--line);
}
.honest { font-weight: 600; }

/* Signup */
.signup { background: var(--surface); }
.signup-form { margin-top: 2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.consent { display: flex; gap: 0.75rem; align-items: flex-start; margin: 0.5rem 0 0.25rem; font-size: 1rem; }
.consent input { width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; flex: none; accent-color: var(--cobalt); }
.signup-form .btn { margin-top: 1.5rem; }
.form-status { margin-top: 1rem; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: #1D6B3A; }
.form-status.fail { color: var(--loss); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.15rem; list-style-position: outside; }
.faq details p { margin: 0.75rem 0 0; color: var(--ink-soft); }

/* Footer */
.site-footer { background: var(--ink); color: #C9D5D3; padding: 3rem 0; font-size: 1rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.2rem; }
.sources-title { color: #fff; font-weight: 700; }
.sources ul { margin: 0; padding-left: 1.1rem; }
.sources li { margin-bottom: 0.35rem; }

/* Privacy page */
.page { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.page h2 { font-size: 1.5rem; margin-top: 2rem; }
.page ul { padding-left: 1.2rem; }

/* Advies */
.advies h1 { max-width: 18ch; }
.advies-step { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: clamp(2rem, 4vw, 2.5rem); border-top: 1px solid var(--line); }
.advies-step h2 { font-size: 1.6rem; }
.advies h3 { font-size: 1.25rem; margin-top: 2.25rem; }
.drop {
  display: block; position: relative; cursor: pointer;
  border: 2px dashed #A9B7B4; border-radius: var(--radius); background: var(--surface);
  padding: 2rem 1.5rem; text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.drop:hover, .drop.is-over { border-color: var(--cobalt); background: #EEF2FC; }
.drop:focus-within { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-title { display: block; font-weight: 700; font-size: 1.15rem; }
.drop-sub { display: block; color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.35rem; }
.drop-alt { margin-top: 1rem; }
.linklike { font: inherit; color: var(--cobalt); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.help { margin-top: 1rem; }
.help summary { cursor: pointer; font-weight: 600; color: var(--cobalt); }
.help ul { padding-left: 1.2rem; color: var(--ink-soft); }
.help p { color: var(--ink-soft); }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; margin-top: 1rem; }
@media (max-width: 640px) { .price-grid { grid-template-columns: 1fr; } }
.data-summary { color: var(--ink-soft); }
.warn { background: #FFF6D9; border-left: 4px solid var(--sun); padding: 0.75rem 1rem; border-radius: 6px; }
.headline-loss { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center; margin-top: 1.5rem; }
.actions { list-style: none; counter-reset: act; padding: 0; margin: 1rem 0 0; }
.actions li { counter-increment: act; position: relative; padding: 1.1rem 0 1.1rem 3rem; border-top: 1px solid var(--line); }
.actions li::before { content: counter(act); position: absolute; left: 0; top: 1.05rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; font-size: 0.95rem; }
.actions p { margin: 0; color: var(--ink-soft); }
.action-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.3rem !important; color: var(--ink) !important; }
.action-head strong { font-size: 1.1rem; }
.action-amount { font-weight: 800; color: #1D6B3A; font-variant-numeric: tabular-nums; white-space: nowrap; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.4rem; height: 12rem; align-items: end; margin-top: 1rem; }
.month { display: flex; flex-direction: column; height: 100%; }
.month-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.mbar { width: 42%; min-height: 1px; border-radius: 3px 3px 0 0; }
.mbar-imp { background: var(--cobalt); }
.mbar-exp { background: var(--sun); }
.month-label { text-align: center; font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.3rem; }
.month.empty .month-label { opacity: 0.4; }
.legend { font-size: 0.95rem; color: var(--ink-soft); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.key { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 3px; }
.key-imp { background: var(--cobalt); }
.key-exp { background: var(--sun); margin-left: 0.8rem; }
.disclaimer { margin-top: 2.5rem; }
.advies .signup { background: transparent; }
.hero-more { margin-top: 1.25rem; font-weight: 600; }
.action-amount.is-muted { color: var(--ink-soft); }

/* Admin */
.admin-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.95rem; color: var(--ink-soft); }
@media (max-width: 640px) { .admin-user span { display: none; } }
.btn-quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-quiet:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.admin-title { font-size: clamp(2rem, 4vw, 2.6rem); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0 0; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.stat p { margin: 0; }
.stat-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 600; }
.stat-note { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.2rem !important; }
.admin-section { margin-top: 2.5rem; }
.admin-section h2 { font-size: 1.35rem; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.section-head h2 { margin: 0; }
.days { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; height: 10rem; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1rem 0.5rem; }
.day { display: flex; flex-direction: column; height: 100%; }
.day-stack { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.day-stack .mbar { width: 100%; border-radius: 2px; min-height: 0; }
.day .month-label { font-size: 0.7rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { font-weight: 700; background: var(--paper); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.empty-cell { color: var(--ink-soft); text-align: center !important; padding: 1.5rem !important; }
.contact { display: flex; flex-direction: column; min-width: 12rem; }
.contact span { color: var(--ink-soft); }
.status-select { min-height: 2.4rem; padding: 0.35rem 0.6rem; font-weight: 600; min-width: 8rem; }
.status-nieuw { border-color: var(--sun); background: #FFF6D9; }
.status-gebeld { border-color: var(--cobalt); }
.status-klant { border-color: #1D6B3A; background: #E7F3EB; }
.status-afgewezen { color: var(--ink-soft); }
.note-input { min-height: 2.4rem !important; padding: 0.35rem 0.6rem !important; min-width: 12rem; }
code { font-size: 0.9em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.3em; }
.days { grid-template-columns: repeat(30, minmax(0, 1fr)); }
.day { min-width: 0; }
@media (max-width: 640px) {
  .admin-body .brand span { display: none; }
  .days { gap: 2px; padding: 0.75rem 0.6rem 0.4rem; }
  .day:nth-child(odd) .month-label { visibility: hidden; }
  .day .month-label { font-size: 0.6rem; }
}
