:root {
  color-scheme: light;
  --ink: #102229;
  --muted: #647176;
  --cream: #fbf7ee;
  --paper: #fffdf8;
  --orange: #c84b2c;
  --orange-dark: #9f341d;
  --navy: #0c2029;
  --green: #127452;
  --red: #b82f32;
  --line: #e7ded0;
  --shadow: 0 22px 60px rgba(26, 22, 15, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(200, 75, 44, .12), transparent 30rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.shell { width: min(100%, 1120px); margin: 0 auto; padding: 20px; }
.narrow { width: min(100%, 500px); margin: 0 auto; padding: 18px; }
.topline {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; font-size: 12px; font-weight: 900; letter-spacing: .12em;
  text-transform: uppercase;
}
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-x { color: var(--orange); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.72);
  font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: none;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.card {
  overflow: hidden; border: 1px solid rgba(91, 72, 44, .12); border-radius: 30px;
  background: var(--paper); box-shadow: var(--shadow);
}
.hero {
  position: relative; min-height: 390px; display: flex; align-items: flex-end;
  padding: 28px; overflow: hidden; color: #fff;
  background:
    linear-gradient(to top, rgba(7, 19, 24, .97), rgba(7, 19, 24, .12) 70%),
    url("/campaign.png") center 48% / cover;
}
.hero::after {
  content: "200"; position: absolute; top: 22px; right: 22px;
  display: grid; place-items: center; width: 76px; height: 76px;
  border: 2px solid rgba(255,255,255,.8); border-radius: 50%;
  background: rgba(200,75,44,.92); font-size: 26px; font-weight: 950;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.hero-copy { position: relative; z-index: 1; max-width: 390px; }
.eyebrow {
  margin: 0 0 10px; color: #ffd9cc; font-size: 11px; font-weight: 950;
  letter-spacing: .14em; text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; letter-spacing: -.045em; }
h1 { margin-bottom: 12px; font-size: clamp(44px, 12vw, 64px); line-height: .9; }
h2 { margin-bottom: 9px; font-size: 31px; line-height: 1; }
.hero p { max-width: 330px; margin: 0; color: rgba(255,255,255,.84); line-height: 1.5; }
.content { padding: 26px; }
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin: -26px -26px 25px; border-bottom: 1px solid var(--line); background: var(--line);
}
.stat { padding: 17px 12px; background: var(--paper); text-align: center; }
.stat strong { display: block; font-size: 20px; }
.stat span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.lead { margin: 0 0 22px; color: var(--muted); line-height: 1.55; }
.field { margin: 0 0 16px; }
.field label, .field legend {
  display: block; margin: 0 0 7px; font-size: 12px; font-weight: 900;
}
.field input, .field select {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid #d9d0c3;
  border-radius: 13px; outline: none; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(200,75,44,.12); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check {
  display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start;
  margin: 19px 0; color: var(--muted); font-size: 12px; line-height: 1.45;
}
.check input { width: 19px; height: 19px; margin: 0; accent-color: var(--orange); }
.button {
  width: 100%; min-height: 54px; border: 0; border-radius: 15px;
  color: #fff; background: var(--orange); font-weight: 900; cursor: pointer;
  box-shadow: 0 10px 25px rgba(200,75,44,.25);
}
.button:hover { background: var(--orange-dark); }
.button:disabled { opacity: .55; cursor: wait; }
.button.secondary { color: var(--ink); background: #fff; border: 1px solid var(--line); box-shadow: none; }
.smallprint { margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.notice { display: none; margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: #fee8e2; color: #8c2d18; font-size: 13px; }
.notice.show { display: block; }
.footer { padding: 24px 4px 10px; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.6; }
.footer a { margin: 0 7px; }

/* Ticket */
.ticket-card { overflow: visible; margin-top: 24px; }
.ticket-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 19px 22px; border-radius: 28px 28px 0 0; color: #fff; background: var(--orange);
}
.ticket-head strong { font-size: 17px; }
.ticket-main { position: relative; padding: 28px 24px; text-align: center; }
.ticket-main::before, .ticket-main::after {
  content: ""; position: absolute; top: -13px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--cream);
}
.ticket-main::before { left: -13px; }
.ticket-main::after { right: -13px; }
.coffee-icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 13px;
  border-radius: 15px; color: var(--orange); background: #fbe3db; font-size: 24px;
}
.ticket-main h1 { margin: 0 0 10px; color: #241613; font-size: 39px; line-height: .95; }
.ticket-main .lead { margin-bottom: 18px; }
.ticket-meta {
  display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0;
  border: 1px solid var(--line); border-radius: 15px; overflow: hidden; text-align: left;
}
.ticket-meta div { padding: 13px; }
.ticket-meta div + div { border-left: 1px solid var(--line); }
.ticket-meta span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ticket-meta strong { display: block; margin-top: 4px; font-size: 12px; }
.perforation { margin: 25px -24px; border-top: 1px dashed #d4c6b2; }
.qr { width: min(100%, 230px); margin: 0 auto; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.qr img { display: block; width: 100%; }
.code { margin: 10px 0 0; font-family: ui-monospace, monospace; font-size: 14px; font-weight: 900; letter-spacing: .16em; }
.status-banner { margin: 18px 0 0; padding: 13px; border-radius: 13px; background: #e6f5ef; color: var(--green); font-weight: 900; }
.status-banner.used { background: #f8e4e4; color: var(--red); }

/* Scanner */
.scanner-body { background: var(--navy); color: #fff; }
.scanner-shell { min-height: 100vh; width: min(100%, 560px); margin: 0 auto; padding: 16px; }
.scanner-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.scanner-view {
  position: relative; min-height: 56vh; overflow: hidden; border-radius: 25px;
  background: #061117; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.scanner-view video { width: 100%; height: 56vh; object-fit: cover; }
.scan-frame {
  position: absolute; inset: 50% auto auto 50%; width: min(72vw, 330px); aspect-ratio: 1;
  border: 3px solid rgba(255,255,255,.9); border-radius: 28px; transform: translate(-50%,-50%);
  box-shadow: 0 0 0 999px rgba(3,13,18,.52);
}
.scanner-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 13px; }
.scanner-actions input { min-width: 0; padding: 13px; border: 0; border-radius: 13px; text-transform: uppercase; }
.scanner-actions button { padding: 0 20px; border: 0; border-radius: 13px; font-weight: 900; }
.result {
  position: fixed; z-index: 20; inset: 0; display: none; place-items: center; padding: 24px;
  text-align: center; color: #fff; background: var(--green);
}
.result.show { display: grid; }
.result.error { background: var(--red); }
.result h1 { margin: 0 0 12px; font-size: clamp(52px, 15vw, 86px); }
.result p { margin: 0; font-size: 18px; font-weight: 800; }
.result .number { margin-top: 18px; font-size: 14px; opacity: .8; }
.login { padding-top: 15vh; }
.login .card { padding: 26px; color: var(--ink); }

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 22px 0; }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.metric strong { display: block; font-size: 29px; }
.metric span { color: var(--muted); font-size: 11px; font-weight: 800; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.tag { padding: 5px 8px; border-radius: 999px; background: #eef2f3; font-weight: 800; }
.tag.redeemed { color: var(--green); background: #e2f4ec; }

@media (max-width: 720px) {
  .shell { padding: 14px; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid .metric:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
