:root {
  --ink: #0f1533;
  --muted: #565d7d;
  --cobalt: #2340f5;
  --cobalt-deep: #1a2fc2;
  --paper: #f2f4fb;
  --card: #ffffff;
  --yellow: #ffd23f;
  --line: #d6dbee;
  --ok: #0e9f5b;
  --danger: #c62f3e;
  --radius: 14px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  padding-bottom: 88px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--cobalt); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); }
[hidden] { display: none !important; }

/* ---------- topo ---------- */
.topo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: var(--cobalt); color: #fff;
}
.marca { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: #fff; text-decoration: none; }
.topo-link { color: #fff; font-size: .9rem; font-weight: 600; text-underline-offset: 3px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px; border: 2px solid transparent; border-radius: 12px;
  font: 700 1rem var(--body); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-amarelo { background: var(--yellow); color: var(--ink); }
.btn-amarelo:hover { background: #ffdb62; }
.btn-azul { background: var(--cobalt); color: #fff; }
.btn-azul:hover { background: var(--cobalt-deep); }
.btn-azul:disabled { background: #9aa4e8; cursor: not-allowed; }
.btn-contorno { background: transparent; color: var(--cobalt); border-color: var(--cobalt); }
.btn-contorno:hover { background: #e8ecff; }
.btn-texto { background: none; border: 0; padding: 8px 4px; font: 600 .9rem var(--body); color: var(--muted); text-decoration: underline; cursor: pointer; }

/* ---------- hero ---------- */
.hero {
  background: var(--cobalt); color: #fff;
  display: grid; gap: 32px; padding: 28px 20px 56px;
  max-width: none;
}
.hero h1 { font-size: clamp(2.4rem, 9vw, 4.6rem); font-weight: 800; }
.hero-sub { margin: 18px 0 24px; font-size: 1.08rem; max-width: 34em; color: #e4e9ff; }
.hero-data { margin-top: 14px; font-weight: 600; }

.progresso { margin-bottom: 26px; max-width: 460px; }
.progresso-barra { height: 14px; background: rgba(255,255,255,.22); border-radius: 99px; overflow: hidden; }
.progresso-barra span { display: block; height: 100%; background: var(--yellow); border-radius: 99px; transition: width .6s ease; min-width: 6px; }
.progresso-txt { margin-top: 8px; font-size: .95rem; color: #e4e9ff; }
.progresso-txt strong { color: #fff; font-size: 1.05rem; }

.hero-visual { display: flex; justify-content: center; align-items: center; }
.premio-foto { max-width: min(380px, 80%); height: auto; border-radius: 20px; }

.celular {
  width: 210px; height: 400px; border-radius: 38px; background: var(--ink);
  padding: 12px; position: relative; transform: rotate(5deg);
  box-shadow: 14px 18px 0 rgba(15, 21, 51, .35);
}
.celular-ilha { position: absolute; top: 20px; left: 50%; width: 62px; height: 18px; margin-left: -31px; background: #000; border-radius: 99px; z-index: 2; }
.celular-tela {
  width: 100%; height: 100%; border-radius: 28px; background: var(--paper);
  padding: 46px 14px 18px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; align-content: start;
}
.celular-tela i { aspect-ratio: 1 / 1.15; border-radius: 4px; background: #fff; border: 1.5px solid var(--line); }
.celular-tela i.on { background: var(--cobalt); border-color: var(--cobalt); }

/* ---------- bilhetes de preço ---------- */
.precos { display: grid; gap: 14px; padding: 0 20px; margin-top: -30px; position: relative; max-width: 980px; margin-left: auto; margin-right: auto; }
.bilhete {
  background: var(--card); padding: 20px 26px; text-align: left;
  -webkit-mask: radial-gradient(circle 11px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 11px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 11px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 11px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
  border-radius: 10px;
}
.bilhete-faixa { font-weight: 600; color: var(--muted); border-bottom: 2px dashed var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.bilhete-preco { font: 800 2.3rem/1 var(--display); letter-spacing: -.02em; }
.bilhete-preco small { font: 600 1rem var(--body); color: var(--muted); letter-spacing: 0; }
.bilhete-nota { margin-top: 8px; font-weight: 600; color: var(--ok); }
.bilhete-destaque { background: var(--yellow); }
.bilhete-destaque .bilhete-faixa { color: var(--ink); border-color: rgba(15,21,51,.3); }
.bilhete-destaque .bilhete-preco small { color: var(--ink); }
.bilhete-destaque .bilhete-nota { color: var(--ink); }

/* ---------- compra ---------- */
.comprar { max-width: 1120px; margin: 0 auto; padding: 56px 20px 24px; }
.comprar h2, .como h2, .regras h2 { font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 800; }
.comprar-grade { display: grid; gap: 28px; }

.qtd-bloco { margin: 22px 0 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.qtd-bloco label { display: block; font-weight: 600; margin-bottom: 10px; }
.stepper { display: flex; align-items: stretch; gap: 8px; }
.stepper button {
  width: 56px; min-height: 56px; border-radius: 12px; border: 2px solid var(--cobalt); background: #fff; color: var(--cobalt);
  font: 700 1.6rem var(--body); cursor: pointer;
}
.stepper button:active { background: #e8ecff; }
.stepper input {
  flex: 1; min-width: 0; text-align: center; font: 800 1.9rem var(--display); color: var(--ink);
  border: 2px solid var(--line); border-radius: 12px; background: #fff; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.atalhos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.atalho { min-height: 42px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font: 700 .95rem var(--body); color: var(--ink); cursor: pointer; }
.atalho:hover { border-color: var(--cobalt); color: var(--cobalt); }
.dica { margin-top: 12px; font-size: .95rem; color: var(--muted); }
.dica button { background: none; border: 0; padding: 0; font: 700 .95rem var(--body); color: var(--cobalt); text-decoration: underline; cursor: pointer; }
.dica.ok { color: var(--ok); font-weight: 600; }

.grade-controles { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.grade-controles .btn { min-height: 46px; padding: 0 18px; font-size: .95rem; }

.navegacao { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin-bottom: 14px; }
.navegacao label { font-size: .9rem; font-weight: 600; color: var(--muted); }
.navegacao select, .navegacao input {
  min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; font: 600 1rem var(--body); color: var(--ink);
}

.legenda { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 0 0 14px; font-size: .88rem; color: var(--muted); }
.legenda li { display: flex; align-items: center; gap: 6px; }
.chip { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1.5px solid var(--line); background: #fff; }
.chip.sel { background: var(--cobalt); border-color: var(--cobalt); }
.chip.res { background: repeating-linear-gradient(45deg, var(--yellow) 0 3px, #fff3bd 3px 6px); border-color: #e0b520; }
.chip.pago { background: #dfe2ee; border-color: #dfe2ee; }

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 7px; }
.num {
  min-height: 44px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: 600 .95rem var(--body); font-variant-numeric: tabular-nums; cursor: pointer; padding: 0;
}
.num:hover:not(:disabled) { border-color: var(--cobalt); }
.num[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.num.res { background: repeating-linear-gradient(45deg, var(--yellow) 0 4px, #fff3bd 4px 8px); border-color: #e0b520; color: #6b5200; cursor: not-allowed; }
.num.pago { background: #e6e8f2; border-color: #e6e8f2; color: #9aa0b8; text-decoration: line-through; cursor: not-allowed; }
.num.destaque { animation: pulso 1.2s ease 2; }
@keyframes pulso { 50% { box-shadow: 0 0 0 5px var(--yellow); } }

/* ---------- resumo ---------- */
.resumo { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; align-self: start; }
.resumo h2 { font-size: 1.4rem; margin-bottom: 14px; }
.resumo-linha { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.resumo-linha strong { color: var(--ink); }
.resumo-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; font-weight: 600; }
.resumo-total strong { font: 800 2rem var(--display); }
.resumo-eco { color: var(--ok); font-weight: 600; font-size: .95rem; }
.chips-sel { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; max-height: 150px; overflow: auto; }
.chips-sel span { background: #e8ecff; color: var(--cobalt-deep); font-weight: 700; font-size: .85rem; padding: 3px 9px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.chips-sel .vazio { background: none; color: var(--muted); font-weight: 500; padding: 0; }
.resumo .btn { width: 100%; }
.resumo-nota { margin-top: 12px; font-size: .85rem; color: var(--muted); }
#pagar-desktop { display: none; }

/* ---------- barra fixa (celular) ---------- */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(15, 21, 51, .08);
}
.barra div { display: flex; flex-direction: column; line-height: 1.2; }
.barra-qtd { font-size: .85rem; color: var(--muted); }
.barra strong { font: 800 1.35rem var(--display); }
.barra .btn { min-height: 48px; padding: 0 22px; }

/* ---------- seções finais ---------- */
.como, .regras { max-width: 760px; margin: 0 auto; padding: 40px 20px 8px; }
.como ol { margin: 18px 0 0; padding-left: 1.3em; display: grid; gap: 14px; font-size: 1.05rem; }
.como li::marker { font: 800 1.1rem var(--display); color: var(--cobalt); }
.regras p { margin-top: 12px; max-width: 65ch; }

.rodape { margin-top: 48px; padding: 32px 20px; background: var(--ink); color: #c9cfec; text-align: center; font-size: .9rem; display: grid; gap: 6px; }
.rodape strong { color: #fff; }
.rodape a { color: var(--yellow); }

/* ---------- diálogo ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; color: var(--ink); }
dialog::backdrop { background: rgba(15, 21, 51, .6); }
dialog form { padding: 24px 22px; display: grid; gap: 14px; }
dialog h2 { font-size: 1.6rem; }
.dlg-resumo { color: var(--muted); font-size: .95rem; }
dialog label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
dialog input {
  min-height: 50px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 14px; font: 500 1rem var(--body); color: var(--ink);
}
dialog input[aria-invalid="true"] { border-color: var(--danger); }
.form-erro { background: #fdeceb; color: var(--danger); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: .92rem; }
.dlg-acoes { display: flex; gap: 10px; margin-top: 6px; }
.dlg-acoes .btn { flex: 1; padding: 0 12px; }

/* ---------- aviso ---------- */
.aviso {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 40;
  max-width: min(440px, calc(100vw - 32px)); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .95rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* ---------- páginas internas (pedido, consulta) ---------- */
.pagina { max-width: 560px; margin: 0 auto; padding: 32px 20px 64px; }
.painel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.painel h1 { font-size: clamp(1.7rem, 6vw, 2.2rem); font-weight: 800; margin-bottom: 8px; }
.painel p + p { margin-top: 10px; }
.painel .btn { width: 100%; margin-top: 16px; }
.qr { display: block; width: min(260px, 100%); height: auto; margin: 18px auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.copia { width: 100%; min-height: 52px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 500 .8rem ui-monospace, Menlo, Consolas, monospace; color: var(--ink); background: var(--paper); word-break: break-all; resize: none; }
.tempo { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; font-weight: 600; color: var(--muted); }
.tempo strong { font: 800 1.6rem var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.selo { display: inline-block; padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .85rem; margin-bottom: 12px; background: #fff3bd; color: #6b5200; }
.selo.pago { background: #d9f4e6; color: #0b6b3c; }
.selo.erro { background: #fdeceb; color: var(--danger); }
.numeros-lista { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.numeros-lista span { background: var(--cobalt); color: #fff; font: 700 1.1rem var(--display); padding: 6px 14px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.form-simples { display: grid; gap: 14px; margin-top: 18px; }
.form-simples label { display: grid; gap: 6px; font-weight: 600; }
.form-simples input { min-height: 50px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 14px; font: 500 1rem var(--body); }
.pedido-card { border-top: 2px dashed var(--line); margin-top: 18px; padding-top: 14px; }
.pedido-card h2 { font-size: 1.1rem; margin-bottom: 6px; }

/* ---------- telas maiores ---------- */
@media (min-width: 720px) {
  .precos { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .topo { padding: 16px 48px; }
  .hero { grid-template-columns: 1.25fr .75fr; align-items: center; padding: 56px 48px 88px; gap: 48px; }
  .hero-visual { justify-self: center; }
  .celular { width: 250px; height: 480px; }
  .precos { margin-top: -46px; }
  .comprar-grade { grid-template-columns: 1fr 360px; gap: 40px; }
  .resumo { position: sticky; top: 20px; }
  #pagar-desktop { display: inline-flex; }
  .barra { display: none; }
  .aviso { bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
