/* HADA Tickets, richting B "Avond" (spec S8.1).
   Eén donker thema. Het pand draagt de kleur; de interface blijft wit, grijs en zwart.
   Eén opvallend moment: de warme gloed achter het pand en de pass die na betalen opkomt. */

[hidden] { display: none !important; }

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/Inter-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/Inter-Bold.woff2") format("woff2");
}

:root {
  --bg: #000000;
  --text: #f5f5f7;
  --text-2: #98989d;
  --card: #1c1c1e;
  --field: #2c2c2e;
  --field-line: #7c7c80;
  --line: #2c2c2e;
  --ghost-line: #48484a;
  --button: #f5f5f7;
  --button-text: #000000;
  --ok: #30d158;
  --error: #ff453a;
  --wait: #ffd60a;
  --glow: rgba(255, 196, 120, 0.28);
  --glow-soft: rgba(255, 160, 90, 0.08);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
  --title: 2.125rem;   /* 34 px */
  --body: 1.0625rem;   /* 17 px */
  --small: 0.9375rem;  /* 15 px */
  --tiny: 0.8125rem;   /* 13 px */

  --radius-card: 24px;
  --radius-field: 14px;
  --tap: 50px;
  --gutter: max(20px, env(safe-area-inset-left));
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: dark;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, p, dl, dd, figure { margin: 0; }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

/* Eén kolom, mobile-first. De kaart met de actie zakt naar de duimzone. */
.screen {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(28px, env(safe-area-inset-top))
    var(--gutter)
    max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 640px) {
  .screen {
    min-height: min(100svh, 900px);
    padding-top: 56px;
    padding-bottom: 56px;
  }
}

/* Podium: het pand met warm licht erachter, alsof de ramen aan zijn. */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 8px 0 4px;
  background: radial-gradient(58% 55% at 50% 52%, var(--glow), var(--glow-soft) 55%, transparent 75%);
}

/* Vuurwerk (spec 8.3): precies zo groot als de stage, dus nooit horizontaal scrollen.
   Een canvas rekt niet op met alleen inset; daarom ook width en height. */
.fireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Logo: pand met de naam op een boog erboven. */
.logo {
  position: relative;
  display: block;
  width: min(84vw, 300px);
  height: auto;
  overflow: visible;
}

.logo-text { font-family: var(--font); }

.logo image { filter: drop-shadow(0 0 22px rgba(255, 190, 120, 0.25)); }

/* Pauzeknop voor het vuurwerk (WCAG 2.2.2): klein en gedimd rechtsonder bij het pand.
   Tikgebied 44 px, zichtbaar rondje 22 px, icoon 11 px. */
.fw-toggle {
  position: absolute;
  right: -8px;
  bottom: -4px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text);
  opacity: 0.55;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease;
}

.fw-toggle[hidden] { display: none; }

.fw-toggle::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: rgba(28, 28, 30, 0.6);
}

.fw-toggle svg {
  position: relative;
  width: 11px;
  height: 11px;
}

.fw-toggle .i-pause {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.fw-toggle .i-play { fill: currentColor; }

/* Het icoon toont de actie: pauze tijdens het vuurwerk, afspelen als het stilstaat. */
.fw-toggle .i-play,
.fw-toggle[aria-pressed="true"] .i-pause { display: none; }
.fw-toggle[aria-pressed="true"] .i-play { display: block; }

/* Alleen bij echte muis-hover oplichten; na een tik op een touchscreen blijft hij gedimd. */
@media (hover: hover) {
  .fw-toggle:hover { opacity: 1; }
}

.fw-toggle:focus-visible {
  opacity: 1;
  outline-offset: -6px;
}

/* Kop */
.intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kicker {
  font-size: var(--small);
  font-weight: 600;
  color: var(--text-2);
}

h1 {
  font-size: var(--title);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1:focus { outline: none; }

.meta {
  margin-top: 6px;
  font-size: var(--small);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 34em;
}

/* Eventregels op de startpagina: icoon plus tekst per rij (spec 8.3).
   Alleen op ul.meta; de gewone p.meta blijft zoals hij is. */
ul.meta {
  list-style: none;
  margin-bottom: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

ul.meta li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
}

.meta-icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Zonder icoon, maar uitgelijnd met de tekst erboven (18 px icoon + 10 px gat). */
ul.meta .meta-plain { padding-left: 28px; }

ul.meta a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 4px;
}

ul.meta a:hover { color: var(--text); }

/* Alleen voor schermlezers. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Kaart met de actie */
.card {
  margin-top: auto;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card form { display: contents; }

/* Zonder podium (Ticket voor iemand anders) staat het veld direct onder de kop,
   zodat het schermtoetsenbord het niet afdekt. */
.screen-top .card { margin-top: 8px; }

.foot {
  font-size: var(--tiny);
  line-height: 1.4;
  color: var(--text-2);
  text-align: center;
  text-wrap: balance;
}

.closed-text {
  font-size: var(--small);
  line-height: 1.5;
  color: var(--text-2);
}

.closed-text strong {
  display: block;
  margin-bottom: 4px;
  font-size: var(--body);
  color: var(--text);
}

/* Veld */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  padding: 0 4px;
  font-size: var(--small);
  font-weight: 600;
  color: var(--text-2);
}

.field input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-field);
  background: var(--field);
  color: var(--text);
  caret-color: var(--text);
  font: inherit;
  font-size: var(--body);
  letter-spacing: -0.015em;
  transition: border-color 0.15s ease;
}

