/* Funil mobile-first. Cores e fontes vêm do tema da marca (config/brands/<marca>.js → theme), aplicado
   pelo app.js nestas variáveis. Os valores abaixo são só o padrão antes do /api/config responder
   (mesma paleta preto e dourado da Betel-JB). */
:root {
  --color-primary: #f0a81c;
  --color-on-primary: #0b0b0b;
  --color-secondary: #1f1f1f;
  --color-accent: #f6c453;
  --color-bg: #0b0b0b;
  --color-text: #f5f1e6;
  --color-muted: #c9c1ae;
  --color-surface: #161616;
  --color-border: #7a6f5a;
  /* Avisos: fundos escuros com o texto claro do tema (erro com borda avermelhada para não perder o sentido). */
  --color-error-bg: #2a1512;
  --color-error: #e5695a;
  --color-warn-bg: #241d0c;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-logo: Georgia, "Times New Roman", serif;
  --radius: 16px;
  --shadow: 0 6px 20px rgb(0 0 0 / 45%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.45;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-text-size-adjust: 100%;
}

:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* ---------- Cabeçalho: logo/nome em dourado sobre preto, capa opcional e etapas ---------- */
.brand-header {
  background: var(--color-bg);
  color: var(--color-text);
  border-bottom: 3px solid var(--color-primary);
}
.brand-header.has-cover {
  background-image: linear-gradient(rgb(0 0 0 / 55%), rgb(0 0 0 / 55%)), var(--cover-image);
  background-size: cover;
  background-position: center;
}
.brand-header-inner { max-width: 420px; margin: 0 auto; padding: 16px 16px 18px; }
/* Altura do logo reservada (104px) para o texto de reserva não fazer o layout pular quando a imagem entra. */
.brand-logo { margin: 0 0 14px; min-height: 104px; display: flex; align-items: center; justify-content: center; text-align: center; }
.brand-logo img { display: block; width: 104px; height: 104px; object-fit: contain; margin: 0 auto; }
.brand-logo img[hidden], .brand-logo-text[hidden] { display: none; }
/* Frase e selo da página inicial, abaixo do logo (como no site antigo). */
.brand-tagline { margin: 0 0 10px; text-align: center; color: var(--color-muted); }
.brand-seal {
  display: table; margin: 0 auto; padding: 4px 14px; border: 1px solid var(--color-primary); border-radius: 999px;
  background: var(--color-surface); color: var(--color-accent); font-size: 0.85rem; font-weight: 800; text-align: center;
}
/* Textos de marca "a confirmar" (public/shared/site-texts.js) e busca de CEP da home em marca de uma loja só. */
.brand-tagline[hidden], .brand-seal[hidden], .site-footer p[hidden], .home-section[hidden] { display: none; }
/* Nome da marca em texto (reserva se o logo não carregar): serifada forte, dourado sobre preto. */
.brand-logo-text {
  display: inline-block; font-family: var(--font-logo); font-size: 1.75rem; font-weight: 900; line-height: 1.1;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-primary);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-logo-text {
    background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-primary) 70%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}

.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  font-size: 0.8rem; font-weight: 700; text-align: center;
}
.steps li { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--color-muted); }
.step-dot {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid currentColor; font-size: 0.95rem;
}
.steps li[aria-current="step"] { color: var(--color-accent); }
.steps li[aria-current="step"] .step-dot { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-primary); }
.steps li.done { color: var(--color-primary); }
.steps li.done .step-dot { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }

/* ---------- Telas ---------- */
#app { max-width: 420px; margin: 0 auto; padding: 20px 16px 48px; }

.screen { display: flex; flex-direction: column; gap: 18px; }
.screen[hidden] { display: none; }

h1, h2, h3 { line-height: 1.15; }
h2 { font-size: 1.5rem; margin: 4px 0 0; }

.hero {
  background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 18px; text-align: center; border-top: 6px solid var(--color-primary);
}
.hero-kicker { margin: 0; font-weight: 700; color: var(--color-primary); text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.04em; }
.hero-title { font-size: 2rem; margin: 6px 0 10px; font-weight: 800; }
.tagline { margin: 0 0 14px; color: var(--color-muted); }
.hero-prizes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero-prizes li {
  background: var(--color-accent); color: var(--color-on-primary); font-weight: 700; font-size: 0.9rem;
  padding: 6px 12px; border-radius: 999px;
}

