@font-face {
  font-family: "Russo One";
  src: url("/fonts/russo-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

/* IDSECCONF brand: red #C8000C, silver #A8A8A8, black. Header + hero are always black (as the logo). */
:root {
  --brand-red: #c8000c;
  --brand-silver: #a8a8a8;
  --brand-black: #0a0a0b;
  --display: "Russo One", "Arial Black", system-ui, sans-serif;

  --bg: #f5f5f4;
  --surface: #ffffff;
  --text: #121214;
  --muted: #5b5f66;
  --border: #e1e1e0;
  --accent: var(--brand-red);
  --accent-text: #ffffff;
  --link: var(--brand-red);
  --ok: #117a3d;
  --ok-bg: #e5f5ec;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --bad: #b3261e;
  --bad-bg: #fbe7e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 5%), 0 2px 8px rgb(0 0 0 / 4%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --surface: #17171a;
    --text: #ececee;
    --muted: #9b9ea6;
    --border: #2a2a2f;
    --accent: #d8141e;      /* buttons: white text on red, AA contrast */
    --accent-text: #ffffff;
    --link: #ff5a63;        /* red text on dark background, AA contrast */
    --ok: #57d08a;
    --ok-bg: #12291c;
    --warn: #f1c16b;
    --warn-bg: #2d2412;
    --bad: #ff8a80;
    --bad-bg: #331615;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; }
a { color: var(--link); }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 1.5rem 0 1rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0.25rem 0 0.5rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sandbox-banner {
  background: repeating-linear-gradient(45deg, #ffd23f, #ffd23f 12px, #ffc400 12px, #ffc400 24px);
  color: #1a1400; text-align: center; font-weight: 700; font-size: 0.85rem; padding: 6px 16px;
}
.site-header { background: var(--brand-black); border-bottom: 3px solid var(--brand-red); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 64px; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.wordmark { font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.02em; line-height: 1; }
.wordmark .wm-id { color: #ff1f2b; }
.wordmark .wm-sec { color: #fff; }
.wordmark .wm-conf { color: var(--brand-silver); }
.wordmark .wm-rest { color: #fff; margin-left: 0.3em; }
.brand-tag { margin-left: 4px; font-size: 0.7rem; text-transform: uppercase; background: var(--brand-red); color: #fff; padding: 2px 6px; border-radius: 4px; font-family: system-ui, sans-serif; font-weight: 700; }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: #e8e8e8; text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: #ff4d56; }
.site-footer { color: var(--muted); font-size: 0.85rem; padding-block: 40px; }
main { padding-bottom: 24px; }

.hero { background: var(--brand-black); color: #fff; padding-block: 32px 40px; }
.hero-inner { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.hero-logo { width: 220px; max-width: 60vw; height: auto; }
.hero-text { flex: 1 1 300px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 0.4rem; color: #fff; }
.hero p { color: #c9c9cc; font-size: 1.05rem; margin: 0 0 1rem; }
.hero .actions { margin: 0; }
.hero .btn-secondary { color: #fff; border-color: #3a3a40; }
.hero .btn-secondary:hover { border-color: #ff4d56; }
@media (max-width: 600px) { .hero-inner { justify-content: center; text-align: center; } .hero .actions { justify-content: center; } }

h1, h2, .price, .stat-value { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
.shop-section h2 { text-transform: uppercase; border-left: 4px solid var(--accent); padding-left: 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--border); }
.card-body { padding: 16px 16px 8px; flex: 1; }
.card-body p { margin: 0.4rem 0; }
.kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--link); font-weight: 700; }
.meta { color: var(--muted); font-size: 0.9rem; }
.price { font-size: 1.25rem; font-weight: 700; }
.low-stock { color: var(--warn); font-weight: 600; font-size: 0.9rem; }
.add-form { display: flex; gap: 8px; padding: 0 16px 16px; flex-wrap: wrap; }
.add-form select { flex: 0 1 auto; }
.add-form button { flex: 1; }
.unavailable { margin: 0; padding: 12px 16px 16px; color: var(--muted); font-weight: 600; }
.state-sold_out, .state-ended { opacity: 0.75; }

input, select, textarea, button, .btn { font: inherit; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); min-width: 0;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.add-form select, .row select { width: auto; }
label { display: block; font-weight: 500; }
label > input, label > select, label > textarea, label > .row { margin-top: 4px; }
.hint { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 400; margin-top: 4px; }
.field-error { color: var(--bad); font-size: 0.9rem; margin: 4px 0 0; }
.radio, .checkbox { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 6px 0; }
.radio input, .checkbox input { width: auto; margin-top: 5px; }

button, .btn {
  display: inline-block; background: var(--accent); color: var(--accent-text); border: 1px solid transparent;
  padding: 9px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
button:hover, .btn:hover { filter: brightness(1.08); }
.btn-secondary, button.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-danger, button.btn-danger { background: var(--bad); color: #fff; }
.btn-small, button.btn-small { padding: 5px 10px; font-size: 0.85rem; }
.btn-large { width: 100%; padding: 13px 16px; font-size: 1.05rem; margin-top: 12px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--link); font-weight: 500; text-decoration: underline; cursor: pointer; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 640px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input:not([type=checkbox]) { flex: 1 1 160px; width: auto; }
.row-2, .row-3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-block: 16px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 2px 8px 2px 0; }
.qty-input { width: 5.5em !important; flex: 0 0 auto !important; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.attendee { border-top: 1px dashed var(--border); padding-top: 10px; }
.attendee-title { margin: 0 0 6px; font-weight: 600; font-size: 0.95rem; }
.shipping-fields { border-left: 3px solid var(--border); padding-left: 12px; display: flex; flex-direction: column; gap: 10px; }
.shipping-fields .hint { margin: 0; }

.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }
.summary h2 { margin-top: 0; }
.summary-lines { list-style: none; padding: 0; margin: 0 0 12px; }
.summary-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 0.95rem; }
@media (max-width: 820px) {
  .checkout { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; }
}

.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; max-width: 420px; margin: 16px 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .total { font-weight: 700; color: var(--text); font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 6px; }
.totals p { grid-column: 1 / -1; margin: 4px 0 0; }
.voucher-form { max-width: 420px; margin-top: 16px; }

.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.row-muted td { opacity: 0.55; }

.flash { border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; border: 1px solid; }
.flash p, .flash ul { margin: 0; }
.flash-error { background: var(--bad-bg); color: var(--bad); border-color: currentColor; }
.flash-info { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: currentColor; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
.callout p { margin: 4px 0; }
.callout-warn { border-left-color: var(--warn); }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; background: var(--border); color: var(--text); vertical-align: middle; }
.badge-paid, .badge-valid, .badge-checked { background: var(--ok-bg); color: var(--ok); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-expired, .badge-cancelled, .badge-void, .badge-attention { background: var(--bad-bg); color: var(--bad); }
.badge-attention { margin-left: 6px; }

.ticket-list { display: grid; gap: 12px; }
.ticket-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ticket-card p { margin: 2px 0; }
.name-change summary { cursor: pointer; color: var(--link); font-weight: 600; }
.name-change form { margin-top: 10px; min-width: min(300px, 100%); }

.ticket { max-width: 420px; margin: 24px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; text-align: center; box-shadow: var(--shadow); }
.ticket h1 { font-size: 1.4rem; margin: 4px 0; }
.ticket-emblem { height: 48px; width: auto; }
.qr { background: #fff; border-radius: 12px; padding: 8px; margin: 16px auto; max-width: 320px; }
.qr svg { width: 100%; height: auto; display: block; }
.ticket-name { font-size: 1.3rem; font-weight: 700; margin: 8px 0 0; }
.ticket-code { font-family: ui-monospace, Menlo, monospace; color: var(--muted); letter-spacing: 0.08em; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-alert { border-color: var(--bad); }
.stat-alert .stat-value { color: var(--bad); }
.filters { margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

.checkin { max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.scanner { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner button { position: absolute; }
.scan-result { border-radius: var(--radius); padding: 16px; text-align: center; min-height: 110px; background: var(--surface); border: 1px solid var(--border); }
.scan-result h2 { margin: 0 0 6px; font-size: 1.6rem; }
.scan-result p { margin: 2px 0; }
.scan-name { font-size: 1.4rem; font-weight: 700; }
.scan-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.scan-warn { background: #e0a100; color: #1a1400; border-color: #e0a100; }
.scan-bad { background: var(--bad); color: #fff; border-color: var(--bad); }

/* Shipping: area search + courier picker */
.label { font-weight: 500; margin: 0 0 4px; }
.area-search { position: relative; }
.area-results { list-style: none; margin: 4px 0 0; padding: 0; border-radius: 8px; max-height: 260px; overflow-y: auto; }
.area-results:not(:empty) { border: 1px solid var(--border); background: var(--surface); }
.area-results li + li { border-top: 1px solid var(--border); }
.area-option { display: block; width: 100%; text-align: left; background: none; color: var(--text); border: 0; border-radius: 0; padding: 8px 12px; font-weight: 400; font-size: 0.9rem; }
.area-option:hover, .area-option:focus-visible { background: var(--bg); filter: none; }
.area-msg { padding: 8px 12px; color: var(--muted); font-size: 0.9rem; }
.ship-rates { display: flex; flex-direction: column; gap: 2px; }
.rate-option { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin: 2px 0; }
.rate-option:has(input:checked) { border-color: var(--accent); }
.courier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }

/* Admin: product images */
.image-admin { margin-bottom: 24px; }
.image-preview { display: block; width: 100%; max-width: 360px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 10px; background: var(--border); }
.product-cell { display: flex; gap: 10px; align-items: center; }
.thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; background: var(--border); display: inline-block; }
input[type=file] { padding: 6px; }
