/* autoriza-tsj — tokens e componentes base (DESIGN.md §2–§5). Toda cor sai de um token. */
:root {
  --bg: #1b0a10; --surface: #27121b; --surface-2: #331826;
  --fg: #f7ebe8; --muted: #b99aa3; --line: rgba(255, 255, 255, .11);
  /* borda de campo: ≥ 3:1 contra o fundo (WCAG 1.4.11), mais forte que a --line decorativa */
  --field-line: rgba(247, 235, 232, .42);
  --accent: #ff7a1a; --accent-fg: #1b0a10;
  --ok: #4fd18b; --warn: #ffc857; --bad: #ff5c6c; --info: #7fb3ff; --wa: #25d366;
  --ok-bg: rgba(79, 209, 139, .14); --warn-bg: rgba(255, 200, 87, .14);
  --bad-bg: rgba(255, 92, 108, .14); --info-bg: rgba(127, 179, 255, .14);
  --paper: #ffffff; --paper-fg: #1b0a10;
  /* herói do evento: vinho do flyer nos dois temas */
  --hero-a: #5a0c22; --hero-b: #2a0712; --hero-fg: #f7ebe8; --hero-muted: #e9cfd3; --hero-glow: #ff7a1a;
  --radius-s: 8px; --radius: 12px; --radius-l: 16px;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, sans-serif;
  --gutter: 16px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbf3f0; --surface: #ffffff; --surface-2: #f3e6e3;
  --fg: #2b0f18; --muted: #7c5c65; --line: rgba(43, 15, 24, .13); --field-line: rgba(43, 15, 24, .52);
  --accent: #b04700; --accent-fg: #ffffff;
  --ok: #13733c; --warn: #855400; --bad: #b3202f; --info: #1f5fb8; --wa: #0f7336;
  --ok-bg: rgba(19, 115, 60, .1); --warn-bg: rgba(133, 84, 0, .1);
  --bad-bg: rgba(179, 32, 47, .1); --info-bg: rgba(31, 95, 184, .1);
  color-scheme: light;
}
/* Sem JS não há data-theme: segue o sistema. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #fbf3f0; --surface: #ffffff; --surface-2: #f3e6e3;
    --fg: #2b0f18; --muted: #7c5c65; --line: rgba(43, 15, 24, .13); --field-line: rgba(43, 15, 24, .52);
    --accent: #b04700; --accent-fg: #ffffff;
    --ok: #13733c; --warn: #855400; --bad: #b3202f; --info: #1f5fb8; --wa: #0f7336;
    --ok-bg: rgba(19, 115, 60, .1); --warn-bg: rgba(133, 84, 0, .1);
    --bad-bg: rgba(179, 32, 47, .1); --info-bg: rgba(31, 95, 184, .1);
    color-scheme: light;
  }
}
@media (min-width: 480px) { :root { --gutter: 20px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 16px/1.5 var(--body);
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.15; }
h2 { font-size: 1.125rem; font-weight: 700; }
h3 { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.ico { flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 50; background: var(--accent); color: var(--accent-fg);
  padding: 10px 14px; border-radius: var(--radius-s); font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }

.wrap { max-width: 600px; margin: 0 auto; padding: 0 var(--gutter) 48px; }

/* barra do topo */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 10px; }
.brand { display: inline-flex; align-items: center; gap: .3em; min-height: 44px; font: 700 .8125rem var(--display); letter-spacing: .02em; color: var(--fg); text-decoration: none; }
.brand b { color: var(--accent); font-weight: 900; }
.theme-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: transparent; color: var(--fg); border-radius: 999px; cursor: pointer;
  transition: background-color .18s ease, transform .12s ease; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { background: var(--surface); }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }

/* herói em forma de ingresso: corpo + canhoto, com picote */
.ticket { border-radius: var(--radius-l); overflow: hidden; color: var(--hero-fg);
  background: linear-gradient(160deg, var(--hero-a), var(--hero-b) 72%); position: relative; isolation: isolate; }
.ticket::after { content: ""; position: absolute; right: -36px; top: -36px; width: 150px; height: 150px; z-index: -1;
  border-radius: 50%; background: radial-gradient(circle, var(--hero-glow) 0%, rgba(255, 122, 26, 0) 70%); opacity: .65; }
.ticket-main { display: grid; gap: 10px; padding: 22px 20px 26px; }
.ticket-main .eyebrow { color: #ffb06b; }
.ticket h1 { font-size: 1.625rem; font-weight: 900; color: #fff; letter-spacing: -.01em; }
.ticket-stub { position: relative; display: grid; gap: 8px; padding: 18px 20px 20px; background: rgba(0, 0, 0, .22);
  border-top: 2px dashed rgba(247, 235, 232, .28); font-size: .9375rem; color: var(--hero-muted); }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--bg); }
.ticket-stub::before { left: -11px; }
.ticket-stub::after { right: -11px; }
.meta-line { display: flex; align-items: center; gap: 10px; }
.meta-line .ico { color: #ffb06b; }

main { display: grid; gap: 28px; }
section { display: grid; gap: 14px; }
.stack { display: grid; gap: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px; display: grid; gap: 12px; }
.card h2 { font-size: 1rem; }
.card.accent { border-color: var(--accent); }

.audiences { display: grid; gap: 12px; }
@media (min-width: 560px) { .audiences { grid-template-columns: 1fr 1fr; } }
.age { font: 900 2rem/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card.accent .age { color: var(--accent); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: passo; }
.steps li { counter-increment: passo; display: grid; grid-template-columns: 44px 1fr; gap: 4px 14px;
  padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.steps li:first-child { border-top: 0; padding-top: 4px; }
.steps li::before { content: counter(passo, decimal-leading-zero); grid-row: span 2; font: 700 1.125rem/1.2 var(--display);
  color: var(--accent); font-variant-numeric: tabular-nums; }
.steps b { font-weight: 700; }
.steps span { color: var(--muted); font-size: .9375rem; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; width: 100%;
  border: 1px solid transparent; border-radius: var(--radius); padding: 12px 18px; cursor: pointer; text-decoration: none;
  font: 700 .9375rem var(--body); background: var(--accent); color: var(--accent-fg);
  transition: filter .18s ease, transform .12s ease, background-color .18s ease; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.sm { width: auto; min-height: 44px; padding: 9px 14px; font-size: .875rem; border-radius: 10px; }

.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 12px 14px; font-size: .9375rem; }
.notice .ico { margin-top: 2px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.info { background: var(--info-bg); color: var(--info); }
.notice.plain { background: var(--surface-2); color: var(--fg); }

.footer { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; display: grid; gap: 6px; font-size: .8125rem; color: var(--muted); }
.footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; justify-self: start; }

/* página de erro / vazio */
.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 40px 12px 24px; }
.empty svg.art { width: 120px; height: 120px; color: var(--accent); }
.empty .code { font: 900 .75rem var(--display); letter-spacing: .2em; color: var(--muted); }

.prose { display: grid; gap: 12px; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.prose h2 { margin-top: 8px; }

@media (min-width: 900px) {
  .wrap { padding-bottom: 72px; }
  .ticket h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
.h-page { font-size: 1.375rem; font-weight: 900; }
.btn.narrow { max-width: 280px; }
