/* Compra Direta · Sorteio
   Diretrizes 12–13/11/2026 + revisão ui-ux-pro-max:
   - azul em degradê domina; foto de Salvador só como textura (cinza, ~20%, mistura luminosidade)
   - degradê laranja no canto inferior esquerdo (BL→TR); nenhum texto pequeno em cima dele
   - texto branco/azul-gelo (contraste ≥ 4,5:1); laranja só em rota e contorno de ação
   - Montserrat (títulos/metadados) + Space Grotesk (apoio); grade de 12 colunas, unidade 8 px
   - um protagonista por tela; alvos de toque ≥ 56 px (60+ no tablet) */
@font-face { font-family: "Montserrat"; src: url("/fonts/Montserrat.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: dark;
  --az-1: #1F6B87;          /* topo do degradê (um passo abaixo de #21718E para o texto de apoio passar de 4,5:1) */
  --az-2: #185972;
  --az-3: #103F51;
  --petroleo: #0E3341;
  --laranja: #E9893F;
  --texto: #FFFFFF;
  --apoio: #D7E9EF;         /* 4,9:1 sobre --az-1 */
  --sup: rgba(8, 38, 50, .58);       /* superfície: azul mais escuro que o fundo (região comum) */
  --sup-2: rgba(8, 38, 50, .78);
  --linha: rgba(215, 233, 239, .2);
  --linha-forte: rgba(215, 233, 239, .38);
  --campo: rgba(4, 24, 33, .6);
  --erro: #FFB4A6;
  --erro-borda: rgba(255, 156, 138, .6);
  --ok: #8FE0B0;
  --qr-fundo: #E4EEF2;
  --raio: 20px;
  --t-titulo: "Montserrat", "Segoe UI", Arial, sans-serif;
  --t-texto: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --margem: clamp(16px, 5vw, 64px);
  --gutter: 24px;
  --sombra: none; /* superfícies com contorno definido; sem sombra difusa somada ao contorno */
  --ease: cubic-bezier(.215, .61, .355, 1); /* easeOutCubic: sem quique */
}

* { box-sizing: border-box; }
html { background: var(--az-3); }
html { background: linear-gradient(135deg, var(--az-1) 0%, var(--az-2) 50%, var(--az-3) 100%) var(--az-3); min-height: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--texto); font-family: var(--t-texto); font-size: 16px; line-height: 1.5;
  background: transparent; /* o degradê fica no html: sem background-attachment: fixed (falha no Safari iOS) */
  -webkit-font-smoothing: antialiased;
}
/* textura: foto já em cinza no arquivo; aqui só opacidade e mistura com o azul */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("/fundo.jpg") center / cover no-repeat; opacity: .2; mix-blend-mode: luminosity;
}
/* canto laranja: inferior esquerdo → some antes do centro */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to top right, rgba(233, 137, 63, .82) 0%, rgba(233, 137, 63, .32) 14%, rgba(233, 137, 63, 0) 34%);
}
body > * { position: relative; z-index: 1; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--t-titulo); font-weight: 800; letter-spacing: .012em; line-height: 1.06; margin: 0; }
a { color: var(--apoio); }

/* metadados: Montserrat 700, caixa alta, tracking largo, mínimo 13 px */
.meta, .event, th, .rotulo {
  font-family: var(--t-titulo); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--apoio);
}
.apoio { color: var(--apoio); }
.muted { color: var(--apoio); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- topo */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px var(--margem); }
.logo-img { height: 36px; width: auto; display: block; }
.event { text-align: right; line-height: 1.4; text-transform: none; letter-spacing: .02em; font-size: 14px; }
.event small { display: block; font-family: var(--t-texto); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; }
.topbar h1 { font-size: 20px; }

/* ---------- grade de 12 colunas */
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); padding: 0 var(--margem); max-width: 1280px; margin: 0 auto; }
.wrap { max-width: 680px; margin: 0 auto; padding: 24px 16px 56px; }
.card {
  background: var(--sup); border: 1px solid var(--linha); border-radius: var(--raio); padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--sombra); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* ---------- rota ponto–linha–ponto (só onde há percurso) */
