/* ═══════════════════════════════════════════
   PROJECT CHARITY - styles
   Brand: project. architecture (shared tokens with Project.portal)
   Page colours pick up the Music Bingo poster (vinyl black, record red).
   ═══════════════════════════════════════════ */

@font-face { font-family: 'Objektiv MK1'; src: url('../fonts/OBJEKTIVMK1_LT.TTF') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Objektiv MK1'; src: url('../fonts/OBJEKTIVMK1_RG.TTF') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Objektiv MK1'; src: url('../fonts/OBJEKTIVMK1_MD.TTF') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Objektiv MK1'; src: url('../fonts/OBJEKTIVMK1_XBD.TTF') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Objektiv MK1'; src: url('../fonts/OBJEKTIVMK1_BLK.TTF') format('truetype'); font-weight: 900; font-display: swap; }

:root {
  --ink:        #1a1a2e;
  --ink-mid:    #2d2d4e;
  --ink-light:  #4a4a6a;
  --gold:       #EFB348;
  --gold-lt:    #F5C764;
  --bg-warm:    #f0ede6;
  --surface:    #ffffff;
  --border:     #e2ddd5;
  --border-md:  #ccc5ba;
  --text:       #1a1a2e;
  --text-mid:   #4a4a6a;
  --text-lt:    #8a8aaa;
  --ok:         #2d7a4f; --ok-bg: #e8f5ee;
  --danger:     #c0392b; --danger-bg: #fdecea;
  --vinyl:      #1c0f0c;
  --record-red: #d3261a;
  --r:          14px;
  --r-sm:       8px;
  --shadow-lg:  0 10px 40px rgba(0,0,0,.35);
  --font:       'Objektiv MK1', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--text-mid); }
.small { font-size: .82rem; }
.full-stop { color: var(--gold); }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg); }

/* ── BUTTONS ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-sm); font: 600 .92rem var(--font);
  cursor: pointer; border: none; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .15s, box-shadow .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-lg { padding: 15px 26px; font-size: 1.02rem; border-radius: 10px; }
.btn-full { width: 100%; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-mid); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border-md); }
.btn-ghost:hover { background: var(--bg-warm); border-color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn:focus-visible, .stepper-btn:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ── EVENT PAGE ────────────────────────────── */
.event-page { min-height: 100vh; background: var(--vinyl); position: relative; overflow-x: hidden; }
/* A heavily blurred copy of the poster behind everything, so the page takes on its colours */
.event-page::before {
  content: ''; position: fixed; inset: -15%; z-index: -1;
  background: url('../assets/poster.jpg') center / cover no-repeat;
  filter: blur(70px) saturate(1.3) brightness(.55);
}

.stage { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; }

/* The poster and the booking stub form one ticket, joined by a perforated tear line */
.ticket-wrap {
  --notch: 16px;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr);
  width: 100%; max-width: 1000px;
  filter: drop-shadow(0 24px 48px rgba(0,0,0,.45));
}
.poster-side {
  border-radius: 16px 0 0 16px; overflow: hidden; background: var(--record-red);
  /* half-circle bites out of the right edge, top and bottom */
  -webkit-mask: radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
/* The whole poster always shows. If the stub grows taller (more guest names), a blurred
   copy of the poster fills the space above and below so it still reads as one piece. */
.poster-side { position: relative; isolation: isolate; }
.poster-side::before {
  content: ''; position: absolute; inset: -40px; z-index: -1;
  background: url(../assets/poster.jpg) center / cover;
  filter: blur(28px) saturate(1.2) brightness(.8);
}
.poster { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }

.stub {
  position: relative; background: #fffdf8; padding: 34px 34px 28px;
  border-radius: 0 16px 16px 0;
  display: flex; flex-direction: column;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
/* perforation */
.stub::before {
  content: ''; position: absolute; left: 0; top: calc(var(--notch) + 8px); bottom: calc(var(--notch) + 8px);
  border-left: 2px dashed rgba(26,26,46,.18);
}

.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 700; color: var(--record-red); margin-bottom: 6px; }
.stub-title { font-weight: 900; font-size: clamp(1.7rem, 3vw, 2.1rem); letter-spacing: -.035em; line-height: 1.05; margin-bottom: 16px; }

.facts { list-style: none; display: grid; gap: 8px; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px dashed var(--border-md); font-size: .95rem; }
.facts li { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.facts svg { width: 19px; height: 19px; margin-top: 1px; fill: none; stroke: var(--record-red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.facts a { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--gold); }
.facts a:hover { border-color: var(--ink); }

.step { padding: 16px 0; border-bottom: 1px dashed var(--border-md); }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-head > div:nth-child(2) { flex: 1; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex-shrink: 0;
}
.step-title { font-weight: 800; font-size: 1.02rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-left: 38px; }
.chip {
  padding: 8px 15px; border-radius: 30px; border: 1.5px solid var(--border-md); background: var(--surface);
  font: 600 .88rem var(--font); color: var(--ink); cursor: pointer; transition: all .14s;
}
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.guest-list { display: grid; gap: 8px; margin-top: 12px; padding-left: 38px; }
.guest-row { display: flex; align-items: center; border: 1.5px solid var(--border-md); border-radius: var(--r-sm); background: var(--surface); padding-left: 10px; }
.guest-row:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(239,179,72,.2); }
.guest-row:has(.invalid) { border-color: var(--danger); }
.guest-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-warm); color: var(--text-mid); font-size: .75rem; font-weight: 800; display: grid; place-items: center; }
.guest-row input { flex: 1; min-width: 0; border: none; outline: none; padding: 10px; font: 500 .95rem var(--font); background: transparent; color: var(--text); }
.custom-donation { margin: 10px 0 0 38px; display: flex; align-items: center; border: 1.5px solid var(--border-md); border-radius: var(--r-sm); padding: 0 12px; background: var(--surface); }
.custom-donation:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(239,179,72,.2); }
.custom-donation .currency { font-weight: 700; color: var(--text-mid); }
.custom-donation input { border: none; outline: none; padding: 10px 8px; font: 500 1rem var(--font); width: 100%; background: transparent; color: var(--text); }

