:root {
  --ink: #141816;
  --stone: #5e6963;
  --mist: #eef2ef;
  --snow: #ffffff;
  --line: #dfe6e1;
  --pine: #143d34;
  --pine-ink: #0c2822;
  --foam: #e5f0ea;
  --moss: #2a6a50;
  --clay: #c4492c;
  --ok: #1d6b48;
  --radius: 0px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --schaduw: 0 18px 50px rgba(20, 24, 22, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
::selection { background: #d5e6dc; color: var(--ink); }

body {
  margin: 0;
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--mist);
  line-height: 1.5;
  letter-spacing: -0.011em;
}

h1, h2, h3 {
  font-family: Syne, Outfit, sans-serif;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 0 0 0.5rem;
  line-height: 1.05;
}
h2 { font-size: 1.55rem; }
h3 { font-size: 1.05rem; margin-top: 1.25rem; letter-spacing: -0.03em; }
p { margin: 0 0 0.5rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

@keyframes binnenkomst {
  from { opacity: 0; transform: translateY(18px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes pop {
  from { transform: scale(1.28); }
  to { transform: scale(1); }
}

.hero .eyebrow,
.hero h1,
.hero .teller,
.hero .hero-link,
main.wrap > .kaart,
#beheer > .kaart,
footer {
  animation: binnenkomst 0.9s var(--ease) both;
}
.hero h1 { animation-delay: 0.08s; }
.hero .teller,
.hero .hero-link { animation-delay: 0.18s; }
main.wrap > .kaart:nth-child(1),
#beheer > .kaart:nth-child(1) { animation-delay: 0.22s; }
main.wrap > .kaart:nth-child(2) { animation-delay: 0.32s; }
#beheer > .kaart:nth-child(2) { animation-delay: 0.3s; }
#beheer > .kaart:nth-child(3) { animation-delay: 0.38s; }
#beheer > .kaart:nth-child(4) { animation-delay: 0.46s; }
#beheer > .kaart:nth-child(5) { animation-delay: 0.54s; }
footer { animation-delay: 0.42s; }

#stap-2.binnen .wijn { animation: binnenkomst 0.7s var(--ease) both; }
#stap-2.binnen .wijn:nth-child(2) { animation-delay: 0.06s; }
#stap-2.binnen .wijn:nth-child(3) { animation-delay: 0.12s; }
#stap-2.binnen .wijn:nth-child(4) { animation-delay: 0.18s; }
#stap-2.binnen .wijn:nth-child(5) { animation-delay: 0.24s; }
#zakelijk-velden:not([hidden]),
#b-zakelijk:not([hidden]),
.suggesties:not([hidden]) { animation: binnenkomst 0.4s var(--ease) both; }
output.pop { display: inline-block; animation: pop 0.35s var(--ease); }

/* Hero */
.hero {
  color: var(--ink);
  padding: 72px 0 28px;
  text-align: left;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--stone);
  margin: 0 0 0.85rem;
}
.club-logo { width: 28px; height: 28px; flex-shrink: 0; }
.hero h1 { font-size: clamp(3rem, 8vw, 5.4rem); max-width: 12ch; }
.teller { margin-top: 2.2rem; max-width: 420px; font-size: 1rem; }
.teller strong {
  display: block;
  font-family: Syne, Outfit, sans-serif;
  font-size: clamp(4.2rem, 12vw, 6.6rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 0.85;
  color: var(--ink);
}
.teller-label {
  display: block;
  margin-top: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--stone);
}
.progress {
  height: 2px;
  background: var(--line);
  max-width: 280px;
  margin: 1rem 0 0.55rem;
  overflow: hidden;
}
.progress div {
  height: 100%;
  width: 0;
  background: var(--pine);
  transition: width 1.15s var(--ease);
}
.teller small { color: var(--stone); letter-spacing: 0; }

/* Gesprek */
main.wrap { padding: 12px 24px 8px; }
.gesprek { display: flex; flex-direction: column; gap: 14px; }
.beurt {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: binnenkomst 0.6s var(--ease) both;
}
.gesprek > .beurt:nth-child(2) { animation-delay: 0.12s; }
.beurt:not(.wijnbeurt) { max-width: 640px; }
.beurt.ik { justify-content: flex-end; }
.beurt[hidden] { display: none; }
.avatar { width: 28px; height: 28px; flex-shrink: 0; }
.bubbel {
  margin: 0;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 4px;
  padding: 14px 16px;
  max-width: min(100%, 520px);
}
.beurt.ik .bubbel { border-radius: 18px 18px 4px 18px; }
.bubbel.breed { max-width: none; flex: 1; border-radius: 18px; }
.wijnbeurt { align-items: flex-start; }
.vraag { margin: 0 0 0.9rem; font-weight: 500; }
#bestelformulier { display: flex; flex-direction: column; gap: 14px; }
#wie:not(.gekozen) .bubbel,
#wie.wijzig .bubbel,
#stap-1 .bubbel { width: min(100%, 380px); }
#wie .bubbel { padding: 4px; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
#wie.gekozen:not(.wijzig) .bubbel { padding: 12px 16px; }
#wie:focus-within .bubbel { border-color: var(--pine); box-shadow: 0 0 0 4px rgba(20, 61, 52, 0.1); }
.visueel-verborgen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#bestelling { display: flex; flex-direction: column; gap: 14px; }
#bestelling[hidden] { display: none; }
#stap-2.binnen { animation: binnenkomst 0.55s var(--ease) both; }
#stap-1 { display: flex; flex-direction: column; gap: 14px; }
#stap-1 .beurt:nth-child(2) { animation-delay: 0.08s; }
#stap-1 .beurt:nth-child(3) { animation-delay: 0.16s; }
.bubbel > label:first-child { margin-top: 0; }
.bubbel .letop {
  display: block;
  margin-top: 0.2rem;
  color: var(--stone);
  font-size: 0.84rem;
  font-weight: 400;
  white-space: normal;
}
.ja-nee { display: flex; gap: 8px; }
.ja-nee button {
  flex: 1;
  min-width: 88px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--snow);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.ja-nee button[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: #f4faf7;
}
.ja-nee button:active { transform: scale(0.98); }
#antwoord-factuur .form-footer { margin-top: 1rem; }
#antwoord-factuur .form-footer .primair { width: 100%; }

/* Kaarten */
.kaart {
  background: var(--snow);
  border: 1px solid var(--line);
  padding: 28px 28px 24px;
  margin-bottom: 16px;
}
details.kaart summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.kaart summary::-webkit-details-marker { display: none; }
details.kaart summary h2 { margin: 0; }
details.kaart summary::after { content: '▸'; color: var(--stone); font-size: 1.2rem; transition: transform 0.35s var(--ease); }
details.kaart[open] summary::after { transform: rotate(90deg); }

/* Formulier */
label { display: block; font-weight: 500; margin: 1rem 0 0.4rem; font-size: 0.92rem; }
label[hidden] { display: none; }
input:not([type=radio]):not([type=checkbox]),
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: inherit;
  background: var(--snow);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 4px rgba(20, 61, 52, 0.1);
}
input.fout { border-color: var(--clay); }
#wie { position: relative; z-index: 2; }
#wie label { margin-top: 0; }
#wie input { font-size: 1.05rem; border: 0; background: transparent; box-shadow: none; }
#wie input:focus { border-color: transparent; box-shadow: none; }
.groet {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
}
.groet-naam {
  font: inherit;
  color: var(--pine);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: border-color 0.3s var(--ease);
}
#wie.gekozen:not(.wijzig) .groet-naam::after { content: ''; position: absolute; inset: -14px -10px; }
.groet-naam:hover,
#wie.wijzig .groet-naam { border-bottom-color: currentColor; }
#wie.gekozen #wie-label,
#wie.gekozen:not(.wijzig) #wie-veld { display: none; }
#wie.gekozen.wijzig #wie-veld { display: block; margin-top: 0.55rem; padding-top: 0.35rem; border-top: 1px solid var(--line); animation: binnenkomst 0.35s var(--ease); }
.autocomplete { position: relative; }
.suggesties {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--snow); border: 1px solid var(--line); box-shadow: var(--schaduw);
  z-index: 3; max-height: 260px; overflow-y: auto;
}
.suggesties li { padding: 11px 12px; cursor: pointer; transition: background 0.2s; }
.suggesties li:hover, .suggesties li.actief { background: var(--mist); }
.suggesties li.leeg { color: var(--stone); font-style: italic; cursor: default; }

.wijnen { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 0.25rem; }
@media (min-width: 900px) {
  .wijnen { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.wijn {
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--snow);
  transition: transform 0.5s var(--ease), border-color 0.35s, box-shadow 0.5s var(--ease);
}
.wijn:hover { transform: translateY(-6px); border-color: #c5d0c9; box-shadow: var(--schaduw); }
.wijn.actief { border-color: var(--pine); box-shadow: 0 0 0 1px var(--pine); }
.wijn img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  padding: 18px;
  background: var(--mist);
  display: block;
  transition: transform 0.7s var(--ease);
}
.wijn:hover img { transform: scale(1.045); }
.wijn-info { padding: 14px 14px 12px; flex: 1; display: flex; flex-direction: column; }
.soort { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--stone); font-weight: 500; }
.wijn h3 { font-size: 1.02rem; margin: 0.35rem 0 0.35rem; }
.wijn p { margin: 0; font-size: 0.86rem; color: var(--stone); line-height: 1.45; }
.prijs { margin-top: auto; padding-top: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.prijs small { display: block; font-weight: 400; color: var(--stone); font-size: 0.75rem; }
.stepper { display: flex; align-items: center; border-top: 1px solid var(--line); }
.stepper button {
  flex: 1;
  height: 48px;
  border: 0;
  background: transparent;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--pine);
  transition: background 0.25s, transform 0.2s var(--ease);
}
.stepper button:hover { background: var(--foam); }
.stepper button:active { transform: scale(0.9); }
.stepper output { min-width: 44px; text-align: center; font-weight: 600; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.wijn.actief .stepper { background: var(--foam); }

label.factuur { margin: 1.15rem 0 0; align-items: flex-start; line-height: 1.4; }
label.factuur input { margin-top: 0.15rem; flex-shrink: 0; }
label.factuur .letop { white-space: nowrap; }
#zakelijk-velden, #b-zakelijk { background: var(--mist); padding: 4px 16px 16px; margin-top: 0.9rem; }

.stappen { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0 0 1.1rem; font-size: 0.88rem; color: var(--stone); }
.stappen li { display: flex; align-items: center; gap: 10px; }
.stappen li span {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 600;
  transition: background 0.35s var(--ease), color 0.35s, border-color 0.35s;
}
.stappen li.actief { color: var(--ink); font-weight: 600; }
.stappen li.actief span { background: var(--pine); border-color: var(--pine); color: #f4faf7; }
.stappen li.klaar { cursor: pointer; }
.stappen li.klaar span { background: var(--moss); border-color: var(--moss); color: #f4faf7; }
.form-footer { display: flex; align-items: center; gap: 14px; margin-top: 1.5rem; flex-wrap: wrap; }
.form-totaal { margin-left: auto; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

button.primair,
button.secundair,
button.klein {
  font: inherit;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s, border-color 0.3s, color 0.3s;
}
button.primair {
  background: var(--pine);
  color: #f4faf7;
  border: 0;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
button.primair:hover { background: var(--pine-ink); transform: translateY(-1px); }
button.primair:active { transform: translateY(0) scale(0.98); }
button.secundair {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 500;
}
button.secundair:hover { border-color: var(--ink); }
button.klein { padding: 7px 12px; font-size: 0.82rem; border: 1px solid var(--line); background: var(--snow); }
button.klein:hover { border-color: var(--ink); }
button.gevaar { color: var(--clay); }
button.gevaar:hover { border-color: var(--clay); }
button:disabled { opacity: 0.55; cursor: wait; transform: none; }

/* Lijsten */
.lijst { list-style: none; padding: 0; margin: 0; }
.lijst li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  transition: background 0.25s;
}
.lijst li:first-child { border-top: 0; }
.lijst.compact li { padding: 10px 0; }
.regel-info { min-width: 0; }
.regels { font-size: 0.9rem; }
.sub { color: var(--stone); font-size: 0.85rem; }
.tag {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--mist);
  color: var(--stone);
  margin-left: 6px;
  vertical-align: middle;
}
.ok { color: var(--ok); }
.tag.ok { background: var(--foam); color: var(--moss); }
.acties { display: flex; gap: 6px; flex-shrink: 0; }
.leeg { color: var(--stone); font-style: italic; }
label.check { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 400; }
label.check input { width: 18px; height: 18px; accent-color: var(--pine); }

/* Overzicht */
.twee { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 640px) { .twee { grid-template-columns: 1fr; } }
.twee h3 { margin-top: 0; }
.tabel { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.tabel th, .tabel td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.tabel th { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--stone); font-weight: 500; }
.tabel td:not(:first-child), .tabel th:not(:first-child) { text-align: right; }
.tabel tr.totaal td { border-bottom: 0; font-weight: 600; }
.ranglijst { list-style: none; padding: 0; margin: 0; counter-reset: plek; }
.ranglijst li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: plek;
}
.ranglijst li::before {
  content: counter(plek);
  width: 28px; height: 28px;
  background: var(--mist);
  color: var(--pine);
  font-weight: 600;
  font-size: 0.78rem;
  font-family: Syne, Outfit, sans-serif;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ranglijst li:first-child::before { background: var(--pine); color: #f4faf7; }
.ranglijst li span { flex: 1; }
.ranglijst li strong { font-family: Syne, Outfit, sans-serif; font-variant-numeric: tabular-nums; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 1rem 0 1.25rem; }
.kpis div {
  background: var(--mist);
  padding: 16px 16px 14px;
  transition: transform 0.45s var(--ease);
}
.kpis div:hover { transform: translateY(-3px); }
.kpis small { display: block; color: var(--stone); font-size: 0.75rem; line-height: 1.35; letter-spacing: 0; }
.kpis strong { font-family: Syne, Outfit, sans-serif; font-size: 1.55rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
#export { margin-top: 1.25rem; }

footer { color: var(--stone); font-size: 0.82rem; letter-spacing: 0.04em; padding-top: 4px; padding-bottom: 28px; }
footer a { color: inherit; }

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  transform: translateY(12px);
  background: var(--ink);
  color: #f4faf7;
  padding: 14px 18px;
  opacity: 0;
  transition: opacity 0.4s var(--ease), transform 0.45s var(--ease);
  pointer-events: none;
  max-width: min(420px, calc(100vw - 48px));
  font-size: 0.92rem;
  z-index: 10;
}
.toast.zichtbaar { opacity: 1; transform: translateY(0); }
.toast.fout { background: var(--clay); }

/* Mobiel: gesprek over de volle breedte, wijnkaarten als compacte rijen */
@media (max-width: 640px) {
  .hero { padding: 28px 0 4px; }
  .hero h1 { font-size: clamp(2.4rem, 11vw, 3.2rem); }
  .kaart { padding: 20px 16px; }
  .wrap, main.wrap, footer {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  main.wrap { padding-top: 4px; }
  .gesprek { gap: 12px; }
  .beurt, .bubbel, .wijnen, .wijn { min-width: 0; }
  .beurt:not(.wijnbeurt) { max-width: none; }
  .beurt.ik { padding-left: 32px; }
  #wie:not(.gekozen) .bubbel,
  #wie.wijzig .bubbel,
  #stap-1 .bubbel { width: 100%; }
  .wijnbeurt { flex-direction: column; align-items: flex-start; gap: 8px; }
  .wijnbeurt .avatar { width: 22px; height: 22px; }
  .bubbel.breed { width: 100%; padding: 14px 12px 12px; }
  .gesprek .form-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .gesprek .form-footer .primair { width: 100%; }
  .gesprek .form-totaal { margin-left: 0; text-align: left; }
  #zakelijk-velden { padding-left: 12px; padding-right: 12px; }
  input, select, textarea, #wie input { font-size: 16px; }
  .suggesties { max-height: min(260px, 42vh); }

  .wijnen { grid-template-columns: 1fr; gap: 10px; }
  .wijn { display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto; }
  .wijn:hover { transform: none; }
  .wijn img { grid-row: 1 / 3; aspect-ratio: auto; height: 100%; min-height: 96px; padding: 8px; }
  .wijn:hover img { transform: none; }
  .wijn-info { padding: 12px 12px 4px; }
  .wijn h3 { overflow-wrap: anywhere; }
  .wijn p { display: none; }
  .prijs { margin-top: 0.35rem; }
  .prijs small { display: block; margin-left: 0; }
  .stepper { border-top: 0; justify-content: flex-end; gap: 4px; padding: 0 8px 8px; }
  .stepper button { flex: 0 0 44px; height: 44px; border: 1px solid var(--line); }
  .stepper output { min-width: 32px; }
}

/* Beheerpagina */
.hero.klein { padding: 48px 0 8px; }
.hero.klein h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.hero-link { margin: 0.75rem 0 0; font-size: 0.88rem; }
.hero-link a { color: var(--pine); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.hero-link a:hover { border-bottom-color: var(--pine); }
.center { text-align: center; }
#login input { max-width: 220px; font-size: 1.35rem; letter-spacing: 0.28em; text-align: center; }
#per-lid { overflow-x: auto; }

dialog {
  border: 1px solid var(--line);
  padding: 28px;
  width: calc(100% - 32px);
  max-width: 520px;
  box-shadow: var(--schaduw);
  color: var(--ink);
  background: var(--snow);
}
dialog[open] { animation: binnenkomst 0.45s var(--ease); }
dialog::backdrop { background: rgba(16, 22, 19, 0.38); backdrop-filter: blur(8px); }
dialog h2 { margin-bottom: 0; }
.aantallen { display: grid; grid-template-columns: 1fr 90px; gap: 8px 12px; align-items: center; }
.aantallen label { margin: 0; font-weight: 400; }
.aantallen label small { color: var(--stone); }
.aantallen input { text-align: center; }
#filter { margin-bottom: 0.75rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
