/* Karcis — tampilan pembeli & scanner (gelap, satu tema). */
:root {
  --ink: #15131D; --ink-2: #1F1C2A; --ink-3: #2A2636; --line: #3A3547;
  --on-ink: #F3F0EA; --muted: #ABA5B9;
  --paper: #FFFFFF; --on-paper: #17151F; --paper-muted: #5B5566; --paper-line: #E4DFD4;
  --accent: #FF6B3D; --accent-hover: #FF8559; --accent-ink: #15131D; --accent-soft: #2C1F1F;
  --ok: #15803D; --warn: #F59E0B; --bad: #B91C1C; --err: #FF9B7D; --err-bg: #3B1A1A;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--on-ink); }
body { font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; line-height: 1.1; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 20; background: var(--ink); border-bottom: 1px solid var(--ink-3);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .04em; color: var(--on-ink); text-decoration: none; }
.brand b { color: var(--accent); }
.wrap { max-width: 460px; margin: 0 auto; padding: 16px 16px 140px; display: flex; flex-direction: column; gap: 16px; }
.wrap.wide { max-width: 960px; }

.card { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 16px; padding: 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.notice { background: var(--ink-3); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.notice.error { background: var(--err-bg); color: var(--on-ink); }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; background: var(--ink-3); color: var(--on-ink); white-space: nowrap; }
.pill.ok { background: var(--ok); color: #fff; }

.btn { display: block; width: 100%; min-height: 52px; border: none; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 16px; text-align: center; text-decoration: none; padding: 15px 16px; }
.btn:hover { background: var(--accent-hover); }
.btn.ghost { background: var(--ink-3); color: var(--on-ink); }
.btn.ghost:hover { background: var(--line); }
.btn.link { background: transparent; color: var(--accent); min-height: 44px; padding: 10px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--ink); border-top: 1px solid var(--line);
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.cta > div { max-width: 428px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }

/* Event */
.poster { position: relative; overflow: hidden; min-height: 260px; border-radius: 20px; background: var(--accent); color: var(--accent-ink);
  padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; }
.poster .ring { position: absolute; width: 250px; height: 250px; border: 26px solid var(--accent-ink); border-radius: 50%; top: -90px; right: -80px; }
.poster .dot { position: absolute; width: 64px; height: 64px; background: var(--accent-ink); border-radius: 50%; top: 36px; left: 24px; }
.poster .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; position: relative; }
.poster h1 { font-size: 40px; line-height: .98; margin-top: 6px; position: relative; }
.poster .artist { font-weight: 600; margin-top: 8px; position: relative; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.countdown div { background: var(--ink); border-radius: 10px; padding: 8px 0; text-align: center; }
.countdown b { display: block; font-family: var(--display); font-size: 26px; }
.countdown span { font-size: 11px; color: var(--muted); }
.terms { white-space: pre-line; font-size: 14px; color: #D6D1E0; }

/* Pilihan */
.choice { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; padding: 14px 16px;
  border-radius: 14px; background: var(--ink-2); border: 2px solid var(--ink-3); color: var(--on-ink); min-height: 64px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .name { font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink); color: var(--on-ink); font-size: 22px; }
.stepper output { font-family: var(--display); font-weight: 800; font-size: 24px; min-width: 26px; text-align: center; }
.tabs { display: flex; gap: 6px; background: var(--ink-2); padding: 4px; border-radius: 14px; }
.tabs button { flex: 1; min-height: 44px; border-radius: 10px; border: none; background: transparent; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--on-ink); color: var(--ink); }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink-2); color: var(--on-ink); width: 100%; }
.field input[aria-invalid="true"] { border-color: var(--accent); }
.err { font-size: 13px; color: var(--err); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }

.holdbar { background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between;
  align-items: center; font-weight: 700; font-size: 14px; position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 5; }
.holdbar .t { font-family: var(--display); font-size: 20px; font-weight: 800; }

/* Antrean */
.queue-pos { font-family: var(--display); font-weight: 800; font-size: 84px; line-height: 1; color: var(--accent); }
.progress { height: 12px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }

/* Pembayaran & tiket */
.paybox { background: var(--paper); color: var(--on-paper); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.paybox .muted2 { color: var(--paper-muted); font-size: 13px; }
.qr { width: 240px; max-width: 100%; aspect-ratio: 1; background: #fff; border-radius: 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
.ticket { background: var(--paper); color: var(--on-paper); border-radius: 20px; overflow: hidden; }
.ticket .head { background: var(--accent); color: var(--accent-ink); padding: 16px 18px; }
.ticket .body { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ticket .perf { width: 100%; border-top: 2px dashed var(--paper-line); }
.ticket .code { font-weight: 700; letter-spacing: .08em; font-size: 14px; }
.kv { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; font-size: 13px; }
.kv span { display: block; color: var(--paper-muted); }
.kv b { font-size: 15px; overflow-wrap: anywhere; }
.referral { border: 2px dashed var(--accent); border-radius: 16px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.referral .code { font-family: var(--display); font-weight: 800; font-size: 32px; letter-spacing: .08em; color: var(--accent); }
.stamp { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--ok); color: #fff; }

/* Scanner */
.reader { width: 100%; min-height: 260px; border-radius: 20px; overflow: hidden; background: #0B0A10; }
.reader video { width: 100% !important; height: auto !important; }
.result { border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.result.valid { background: var(--ok); color: #fff; }
.result.used { background: var(--warn); color: var(--accent-ink); }
.result.invalid { background: var(--bad); color: #fff; }
.result.idle { background: var(--ink-2); border: 1px solid var(--ink-3); }
.result .title { font-family: var(--display); font-weight: 800; font-size: 30px; }
select.input, input.input { height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink-2); color: var(--on-ink); width: 100%; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list .item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ink-2); font-size: 13px; }

.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.event-card { text-decoration: none; color: inherit; background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.event-card .top { background: var(--accent); color: var(--accent-ink); padding: 18px; min-height: 120px; display: flex; align-items: flex-end; }
.event-card .top h2 { font-size: 26px; }
.event-card .info { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 4px; }

@media (prefers-reduced-motion: reduce) { .progress > div { transition: none; } }

/* Banner & tahap penjualan */
.banner { width: 100%; border-radius: 20px; overflow: hidden; background: var(--ink-2); }
.banner img { display: block; width: 100%; height: auto; }
.phases { display: flex; flex-direction: column; gap: 8px; }
.phase { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--ink-3); }
.phase.now { border: 2px solid var(--accent); }
.phase.past { opacity: .55; }
.strike { text-decoration: line-through; color: var(--muted); font-weight: 500; font-size: 13px; }
.agent-tag { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px dashed var(--accent); }
.ico-on-accent { color: var(--accent-ink); }