.rota { position: relative; height: 2px; background: var(--linha); margin: 0 5px; border-radius: 2px; }
.rota > i { position: absolute; inset: 0; background: var(--laranja); border-radius: 2px; transform-origin: left center; transition: transform .6s var(--ease); }
.rota::before, .rota::after { content: ""; position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--laranja); }
.rota::before { left: 0; }
.rota::after { left: 100%; background: var(--az-3); box-shadow: inset 0 0 0 2px var(--linha-forte); transition: background .4s var(--ease), box-shadow .4s var(--ease); }
.rota.chegou::after { background: var(--laranja); box-shadow: none; }

/* ---------- botões · "barra editorial" (opção C, 13/11)
   principal: barra gelo, texto petróleo (11:1) à esquerda, seta à direita (laranja escurecido p/ 3:1 no gelo)
   secundário: contorno gelo; terciário: só texto com seta de volta. Uma ação principal por tela. */
.btn {
  --seta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 60px;
  border-radius: 10px; padding: 0 22px 0 26px; cursor: pointer; text-decoration: none; text-align: left;
  font-family: var(--t-titulo); font-weight: 700; font-size: 17px; letter-spacing: .01em;
  color: var(--petroleo); background: var(--qr-fundo); border: 0;
  box-shadow: 0 12px 28px rgba(3, 20, 28, .4); transition: background .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn::after {
  content: ""; flex: none; width: 22px; height: 22px; background: #B8612A;
  -webkit-mask: var(--seta) center / contain no-repeat; mask: var(--seta) center / contain no-repeat;
  transition: transform .25s var(--ease);
}
.btn:hover { background: #FFFFFF; }
.btn:hover::after { transform: translateX(4px); }
.btn:active { transform: translateY(1px); box-shadow: 0 6px 16px rgba(3, 20, 28, .4); }
.btn:focus-visible, .choice:focus-visible { outline: 3px solid var(--laranja); outline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled::after { display: none; }
.btn.block { width: 100%; }
/* carregando: anel no lugar da seta */
.btn.carregando:disabled { opacity: 1; cursor: progress; }
.btn.carregando::after { display: block; -webkit-mask: none; mask: none; background: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--petroleo); border-right-color: transparent; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
/* secundário: contorno */
.btn.ghost { color: var(--texto); background: transparent; box-shadow: inset 0 0 0 1.5px rgba(228, 238, 242, .5); padding: 0 26px; justify-content: center; }
.btn.ghost::after { display: none; }
.btn.ghost:hover { background: rgba(228, 238, 242, .08); box-shadow: inset 0 0 0 1.5px rgba(228, 238, 242, .8); }
/* terciário: texto com seta de volta */
.btn.texto { color: var(--apoio); background: none; box-shadow: none; min-height: 48px; padding: 0 4px; gap: 10px; flex-direction: row-reverse; justify-content: flex-end; font-size: 16px; }
.btn.texto::after { background: var(--apoio); transform: scaleX(-1); width: 20px; height: 20px; }
.btn.texto:hover { color: var(--texto); background: none; }
.btn.texto:hover::after { transform: scaleX(-1) translateX(4px); background: var(--texto); }

/* ---------- formulário */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 15px; font-weight: 500; color: var(--apoio); margin-bottom: 8px; }
.field input, .field select {
  width: 100%; min-height: 54px; padding: 14px 16px; border-radius: 12px; font-size: 17px;
  background: var(--campo); color: var(--texto); border: 1px solid var(--linha-forte);
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: rgba(215, 233, 239, .66); }
.field select option { background: var(--az-3); color: var(--texto); }
.field input:focus, .field select:focus { outline: none; border-color: var(--laranja); box-shadow: 0 0 0 3px rgba(233, 137, 63, .25); }
.field.invalid input, .field.invalid select { border-color: var(--erro-borda); }
.field .err { color: var(--erro); font-size: 14px; margin-top: 6px; }
.field .err:empty { display: none; }
.row { display: grid; grid-template-columns: 1fr 116px; gap: 12px; }
.question { position: relative; border-top: 1px solid var(--linha-forte); padding-top: 18px; margin: 26px 0 8px; }
.question p { margin: 0 0 12px; font-family: var(--t-titulo); font-weight: 700; font-size: 18px; line-height: 1.4; }
.question p.dica { font-family: var(--t-texto); font-weight: 400; font-size: 14px; line-height: 1.5; color: var(--apoio); margin: 8px 0 0; }
.alert .links a { white-space: nowrap; }
.consent.opcional { margin-top: -8px; }
.consent em { font-style: normal; opacity: .8; }
.consent .err { display: inline; margin: 0; }
.question .field { margin: 0; }
.consent { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; color: var(--apoio); margin: 20px 0 24px; cursor: pointer; min-height: 44px; }
.consent input { width: 24px; height: 24px; margin: 1px 0 0; flex: none; accent-color: var(--laranja); }
.consent.invalid span { color: var(--erro); }

/* consulta "já participou?" */
.consulta { margin-top: 18px; border-top: 1px solid var(--linha); padding-top: 12px; }
.consulta [data-consulta-corpo] { display: grid; gap: 14px; margin-top: 14px; }
/* resumo de erros no topo, com foco após envio inválido */
.alert {
  display: none; padding: 14px 18px; border-radius: 14px; font-size: 15px; margin-bottom: 20px;
  background: rgba(120, 30, 20, .35); border: 1px solid var(--erro-borda); color: var(--erro);
}
.alert.show { display: block; }
.alert:focus { outline: 2px solid var(--erro); outline-offset: 2px; }
.alert ul { margin: 8px 0 0; padding-left: 18px; }
.alert a { color: var(--erro); }
.timer { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.timer .rota { flex: 1; }
.timer b { font-family: var(--t-titulo); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 16px; }

/* ---------- cartão de embarque (resultado) */
.pass {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px); background: var(--sup); border: 1px solid var(--linha); border-radius: 24px;
  box-shadow: var(--sombra); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden;
}
.pass .main { padding: clamp(22px, 3.4vw, 40px); min-width: 0; }
.pass .stub { padding: clamp(22px, 3.4vw, 40px) clamp(18px, 2.4vw, 32px); border-left: 2px dashed var(--linha-forte); display: grid; align-content: space-between; gap: 18px; min-width: 150px; }
.pass .stub .valor { font-family: var(--t-titulo); font-weight: 800; font-size: 20px; margin-top: 4px; overflow-wrap: anywhere; }
.pass h2 { font-size: clamp(26px, 4vw, 36px); margin-top: 6px; }
.pass .nota { color: var(--apoio); margin: 18px 0 0; }
.valor-grande { font-family: var(--t-titulo); font-weight: 800; font-size: clamp(24px, 3vw, 32px); margin-top: 6px; overflow-wrap: anywhere; }
.lucky { display: flex; gap: .06em; margin: 6px 0 18px; font-family: var(--t-titulo); font-weight: 900; font-size: clamp(52px, 9vw, 88px); line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.lucky span { display: block; }
.result:not(.pass) { padding: 6px 0; }
.result h2 { margin-bottom: 8px; }
.result p { color: var(--apoio); }

@media (max-width: 520px) {
  .pass { grid-template-columns: 1fr; }
  .pass .stub { border-left: 0; border-top: 2px dashed var(--linha-forte); grid-auto-flow: column; align-content: center; justify-content: space-between; }
  .row { grid-template-columns: 1fr 100px; }
  .logo-img { height: 28px; }
  .event { letter-spacing: .06em; max-width: 60%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } .btn.carregando::after { animation-duration: 2.4s; } }
