/* Thema v2: modern, licht en rustig. Gebroken wit papier, het rosé van het kaartje als enige accent,
   Nunito voor alle tekst en een scriptletter alleen voor de titel. Geen goud. */

@font-face { font-family: "Ambar"; src: url("/fonts/ambar.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Parisienne"; src: url("/fonts/parisienne-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/nunito-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/nunito-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/nunito-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/nunito-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #FFFBFE;
  --surface: #FFFFFF;
  --ink: #3D3437;
  --muted: #6E6265;
  --line: #EFE3E4;
  --rose: #BF9B9C;
  --rose-ink: #8A6466;
  --rose-soft: #F6ECEC;
  --ok: #2E7D5B;
  --ok-soft: #DCEFE5;
  --display: "Ambar", "Parisienne", cursive;
  --sans: "Nunito", system-ui, sans-serif;
  --rose-ink-hover: #75545A;
  --shadow-sm: 0 1px 2px rgba(61, 52, 55, .05), 0 4px 16px rgba(138, 100, 102, .08);
  --shadow: 0 2px 6px rgba(61, 52, 55, .06), 0 16px 40px rgba(138, 100, 102, .16);
  --radius: 18px;
  --maxw: 1160px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; font-weight: 400; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
p { margin: 0; }
a { color: var(--rose-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--rose-ink); outline-offset: 2px; }
main:focus { outline: none; }
.muted { color: var(--muted); }
.small-text { font-size: 15px; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 400; color: var(--rose); font-size: clamp(52px, 9vw, 96px); line-height: 1.05; }
h2 { font-weight: 800; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; }

.wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.view { padding-block: 8px 96px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 10px 16px; border-radius: 999px; font-weight: 700; }
.skip:focus { left: 16px; }

/* Gedeeld met het beheer: prijs, labels, voortgangsbalk, lege plaatshouders. */
.pic.blank, .thumb.blank { display: flex; align-items: center; justify-content: center; background: var(--rose-soft); color: var(--rose); font-family: var(--sans); font-weight: 800; line-height: 1; }
.note { color: var(--muted); font-size: 14px; }
.price { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.bar { height: 6px; border-radius: 999px; background: var(--rose-soft); overflow: hidden; margin: 4px 0 2px; }
.bar > span { display: block; height: 100%; width: 0; background: var(--rose); border-radius: 999px; }
.tag {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 12px; border-radius: 999px; max-width: 100%;
  font-size: 13px; font-weight: 800; line-height: 1.25; background: var(--rose-soft); color: var(--rose-ink); overflow-wrap: anywhere;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.empty, .emptystate p { color: var(--muted); }
.empty { padding: 24px 0; }

/* Knoppen */
.btn {
  font: inherit; font-weight: 700; font-size: 16px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  border: 1px solid var(--rose-ink); background: var(--rose-ink); color: #FFFFFF;
  cursor: pointer; white-space: nowrap; touch-action: manipulation; user-select: none;
}
.btn.ghost { background: var(--surface); color: var(--rose-ink); border-color: var(--line); }
.btn.small { min-height: 44px; font-size: 14px; padding: 0 14px; }
.btn:disabled { opacity: .45; cursor: default; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
@media (hover: hover) {
  .btn:not(:disabled):hover { background: var(--rose-ink-hover); border-color: var(--rose-ink-hover); }
  .btn.ghost:not(:disabled):hover { background: var(--rose-soft); color: var(--rose-ink); border-color: var(--rose); }
}

/* Dialoog en formulieren */
dialog#dlg {
  border: 0; border-radius: 24px; padding: 0; background: var(--surface); color: var(--ink);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow);
}
dialog#dlg::backdrop { background: rgba(61, 52, 55, .4); }
.dlg { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 15px; }
.fieldgroup { display: flex; flex-direction: column; gap: 6px; }
.hint { font-size: 14px; color: var(--muted); }
input, textarea {
  font: inherit; font-weight: 400; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-height: 48px; width: 100%;
}
input:focus, textarea:focus { border-color: var(--rose-ink); outline: none; box-shadow: 0 0 0 3px var(--rose-soft); }
textarea { resize: vertical; min-height: 96px; }
.dimg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-weight: 700; font-size: 15px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  font-variant-numeric: tabular-nums lining-nums; touch-action: manipulation;
}
.chip[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-soft); color: var(--rose-ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.err { color: var(--rose-ink); font-size: 15px; font-weight: 700; background: var(--rose-soft); border-radius: 12px; padding: 10px 14px; }
.note-box { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 12px 16px; font-size: 16px; font-weight: 600; }

/* Wiegje */
.cartlines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cartlines li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface); }
.thumb.blank { font-size: 30px; }
.cartlines .what { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.cartlines .title { font-weight: 700; }
.cartlines .btns { display: flex; gap: 6px; margin-left: auto; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; font-weight: 700; }
.total b { font-size: 22px; font-weight: 800; }

/* Betaalscherm */
.paywrap { max-width: 720px; padding-top: 32px; }
.paycard { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm); padding: clamp(20px, 5vw, 36px); display: flex; flex-direction: column; gap: 18px; }
.slip { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.qr { flex: 0 0 180px; max-width: 100%; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
.fields { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 2px; }
.field > span { font-size: 14px; color: var(--muted); }
.field .val { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field b { font-weight: 700; font-variant-numeric: tabular-nums lining-nums; font-size: 19px; overflow-wrap: anywhere; user-select: all; }
.field.amount b { color: var(--rose-ink); font-size: 26px; font-weight: 800; }
.keep { border-left: 3px solid var(--rose); padding-left: 12px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: #FFFFFF; box-shadow: var(--shadow);
  padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
  width: max-content; max-width: calc(100vw - 32px); z-index: 40; text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .bar > span { transition: width .6s ease; }
  .btn { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
  .toast:not([hidden]) { animation: rise .2s ease-out; }
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