.field input:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-color: var(--text);
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 100px var(--field) inset;
  caret-color: var(--text);
}

.field.has-error input {
  border: 2px solid var(--error);
  padding: 11px 13px;
}

.field-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 0 4px;
  font-size: var(--small);
  line-height: 1.4;
  color: var(--error);
}

/* Uitroepteken in een rondje, zonder extra markup of iconfont. */
.field-error::before,
.notice::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background:
    linear-gradient(var(--card), var(--card)) 50% 30% / 2px 6px no-repeat,
    linear-gradient(var(--card), var(--card)) 50% 76% / 2px 2px no-repeat,
    currentColor;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-field);
  background: rgba(255, 69, 58, 0.14);
  color: var(--text);
  font-size: var(--small);
  line-height: 1.4;
}

.notice::before { color: var(--error); }

/* Een melding buiten een kaart (Jouw tickets na sluiting) is informatief, geen fout. */
.screen > .notice {
  background: var(--card);
}

.screen > .notice::before { color: var(--wait); }

/* Knoppen */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-size: var(--body);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--ease), background-color 0.15s ease, opacity 0.15s ease;
}

.button:hover { background: #ffffff; }
.button:active { transform: scale(0.98); }

.button.ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--ghost-line);
}

.button.ghost:hover { background: rgba(255, 255, 255, 0.06); }

.button:disabled,
.button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.7;
  transform: none;
}

.button .icon,
.tick .icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Zichtbare focus op alles wat interactief is, ook op de witte knop (S8.1). */
a:focus-visible,
button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.back {
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: var(--small);
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border-radius: 10px;
}

.back:hover { color: var(--text); }

/* Spinner (status "Wachten op je betaling" en knop "Ticket aanmaken…") */
.spinner,
.status.is-waiting::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #3a3a3c;
  border-top-color: var(--text);
  animation: spin 0.9s linear infinite;
}

.button .spinner {
  border-color: rgba(0, 0, 0, 0.18);
  border-top-color: var(--button-text);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Statusregel: leeg neemt geen ruimte in, maar blijft in de toegankelijkheidsboom
   (display: none zou aria-live onbetrouwbaar maken). */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: var(--small);
  font-weight: 600;
  text-align: center;
}

.status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.status.is-waiting { padding: 6px 0; }

.status.is-stopped {
  color: var(--text-2);
  font-weight: 400;
}

.flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Ticketlink: zonder JavaScript (of zonder klembord) als selecteerbare tekst. */
.ticket-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-field);
  background: var(--field);
  font-size: var(--tiny);
  color: var(--text-2);
}

.ticket-link-url {
  color: var(--text);
  font-size: var(--small);
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}

html:not(.js) [data-action="copy"],
.js .ticket-link:not(.is-shown) { display: none; }

/* Betaald */
.done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding-top: 8px;
}

.done .meta { margin-top: 2px; }

.tick {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--text);
  color: var(--button-text);
}

.tick .icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.6;
}

.actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.save-fallback {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.save-fallback img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 0 0 1px var(--line);
  -webkit-touch-callout: default;
}

.save-fallback figcaption {
  font-size: var(--small);
  color: var(--text-2);
  text-align: center;
}

/* Pass: zelfde opbouw als de PNG uit passimage.py */
.pass {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1c1c1e, #121214);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -20px rgba(255, 170, 90, 0.28);
}

.pass-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--tiny);
  font-weight: 600;
  color: var(--text-2);
}

.pass-guest {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.pass-guest img {
  width: auto;
  height: 64px;
  flex: none;
}

.pass-guest > :not(img) { min-width: 0; }

.pass-label,
.pass-grid dt {
  display: block;
  font-size: var(--tiny);
  color: var(--text-2);
}

.pass-name {
  display: block;
  font-size: 1.5rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.pass-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pass-grid dd {
  font-size: var(--body);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.paid { color: var(--ok); }
.open { color: var(--wait); }

/* Jouw tickets: kleine, tikbare passen */
.passes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pass-link {
  gap: 10px;
  min-height: 44px;
  padding: 14px 16px;
  border-radius: 20px;
  text-decoration: none;
  box-shadow: 0 0 0 1px var(--line);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--ease), box-shadow 0.15s ease;
}

.pass-link:hover { box-shadow: 0 0 0 1px var(--ghost-line); }
.pass-link:active { transform: scale(0.985); }

.pass-link .pass-top { align-items: baseline; }

.pass-status {
  flex: none;
  text-align: right;
}

.pass-link .pass-guest img { height: 40px; }

.pass-link .pass-name { font-size: 1.1875rem; }

.pass-go {
  margin-left: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--small);
  font-weight: 600;
  color: var(--text);
}

.pass-go span {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 400;
  color: var(--text-2);
}

.screen > .foot { margin-top: -4px; }

/* Honeypot: nooit zichtbaar (ook als [hidden] ergens wordt overschreven). */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Het ene moment van beweging: de pass komt op na betalen. */
@media (prefers-reduced-motion: no-preference) {
  .done .tick { animation: pop 0.5s var(--ease) both; }
  .done ~ .pass { animation: rise 0.6s 0.12s var(--ease) both; }
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .spinner,
  .status.is-waiting::before { animation: none; }
}

/* Smalle schermen (320 px): iets compacter, niets valt weg. */
@media (max-width: 359px) {
  :root { --gutter: max(16px, env(safe-area-inset-left)); --title: 1.875rem; }
  .pass { padding: 16px; }
  .pass-name { font-size: 1.3125rem; }
  .pass-top { flex-wrap: wrap; }
}