.btn-red { background: var(--record-red); color: #fff; }
.btn-red:hover { background: #b81e13; transform: translateY(-1px); }

.stepper { display: flex; align-items: center; gap: 4px; background: var(--bg-warm); border-radius: 40px; padding: 4px; }
.stepper-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--surface);
  font: 600 1.3rem var(--font); color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(26,26,46,.15);
}
.stepper-btn:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 34px; text-align: center; font-weight: 800; font-size: 1.15rem; }

.total-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0 18px; margin-top: auto; }
.total-row > div { display: flex; flex-direction: column; }
.total-label { font-weight: 800; }
.total-row strong { font-weight: 900; font-size: 2.1rem; letter-spacing: -.03em; line-height: 1; }
.form-error { background: var(--danger-bg); color: var(--danger); padding: 10px 14px; border-radius: var(--r-sm); font-size: .88rem; margin-bottom: 14px; }
.fine-print { font-size: .8rem; color: var(--text-lt); text-align: center; margin-top: 12px; }
.fine-print a { color: var(--text-mid); }
.noscript { padding: 20px; text-align: center; background: var(--danger-bg); color: var(--danger); }

/* ── SUCCESS / TICKET PAGE ─────────────────── */
.success-page { min-height: 100vh; padding: 48px 20px 64px; display: flex; flex-direction: column; align-items: center; }
.success-logo { height: 46px; width: auto; margin-bottom: 30px; }
.success-card { width: 100%; max-width: 560px; overflow: hidden; }
.success-head { padding: 30px 30px 24px; text-align: center; }
.success-head h1 { font-weight: 900; font-size: 2rem; letter-spacing: -.035em; line-height: 1.1; margin-bottom: 8px; }
.tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.tick svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ticket { margin: 0 20px 20px; border-radius: 12px; background: var(--ink); color: #fff; overflow: hidden; }
.ticket-top { padding: 24px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.ticket-event { font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 8px; }
.ticket-meta { font-size: .88rem; color: rgba(255,255,255,.72); }
.ticket-top .ticket-label { margin-bottom: 4px; }
.ticket-qr { background: #fff; border-radius: 8px; padding: 6px; width: 132px; height: 132px; }
.ticket-qr svg { width: 100%; height: 100%; display: block; }
.ticket-tear { border-top: 2px dashed rgba(255,255,255,.22); margin: 0 18px; }
.ticket-bottom { padding: 18px 24px 22px; display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 12px; }
.ticket-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); font-weight: 600; }
.ticket-value { font-weight: 800; font-size: 1rem; }
.order-no { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .04em; }
.success-body { padding: 0 30px 30px; }
.success-body p { margin-bottom: 10px; }
.success-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.success-actions .btn { flex: 1; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 10px auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ────────────────────────────── */
/* Stack the ticket: poster on top, stub underneath, tear line runs across */
@media (max-width: 900px) {
  .stage { padding: 16px 16px 40px; place-items: start center; }
  .ticket-wrap { grid-template-columns: 1fr; max-width: 520px; }
  .poster-side {
    border-radius: 16px 16px 0 0;
    -webkit-mask: radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
            mask: radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
  }
  .poster { height: auto; }
  .stub {
    border-radius: 0 0 16px 16px; padding: 28px 20px 24px;
    -webkit-mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
            mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
  }
  .stub::before { left: calc(var(--notch) + 8px); right: calc(var(--notch) + 8px); top: 0; bottom: auto; border-left: 0; border-top: 2px dashed rgba(26,26,46,.18); }
}
@media (max-width: 420px) {
  .chips, .custom-donation, .guest-list { padding-left: 0; margin-left: 0; }
}
@media (max-width: 520px) {
  .ticket-top { grid-template-columns: 1fr; }
  .ticket-qr { margin: 0 auto; }
  .ticket-bottom { grid-template-columns: 1fr 1fr; }
  .success-head, .success-body { padding-left: 20px; padding-right: 20px; }
  .ticket { margin: 0 12px 16px; }
}

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

@media print {
  .success-page { background: #fff; padding: 0; }
  .success-actions, .no-print { display: none !important; }
  .success-card { box-shadow: none; border: 1px solid #ccc; }
  .ticket { -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
}
