/* De Mattelier – public pages. House style from demattelier.nl: purple #815374, yellow #EEAA02,
   text #4A4A4A, light #F7FCFF. System fonts only: no external font or tracking requests. */
:root {
  --purple: #815374;
  --purple-dark: #6a4360;
  --yellow: #EEAA02;
  --text: #4A4A4A;
  --muted: #6f6f6f;
  --light: #F7FCFF;
  --line: #e3e7ea;
  --ok: #2e7d32;
  --warn: #b26a00;
  --error: #b3261e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); background: var(--light);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--purple); }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 880px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--purple); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--yellow); }
.env-tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; background: var(--yellow); color: #fff; padding: 2px 8px; }
main { max-width: 880px; margin: 0 auto; padding: 24px 16px 48px; }
h1, h2, h3 { color: var(--purple); line-height: 1.2; }
h1 { font-size: 1.8rem; margin: 0 0 8px; }
h2 { font-size: 1.3rem; margin: 28px 0 10px; }
.muted { color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); padding: 20px; margin: 0 0 16px; }
.event-list { display: grid; gap: 16px; }
.event-card { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.event-card h2 { margin: 0 0 4px; font-size: 1.2rem; }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--yellow); color: #fff; border: 0; padding: 12px 22px; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; min-height: 44px;
}
.btn:hover { background: var(--purple); }
.btn.secondary { background: var(--purple); }
.btn.secondary:hover { background: var(--purple-dark); }
.btn.ghost { background: transparent; color: var(--purple); border: 2px solid var(--purple); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form .field { margin: 0 0 14px; }
label { display: block; font-weight: 600; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number] {
  width: 100%; padding: 10px 12px; font: inherit; border: 1px solid #c9ced3; background: #fff; min-height: 44px;
}
input:focus, button:focus, a:focus { outline: 3px solid rgba(129, 83, 116, .35); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; width: 18px; height: 18px; }
.ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ticket-row input { text-align: center; }
.total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.15rem; padding: 14px 0 0; }
.errorlist { color: var(--error); margin: 4px 0 0; padding: 0; list-style: none; font-size: .95rem; }
.alert { padding: 12px 16px; margin: 0 0 16px; border-left: 4px solid var(--purple); background: #fff; }
.alert.error { border-color: var(--error); }
.alert.ok { border-color: var(--ok); }
.alert.warn { border-color: var(--warn); }
.code { font: 700 1.6rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--purple); }
.status { display: inline-block; padding: 2px 10px; font-weight: 700; font-size: .9rem; color: #fff; background: var(--muted); }
.status.paid, .status.reserved { background: var(--ok); }
.status.held { background: var(--warn); }
.status.cancelled, .status.expired { background: var(--error); }
table.lines { width: 100%; border-collapse: collapse; }
table.lines td { padding: 8px 0; border-bottom: 1px solid var(--line); }
table.lines td.num { text-align: right; white-space: nowrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.dev-note { border: 2px dashed var(--warn); background: #fff8e6; padding: 12px 16px; margin: 16px 0; }
.sso { display: grid; gap: 12px; max-width: 420px; }
.sso form { margin: 0; }
.sso .btn { width: 100%; }
pre.info { white-space: pre-wrap; font: inherit; margin: 0; }
footer.site-footer { max-width: 880px; margin: 0 auto; padding: 0 16px 32px; font-size: .9rem; color: var(--muted); }
@media (max-width: 560px) {
  h1 { font-size: 1.5rem; }
  .ticket-row .price { grid-column: 1; grid-row: 2; color: var(--muted); }
}

/* Notices: scarcity ribbon (corner) / tag, and "sales close soon" line */
.ribbon {
  /* fixed width, text centred: the visible middle of the band sits across the corner at every card width */
  position: absolute; top: 30px; right: -52px; width: 200px; transform: rotate(40deg); text-align: center;
  background: #c0392b; color: #fff; font-weight: 700; font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; padding: 6px 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); pointer-events: none;
}
.event-card h2 { padding-right: 84px; }
.event-card.has-ribbon { padding-right: 104px; min-height: 140px; }
@media (max-width: 560px) { .event-card.has-ribbon { padding-right: 20px; } }
.tag { display: inline-block; font-weight: 700; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: #c0392b; padding: 5px 9px; transform: rotate(-4deg); }
.closing { display: flex; gap: 8px; align-items: center; margin: 8px 0; padding: 6px 10px; font-size: .92rem;
  color: var(--purple-dark); background: rgba(238, 170, 2, .16); }
.closing svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; }

/* Header: env tag + gear (admin) */
.header-right { display: inline-flex; align-items: center; gap: 12px; }
.gear { display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--muted); }
.gear:hover { color: var(--purple); }
.gear svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Order stepper (schets A, square corners: house style) */
.stepper { display: inline-flex; align-items: stretch; height: 46px; background: var(--yellow); color: #fff; }
.stepper button { all: unset; cursor: pointer; display: grid; place-items: center; width: 46px; }
.stepper button:hover { background: rgba(0, 0, 0, .12); }
.stepper button:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.stepper svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.stepper .st-count { width: 34px; border: 0; background: transparent; color: #fff; text-align: center; font: 700 1.15rem/1 inherit;
  -moz-appearance: textfield; appearance: textfield; padding: 0; min-height: 0; font-variant-numeric: tabular-nums; }
.stepper .st-count::-webkit-outer-spin-button, .stepper .st-count::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .st-cart { border-left: 1px solid rgba(255, 255, 255, .45); width: 52px; }
/* closed (JS on, 0 chosen): only "+ cart" */
.stepper.js:not(.open) .st-minus, .stepper.js:not(.open) .st-count { display: none; }
.stepper:not(.js) { background: transparent; }
.stepper:not(.js) button { display: none; }
.stepper:not(.js) .st-count { width: 72px; color: var(--text); border: 1px solid #c9ced3; background: #fff; }
.buy { display: grid; gap: 10px; justify-items: end; margin-left: auto; }
/* label + price sit right next to the stepper; the whole group is right-aligned (feedback 2026-11-20) */
.buy-row { display: flex; align-items: center; justify-content: flex-end; gap: 14px; text-align: right; }
.buy-label { font-weight: 700; color: var(--purple); }
.ticket-row .qty { justify-self: end; }
@media (max-width: 560px) {
  .buy { width: 100%; }
  .ticket-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ticket-row .qty { grid-column: 2; grid-row: 1 / span 2; }
}

/* Maximum reached: the stepper flashes purple and the "Maximaal n tickets" note lights up */
.stepper { transition: background-color .15s; }
.stepper.limit { background: var(--purple); animation: nudge .3s; }
.max-note { transition: color .15s, font-weight .15s; }
.max-note.limit { color: var(--purple); font-weight: 700; }
@keyframes nudge { 25% { transform: translateX(3px); } 75% { transform: translateX(-3px); } }
@media (prefers-reduced-motion: reduce) { .stepper.limit { animation: none; } }
.buy .max-note { margin: 0; font-size: .9rem; text-align: right; }

/* Field hints and validation */
.field-help { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.live-hint { margin: 4px 0 0; font-size: .92rem; color: var(--error); }
input.invalid { border-color: var(--error); }
.gegevens-kort { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.gegevens-kort p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.btn.klein { padding: 8px 14px; font-size: .95rem; flex-shrink: 0; }
.klein-tekst { font-size: .9rem; margin: 8px 0 0; }
.link-btn { all: unset; cursor: pointer; color: var(--purple); font-weight: 700; text-decoration: underline; }
.link-btn:focus-visible { outline: 3px solid rgba(129, 83, 116, .35); }

/* QR codes per ticket on the booking page */
.qr-lijst { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.qr-kaart { margin: 0; padding: 16px; background: #fff; border: 1px solid var(--line); text-align: center; }
.qr-kaart .qr svg { width: 100%; height: auto; max-width: 260px; display: block; margin: 0 auto; }
.qr-kaart figcaption { margin-top: 8px; }

/* Mijn tickets + ticket actions */
.mijn-link { font-weight: 700; color: var(--purple); text-decoration: none; }
.mijn-link:hover { color: var(--yellow); }
.mijn-kop { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.mijn-oud { padding-left: 18px; }
.tickets-kop { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ticket-acties { display: flex; gap: 8px; flex-wrap: wrap; }
.ticket-acties .btn { min-height: 40px; padding: 8px 16px; }

/* Print: only the tickets (QR codes), one per half page */
@media print {
  .site-header, .site-footer, .alert, .dev-note, .ticket-acties, .no-print, main > section:not(.tickets-blok), main > p, main > h1 + p { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
  .qr-lijst { display: block; }
  .qr-kaart { page-break-inside: avoid; break-inside: avoid; border: 1px dashed #bbb; margin: 0 0 12mm; padding: 8mm; }
  .qr-kaart .qr svg { max-width: 70mm; }
}

/* Header stays on one line on phones */
.brand, .mijn-link { white-space: nowrap; }
.mijn-acties { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 480px) {
  .site-header .inner { gap: 8px; padding: 12px 14px; }
  .brand { font-size: 1.05rem; }
  .mijn-link { font-size: .9rem; }
  .header-right { gap: 8px; }
  .mijn-acties { justify-content: flex-start; width: 100%; }
}

/* Login: e-mail / telefoon switch */
.login-keuze { display: inline-flex; border: 2px solid var(--purple); margin: 0 0 16px; }
.login-keuze a { padding: 8px 18px; font-weight: 700; color: var(--purple); text-decoration: none; }
.login-keuze a.aan { background: var(--purple); color: #fff; }

/* seated / standing */
.ticket-row .soort { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--purple); border: 1.5px solid currentColor; padding: 0 6px; margin-left: 4px; vertical-align: 2px; }
.ticket-row .laatste { display: block; font-size: .8rem; font-weight: 700; color: #c0392b; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.qty.uitverkocht { font-weight: 700; color: var(--muted, #6b6b6b); white-space: nowrap; }
.btn.terug { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn.terug svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; }
.btn.ghost:hover { background: var(--purple); color: #fff; }

/* group QR: all tickets of the booking at once */
.qr-kaart.groep { border: 3px solid var(--purple); max-width: 360px; margin: 0 auto 8px; }
.qr-kaart.groep .qr svg { max-width: 300px; }
.los-kop { margin: 22px 0 4px; font-size: 1.05rem; }