form { display: flex; flex-direction: column; gap: 16px; }
.options { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 14px;
  background: var(--color-surface); border: 2px solid var(--color-border); border-radius: 12px; font-weight: 700; cursor: pointer;
}
.option input { width: 22px; height: 22px; margin: 0; accent-color: var(--color-primary); }
.option:has(input:checked) { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary) inset; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.field[hidden] { display: none; }
.field input {
  font: inherit; font-size: 1.15rem; font-weight: 500; min-height: 54px; padding: 12px 14px;
  border: 2px solid var(--color-border); border-radius: 12px; background: var(--color-surface); color: var(--color-text);
}
.field input::placeholder { color: var(--color-muted); opacity: 0.8; }
.field input:focus { border-color: var(--color-primary); outline: 3px solid var(--color-accent); outline-offset: 0; }
.consent {
  display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem;
  background: var(--color-surface); padding: 12px 14px; border-radius: 12px;
}
.consent input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--color-primary); }
.consent a { color: var(--color-primary); font-weight: 700; }

/* ---------- Botões (grandes, área de toque ≥ 48px): dourado com texto escuro ---------- */
.primary {
  font: inherit; font-weight: 800; font-size: 1.15rem; min-height: 56px; padding: 14px 18px; border: 0;
  border-radius: 14px; background: var(--color-primary); color: var(--color-on-primary); cursor: pointer;
  box-shadow: 0 4px 0 rgb(0 0 0 / 60%), 0 0 0 1px var(--color-accent) inset;
}
.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 rgb(0 0 0 / 60%), 0 0 0 1px var(--color-accent) inset; }
.primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.primary[hidden] { display: none; }
.big { width: 100%; font-size: 1.25rem; min-height: 60px; }

.secondary {
  font: inherit; font-weight: 700; min-height: 48px; padding: 10px 16px; border: 2px solid var(--color-primary);
  border-radius: 12px; background: var(--color-surface); color: var(--color-primary); cursor: pointer;
}
.secondary:disabled { opacity: 0.6; cursor: not-allowed; }
.secondary[hidden] { display: none; }
.link-button { display: block; text-align: center; text-decoration: none; }

/* ---------- Avisos: erro, fora da área (warn) e encaminhamento (info) ---------- */
.message {
  margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--color-surface); color: var(--color-text);
  border-left: 6px solid var(--color-accent); font-weight: 500;
}
.message[hidden] { display: none; }
.message.error { background: var(--color-error-bg); border-left-color: var(--color-error); }
.message.warn { background: var(--color-warn-bg); border-left-color: var(--color-primary); }
.message.info { background: var(--color-surface); border-left-color: var(--color-primary); box-shadow: var(--shadow); }
/* Gire e Ganhe só na Betel Joana Bezerra: aviso fixo do passo 1 e destaque no cupom (dourado sobre o cartão). */
.exclusive-notice {
  display: flex; flex-direction: column; gap: 4px; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px;
  background: var(--color-surface); border: 2px solid var(--color-primary); color: var(--color-text);
}
.exclusive-notice strong { color: var(--color-primary); font-size: 1.05rem; }
.exclusive-notice span:empty { display: none; }
.coupon-store {
  margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--color-primary);
  color: var(--color-primary); font-weight: 800; text-align: center;
}
.destinations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.destinations li { background: var(--color-surface); border-radius: 12px; padding: 12px 14px; }
.destinations li:has(a) { padding: 0; background: none; }

/* ---------- Roleta: fatias dourado, grafite e dourado claro, aro dourado ---------- */
#wheel-title { text-align: center; font-size: 1.75rem; color: var(--color-primary); }
.wheel-wrap { position: relative; width: min(84vw, 320px); aspect-ratio: 1; margin: 8px auto 0; }
.wheel {
  width: 100%; height: 100%; border-radius: 50%; border: 8px solid var(--color-primary);
  background: var(--color-secondary); box-shadow: var(--shadow), 0 0 0 4px var(--color-accent);
  transition: transform 4.2s cubic-bezier(0.12, 0.7, 0.18, 1);
  will-change: transform;
}
.wheel-svg { display: block; width: 100%; height: 100%; }
.slice { stroke: var(--color-bg); stroke-width: 2; }
.slice-label { font: 800 14px var(--font-body); }
.bulb { fill: var(--color-text); opacity: 0.9; }
.wheel-hub {
  position: absolute; top: 50%; left: 50%; width: 18%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--color-bg); border: 4px solid var(--color-accent);
}
.pointer {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent;
  border-top: 30px solid var(--color-accent);
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 60%));
}
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 0.9rem; }
.legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--color-border); }

