/* Catraca: ingressos em forma de canhoto (data destacada, picote), painéis densos para quem organiza. */
:root {
  --bg: #EDF0F7;
  --surface: #FFFFFF;
  --surface-2: #F6F8FC;
  --ink: #121A33;
  --muted: #59627E;
  --line: #D4D9E6;
  --accent: #3346F0;
  --accent-soft: #E3E6FF;
  --on-accent: #FFFFFF;
  --stub: #FFC23D;
  --on-stub: #2A1F00;
  --ok: #0F8657;
  --ok-soft: #DDF4EA;
  --bad: #C93434;
  --bad-soft: #FBE3E3;
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1020; --surface: #161C31; --surface-2: #1C2340; --ink: #E7EBF7; --muted: #99A2BE;
    --line: #2A3352; --accent: #8592FF; --accent-soft: #252C5C; --on-accent: #0C1020;
    --stub: #E8AE2C; --on-stub: #1F1700; --ok: #3CC48B; --ok-soft: #12352A; --bad: #F07070; --bad-soft: #3A1A1F;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.tab { border: 0; background: transparent; padding: 8px 12px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; text-decoration: none; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab[aria-current="page"] { background: var(--ink); color: var(--surface); }
.who { font-size: 0.8rem; color: var(--muted); padding: 0 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main.wrap { padding-block: 28px 72px; display: grid; gap: 24px; }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn.small { padding: 5px 10px; font-size: 0.85rem; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; text-decoration: none; }

/* Ingresso */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 18px; }
.ticket { position: relative; display: grid; grid-template-columns: 96px 1fr; background: var(--surface); border-radius: var(--r); border: 1px solid var(--line); text-decoration: none; color: inherit; overflow: hidden; transition: transform .15s ease, border-color .15s ease; }
.ticket:hover { transform: translateY(-2px); border-color: var(--accent); }
.stub { background: var(--stub); color: var(--on-stub); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 6px; border-right: 2px dashed color-mix(in srgb, var(--on-stub) 35%, transparent); }
.stub .dow { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.stub .day { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stub .mon { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.stub .hr { margin-top: 6px; font-family: var(--font-mono); font-size: 0.78rem; }
.ticket::before, .ticket::after { content: ""; position: absolute; left: 86px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.ticket::before { top: -11px; }
.ticket::after { bottom: -11px; }
.tbody { padding: 16px 18px; display: grid; gap: 10px; min-width: 0; }
.tbody h3 { font-size: 1.2rem; font-weight: 700; }
.meta { color: var(--muted); font-size: 0.88rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tfoot { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.from { font-size: 0.78rem; color: var(--muted); }
.from strong { display: block; font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; width: 100%; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.hot > i { background: var(--bad); }
.cap { font-size: 0.75rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Blocos */
.detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 820px) { .detail, .two { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 16px; min-width: 0; align-content: start; }
.panel h2 { font-size: 1.15rem; font-weight: 700; }
.sticky { position: sticky; top: 76px; }
@media (max-width: 820px) { .sticky { position: static; } }
.narrow { max-width: 440px; width: 100%; margin: 0 auto; }
.medium { max-width: 820px; }
.hero-ev h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; }
.hero-ev { display: grid; gap: 10px; }
.hero-ev p { margin: 0; max-width: 62ch; white-space: pre-line; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 0.92rem; }
.facts b { color: var(--ink); font-weight: 600; }
.lot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.lot:first-child { border-top: 0; }
.lot .name { font-weight: 600; }
.lot .price { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 1.1rem; font-weight: 600; }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper span { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.sum { display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.sum div { display: flex; justify-content: space-between; gap: 12px; }
.sum .total { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; }

/* Formulários */
.field { display: grid; gap: 4px; min-width: 0; }
.field label, .field .label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select, .input { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); }
.field textarea { min-height: 90px; resize: vertical; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formgrid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .formgrid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: var(--surface); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.note { font-size: 0.84rem; color: var(--muted); margin: 0; }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 0.9rem; }
.msg.bad { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.info { background: var(--accent-soft); color: var(--ink); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Ingressos emitidos */
.passes { display: grid; gap: 10px; }
.pass { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line); background: var(--surface-2); }
.pass-info { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.code { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.06em; }
.pass .code { font-size: 1.1rem; }
/* QR sempre escuro sobre branco, nos dois temas, para a câmera ler */
.qr { width: 120px; aspect-ratio: 1; padding: 8px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; cursor: zoom-in; display: block; }
.qr span, .qr svg { display: block; width: 100%; height: 100%; }
.pass.used .qr { opacity: 0.3; }
.qr-zoom { position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / 0.82); display: grid; place-items: center; padding: 16px; }
.qr-zoom-card { background: #FFFFFF; color: #121A33; border-radius: 18px; padding: 22px; display: grid; gap: 10px; justify-items: center; width: min(92vw, 420px); }
.qr-zoom-card .note { color: #59627E; }
.qr-big { width: 100%; aspect-ratio: 1; }
.qr-big svg { width: 100%; height: 100%; display: block; }
.qr-zoom-card .code { font-size: 1.4rem; }
.scanner { position: relative; width: 100%; aspect-ratio: 1; max-height: 62vh; border-radius: 14px; overflow: hidden; background: #000; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .aim { position: absolute; inset: 16%; border: 3px solid rgb(255 255 255 / 0.9); border-radius: 18px; box-shadow: 0 0 0 999px rgb(0 0 0 / 0.35); }
.result.wait { background: var(--accent-soft); color: var(--ink); }

/* Painéis */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi .v { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 0.78rem; color: var(--muted); }
.kpi.strong { border-color: var(--accent); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; }
.mono { font-family: var(--font-mono); }
.typerow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 10px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.typerow:first-child { border-top: 0; }
@media (max-width: 640px) { .typerow { grid-template-columns: 1fr 1fr; } }
.empty { text-align: center; padding: 44px 20px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty h2 { color: var(--ink); font-size: 1.2rem; }
.big-input { font-family: var(--font-mono); font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase; }
.result { padding: 18px; border-radius: 12px; display: grid; gap: 4px; }
.result.ok { background: var(--ok-soft); color: var(--ok); }
.result.bad { background: var(--bad-soft); color: var(--bad); }
.result strong { font-family: var(--font-display); font-size: 1.4rem; }
details.panel summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }

#toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
#toast .t { padding: 11px 14px; border-radius: 10px; background: var(--ink); color: var(--surface); font-weight: 500; box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); }
#toast .t.bad { background: var(--bad); }
@media (prefers-reduced-motion: reduce) { .ticket { transition: none; } .ticket:hover { transform: none; } }
.pass-info .chip { white-space: normal; text-align: left; max-width: 100%; }
@media (max-width: 420px) { .qr { width: 100px; padding: 6px; } .pass { gap: 12px; padding: 12px; } }
/* Pagamento */
.paychoice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.paychoice label { position: relative; cursor: pointer; }
.paychoice input { position: absolute; opacity: 0; pointer-events: none; }
.paychoice span { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.paychoice small { color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.paychoice input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.paychoice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pixbox { width: min(260px, 100%); aspect-ratio: 1; padding: 10px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; justify-self: center; }
.pixbox img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#paybox { display: grid; gap: 12px; }
.lotbox { border-top: 1px solid var(--line); padding: 4px 0 8px; }
.lotbox:first-child { border-top: 0; }
.lotbox .typerow { border-top: 0; padding: 8px 0 0; }
.typerow.lotextra { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto auto; }
@media (max-width: 640px) { .typerow.lotextra { grid-template-columns: 1fr 1fr; } }

/* Login com Google */
.btn.google { width: 100%; background: #fff; color: #1F1F1F; border-color: #DADCE0; }
.btn.google:hover { border-color: #9AA0A6; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Instalar o app */
ol.steps { padding-left: 1.3em; margin: 8px 0; }
ol.steps li { margin: 6px 0; }

/* Cartão para compartilhar */
.share-box { display: grid; gap: 12px; margin-top: 8px; padding: 18px; border-radius: 14px; background: var(--accent-soft); }
.share-prev { display: flex; justify-content: center; }
.share-prev img { width: 100%; max-width: 340px; border-radius: 12px; box-shadow: 0 8px 24px rgba(10, 16, 60, 0.18); background: var(--surface-2); aspect-ratio: 1; }
.share-prev img[data-fmt="story"] { max-width: 220px; aspect-ratio: 9 / 16; }
