/* Rekenhulpen. Leest de merkvariabelen van het thema (--ep-*); de waarden hieronder zijn alleen
   terugvalwaarden voor gebruik buiten het thema (statische demo). Mobiel eerst. */

.ept {
  --_bg: var(--ep-bg, #f5f7f0);
  --_surface: var(--ep-surface, #ffffff);
  --_surface-2: var(--ep-surface-2, #ebf0e4);
  --_text: var(--ep-text, #13291f);
  --_muted: var(--ep-muted, #56615c);
  --_border: var(--ep-border, #d3ddd0);
  --_ctl: var(--ep-border-strong, #8a978f);
  --_accent: var(--ep-accent, #0a6660);
  --_accent-contrast: var(--ep-accent-contrast, #ffffff);
  --_accent-soft: var(--ep-accent-soft, #e0f3f1);
  --_good: var(--ep-good, #1d6e29);
  --_good-soft: var(--ep-good-soft, #e5f6de);
  --_bad: var(--ep-bad, #a8321f);
  --_bad-soft: var(--ep-bad-soft, #ffe8e3);
  --_warn-soft: var(--ep-warn-soft, #fff4c7);
  --_radius: var(--ep-radius, 16px);
  --_radius-ctl: var(--ep-radius-ctl, 12px);
  --_font: var(--ep-font, inherit);
  --_font-display: var(--ep-font-display, inherit);
  --_grid: var(--ep-chart-grid, #e1e0d9);
  --_axis: var(--ep-chart-axis, #c3c2b7);
  color: var(--_text);
  font-family: var(--_font);
  font-size: 1rem;
  line-height: 1.5;
  margin: 1.5rem 0 2rem;
}
.ept *, .ept *::before, .ept *::after { box-sizing: border-box; }
.ept [hidden] { display: none !important; }

.ept-loading { color: var(--_muted); padding: 1rem 0; }

.ept-grid { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1000px) {
  .ept-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.75rem; }
  .ept--prijzen .ept-grid { grid-template-columns: 1fr; }
}

.ept-skip { justify-self: start; font-size: .9375rem; }
@media (min-width: 1000px) { .ept-skip { display: none; } }

/* ---------- formulier */
.ept-form { display: grid; gap: 1rem; min-width: 0; }
.ept-step {
  background: var(--_surface); border: 1px solid var(--_border); border-radius: var(--_radius);
  padding: 1rem; display: grid; gap: .9rem; min-width: 0;
}
@media (min-width: 600px) { .ept-step { padding: 1.25rem 1.35rem; } }
.ept-step__title {
  font-family: var(--_font-display); font-size: 1.15rem; line-height: 1.3; margin: 0;
  display: flex; align-items: center; gap: .6rem;
}
.ept-step__n {
  flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--_accent-soft); color: var(--_text); font-size: .9rem; font-weight: 700;
}
.ept-row { display: grid; gap: .9rem; }
@media (min-width: 480px) { .ept-row { grid-template-columns: 1fr 1fr; } }
.ept-field { display: grid; gap: .3rem; min-width: 0; align-content: start; }
.ept [data-modus], .ept [data-bron], .ept [data-contract-velden] { display: grid; gap: .9rem; }
.ept-field > label, .ept-choice legend { font-weight: 600; font-size: .9375rem; }
.ept-input {
  display: flex; align-items: stretch; border: 1.5px solid var(--_ctl); border-radius: var(--_radius-ctl);
  background: var(--_surface); overflow: hidden;
}
.ept-input:focus-within { outline: 3px solid var(--_accent); outline-offset: 1px; }
.ept-input input {
  flex: 1; min-width: 0; border: 0; padding: .6rem .7rem; font: inherit; color: inherit; background: transparent;
  font-variant-numeric: tabular-nums;
}
.ept-input input:focus { outline: none; }
.ept-input input[aria-invalid="true"] { background: var(--_bad-soft); }
.ept-affix {
  display: flex; align-items: center; padding: 0 .65rem; color: var(--_muted); background: var(--_surface-2);
  font-size: .9375rem; white-space: nowrap;
}
.ept select {
  font: inherit; color: inherit; padding: .6rem 2.2rem .6rem .7rem; border: 1.5px solid var(--_ctl); border-radius: var(--_radius-ctl);
  background-color: var(--_surface); width: 100%; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2313291f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6em center; background-size: 1em;
}
.ept select:focus-visible, .ept input[type="file"]:focus-visible, .ept input[type="checkbox"]:focus-visible,
.ept input[type="radio"]:focus-visible { outline: 3px solid var(--_accent); outline-offset: 2px; }
.ept input[type="file"] { font: inherit; max-width: 100%; }
.ept-hint { margin: 0; color: var(--_muted); font-size: .875rem; }
.ept-choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.ept-choice legend { padding: 0; margin-bottom: .45rem; }
.ept-choice__opts { display: grid; gap: .4rem; }
.ept-radio {
  display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1.5px solid var(--_border);
  border-radius: var(--_radius-ctl); cursor: pointer; background: var(--_surface);
}
.ept-radio:has(input:checked) { border-color: var(--_accent); background: var(--_accent-soft); }
.ept-radio:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.ept-radio input { margin-top: .25rem; accent-color: var(--_accent); }
.ept-check { grid-template-columns: auto 1fr; align-items: start; column-gap: .6rem; }
.ept-check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--_accent); }
.ept-check label { font-weight: 500; }
.ept-check .ept-hint { grid-column: 2; }
.ept-upload-status:empty { display: none; }

/* ---------- uitkomst */
.ept-result {
  background: var(--_surface); border: 1px solid var(--_border); border-radius: var(--_radius);
  padding: 1rem; min-width: 0; display: grid; gap: .9rem;
}
@media (min-width: 600px) { .ept-result { padding: 1.35rem 1.5rem; } }
.ept-result > * { margin: 0; }
.ept-hero { border-radius: calc(var(--_radius) - 4px); background: var(--_accent-soft); padding: 1rem 1.1rem; }
.ept-hero--niet { background: var(--_warn-soft); }
.ept-hero--kan { background: var(--_good-soft); }
.ept-hero__label { margin: 0; font-size: .9375rem; color: var(--_muted); }
.ept-hero__num {
  margin: .15rem 0 .3rem; font-family: var(--_font-display); font-weight: 700;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.15;
}
.ept-hero__sub { margin: 0; }
.ept-h { font-family: var(--_font-display); font-size: 1.1rem; margin: .5rem 0 0; }
.ept-small { font-size: .875rem; color: var(--_muted); }
.ept-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; }
.ept a { color: var(--_accent); text-underline-offset: 2px; }
.ept a:focus-visible { outline: 3px solid var(--_accent); outline-offset: 2px; border-radius: 2px; }

.ept-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0; }
@media (min-width: 700px) { .ept-facts--4 { grid-template-columns: repeat(4, 1fr); } }
.ept-facts > div { background: var(--_surface-2); border-radius: var(--_radius-ctl); padding: .65rem .8rem; }
.ept-facts dt { font-size: .875rem; color: var(--_muted); }
.ept-facts dd { margin: .1rem 0 0; font-weight: 700; font-size: 1.15rem; }
.ept--prijzen .ept-facts { margin-bottom: 1rem; }

.ept-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.ept-table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.ept-table caption { text-align: left; font-weight: 600; padding-bottom: .4rem; }
.ept-table th, .ept-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--_border); text-align: right; vertical-align: top; }
.ept-table td { white-space: nowrap; }
@media (max-width: 480px) {
  .ept-table { font-size: .875rem; }
  .ept-table th, .ept-table td { padding: .4rem .25rem; }
  .ept-table th:first-child { padding-left: 0; }
}
.ept-table th:first-child { text-align: left; font-weight: 500; }
.ept-table thead th { font-weight: 600; font-size: .875rem; color: var(--_muted); }
.ept-table tfoot th, .ept-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--_text); }
.ept-table tfoot tr + tr th, .ept-table tfoot tr + tr td { border-top: 0; font-weight: 500; }
.ept-table--compact td, .ept-table--compact th { padding: .4rem .45rem; }
.ept-table--compact td { white-space: normal; }
.ept-sub { display: block; color: var(--_muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.ept-table--compact .ept-tag { display: block; margin: .2rem 0 0 auto; max-width: 100%; white-space: normal; text-align: right; font-size: .875rem; }
.ept-table--compact th:first-child { min-width: 0; word-break: break-word; }
@media (max-width: 480px) { .ept-table--compact th, .ept-table--compact td { padding: .4rem .2rem; } }
@media (max-width: 480px) { .ept-col-extra { display: none; } }
.ept-tag {
  display: inline-block; font-size: .875rem; line-height: 1.2; padding: .1rem .4rem; border-radius: 6px;
  background: var(--_warn-soft); color: var(--_text); margin-left: .25rem; white-space: nowrap;
}

.ept-msg { border-radius: var(--_radius-ctl); padding: .7rem .85rem; background: var(--_surface-2); font-size: .9375rem; }
.ept-msg--waarschuwing { background: var(--_warn-soft); }
.ept-msg--fout { background: var(--_bad-soft); color: var(--_bad); }
.ept-msg--ok { background: var(--_good-soft); }

.ept-sources summary, .ept-tabel summary { cursor: pointer; font-weight: 600; font-size: .9375rem; padding: .25rem 0; }
.ept-sources summary:focus-visible, .ept-tabel summary:focus-visible { outline: 3px solid var(--_accent); outline-offset: 2px; }
.ept-sources ul { margin: .4rem 0 0; padding-left: 1.2rem; font-size: .875rem; display: grid; gap: .3rem; }

/* ---------- grafiek */
.ept-chart { margin: 0; position: relative; }
.ept-chart__titel { font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; }
.ept-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 0; margin: 0 0 .4rem; font-size: .875rem; color: var(--_muted); }
.ept-legend li { display: flex; align-items: center; gap: .4rem; }
.ept-swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; flex: none; }
.ept-chart__plot { width: 100%; overflow: hidden; }
.ept-chart__plot svg { display: block; max-width: 100%; height: auto; }
.ept-chart .ept-gridline { stroke: var(--_grid); stroke-width: 1; }
.ept-chart .ept-axis { stroke: var(--_axis); stroke-width: 1; }
.ept-chart .ept-tick { fill: var(--_muted); font-size: 12px; font-family: var(--_font); font-variant-numeric: tabular-nums; }
.ept-chart .ept-hit { fill: transparent; }
.ept-chart .ept-bargroup { cursor: default; outline: none; }
.ept-chart .ept-bargroup:hover .ept-hit, .ept-chart .ept-bargroup:focus .ept-hit { fill: var(--_surface-2); }
.ept-chart .ept-bargroup:focus-visible .ept-hit { stroke: var(--_accent); stroke-width: 2; }
.ept-tip {
  position: absolute; top: 2.2rem; transform: translateX(-50%); background: var(--_surface); color: var(--_text);
  border: 1px solid var(--_border); border-radius: 10px; padding: .45rem .65rem; font-size: .875rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12); pointer-events: none; display: grid; gap: .15rem; min-width: 150px; z-index: 2;
}
.ept-tip span { display: flex; align-items: center; gap: .4rem; }
.ept-tabel { margin-top: .4rem; }
.ept-tabel table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.ept-tabel th, .ept-tabel td { text-align: right; padding: .3rem .4rem; border-bottom: 1px solid var(--_border); }
.ept-tabel th:first-child { text-align: left; }

.ept-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .ept * { transition: none !important; animation: none !important; } }
@media print { .ept-form { display: none; } .ept-result { position: static; max-height: none; } }