/* ---------- Tela 5: cupom em destaque, validade e mínimo, CTA grande ---------- */
.prize-heading { text-align: center; font-size: 2rem; color: var(--color-primary); margin-top: 0; }
.prize-heading.celebrate { animation: pop 0.5s ease-out; }
@keyframes pop { 0% { transform: scale(0.7); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

.result {
  position: relative; background: var(--color-surface); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border-top: 8px solid var(--color-primary);
}
.coupon-expired { border-top-color: var(--color-border); }
.coupon-kicker { margin: 0; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }
.result h3 { margin: 2px 0 12px; font-size: 1.6rem; }
.result dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 14px 0 0; font-size: 0.95rem; }
.result dt { font-weight: 700; }
.result dd { margin: 0; }
.coupons { display: flex; flex-direction: column; gap: 14px; }

.code-row {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 14px; border: 3px dashed var(--color-primary); border-radius: 14px; background: var(--color-bg);
  text-align: center;
}
.code-caption { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }
.coupon-code {
  font: 800 2rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; color: var(--color-accent);
  word-break: break-all; user-select: all;
}
.copy { width: 100%; font-size: 1.1rem; }
.copy-feedback { font-size: 0.9rem; font-weight: 700; color: var(--color-accent); min-height: 1.2em; }

.facts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px;
  background: var(--color-bg); border: 1px solid var(--color-border);
}
.fact-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); }
.fact strong { font-size: 1rem; }
.fact.urgency strong { color: var(--color-primary); }
.fact.urgency.expired { background: var(--color-secondary); }
.fact.urgency.expired strong { color: var(--color-muted); }

.cta { display: block; width: 100%; text-align: center; text-decoration: none; font-size: 1.35rem; padding: 18px; min-height: 64px; }
.cta[aria-disabled="true"] { opacity: 0.45; pointer-events: none; box-shadow: none; }
.gift { width: 100%; border-style: dashed; }
.note { margin: 0; font-size: 0.9rem; color: var(--color-muted); }
.note[hidden] { display: none; }

/* ---------- Página inicial: CEP → loja mais perto, cartões das lojas, acesso aos prêmios ---------- */
.home { overflow-x: hidden; }
.home-section { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.home-section:focus { outline: none; }
/* Faixa larga da foto logo abaixo do cabeçalho: proporção fixa reservada (sem pular o layout) e recorte por
   object-fit, sem deformar no celular. */
.home-photo { margin: 0 auto; max-width: 960px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--color-surface); }
.home-photo[hidden] { display: none; }
.home-photo img { display: block; width: 100%; max-width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.home-title { font-size: 1.75rem; margin: 0; color: var(--color-primary); }
.home-sub { display: block; margin-top: 8px; font-size: 1.05rem; font-weight: 500; color: var(--color-text); }
.locate-form { gap: 12px; }
.countdown { margin: 0 0 12px; font-weight: 700; color: var(--color-accent); }
.found h2 { margin: 2px 0 8px; }
.found-actions { display: flex; flex-direction: column; gap: 10px; }
.found-actions .secondary { width: 100%; }
.store-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.store-card {
  background: var(--color-surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  border-top: 6px solid var(--color-primary); overflow-wrap: anywhere;
}
.store-head { display: flex; gap: 12px; align-items: flex-start; }
.store-info { flex: 1; min-width: 0; }
.store-thumb { flex: none; display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--color-bg); }
.store-card h3 { margin: 0 0 6px; font-size: 1.35rem; }
.store-card p { margin: 0 0 4px; }
.store-area { font-weight: 700; color: var(--color-muted); }
.store-status { display: inline-block; margin-top: 6px !important; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 0.9rem; }
.status-open { background: var(--color-accent); color: var(--color-on-primary); }
.status-closed { background: var(--color-secondary); color: var(--color-text); }
.status-unknown { background: var(--color-bg); color: var(--color-muted); border: 1px solid var(--color-border); }
.store-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.store-actions .link-button { width: 100%; min-height: 48px; }
.promo .link-button { width: 100%; }
.site-footer { max-width: 420px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; color: var(--color-muted); }
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--color-primary); font-weight: 700; display: inline-block; min-height: 44px; padding: 10px 4px; }
.footer-tagline { font-weight: 700; color: var(--color-text); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 480px) {
  .hero-title { font-size: 2.3rem; }
  .brand-logo-text { font-size: 2rem; }
  .home-photo { aspect-ratio: 21 / 9; }
}
@media (min-width: 960px) {
  .home-photo { margin-top: 16px; border-radius: var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
  .wheel { transition: none; }
  .prize-heading.celebrate { animation: none; }
  .primary:active { transform: none; }
}
