/* =========================================================
   Quiz Funil — sistema de componentes
   Troque as cores e a fonte só aqui em :root.
   ========================================================= */

:root {
  /* Cores da marca */
  --accent: #E48E16;          /* cor principal: botões, destaques, progresso */
  --accent-hover: #C4780A;    /* botão ao passar o mouse / pressionar */
  --accent-disabled: #F1C99A; /* botão desabilitado (sólido, sem transparência) */
  --accent-soft: #FCEBD5;    /* fundo de opção selecionada */
  --accent-tint: #FFF4E8;     /* fundo de opção normal */
  --accent-border: #F2CFA0;   /* borda de opção normal */

  /* Neutros */
  --bg: #FFFAF5;              /* fundo da página */
  --surface: #FFFFFF;         /* fundo de inputs e cartões */
  --heading: #030712;         /* títulos */
  --text: #6B7280;            /* texto corrido */
  --muted: #9CA3AF;           /* legendas, rodapé */
  --line: #E7E2DC;            /* bordas neutras, trilho da barra */

  /* Feedback */
  --good: #16A34A;
  --good-text: #0B6E2D;
  --good-bg: #CAFCD0;
  --good-border: #9AF3A8;
  --bad: #EC1129;
  --bad-text: #EC1129;
  --bad-bg: #FFE6E3;
  --bad-border: #FECDC8;

  /* Tipografia */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --h1: clamp(26px, 6.5vw, 32px);
  --h2: clamp(22px, 5.5vw, 26px);

  /* Forma */
  --radius: 24px;             /* botões, inputs, cartões */
  --radius-sm: 12px;
  --control-h: 56px;          /* altura de botões e inputs */
  --col: 480px;               /* largura máxima da coluna */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

/* ---------- Layout ---------- */
.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.container {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 16px;
}
.steps { flex: 1; display: flex; flex-direction: column; }
.step[hidden] { display: none; }
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 32px;
  animation: step-in .35s ease both;
}
.step--top { justify-content: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }

@keyframes step-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Topo: voltar + barra de progresso ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-top: 16px;
  padding-bottom: 8px;
}
.topbar__inner {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
}
.back {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; background: none; border-radius: 50%;
  color: var(--heading);
  cursor: pointer;
}
.back:hover { background: var(--accent-tint); }
.back[hidden] { visibility: hidden; display: grid; }
.back svg { width: 20px; height: 20px; }

.progress {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: var(--value, 0%);
  background: var(--accent);
  border-radius: inherit;
  transition: width .4s ease;
}

/* ---------- Textos ---------- */
.title {
  margin: 0;
  color: var(--heading);
  font-size: var(--h1);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
}
.title--sm { font-size: var(--h2); }
.hl { color: var(--accent); }                 /* destaque colorido dentro do título */
.lead {
  margin: 0;
  text-align: center;
  font-size: 16px;
  line-height: 1.45;
  text-wrap: pretty;
}
.lead strong { color: var(--heading); font-weight: 600; }
/* texto corrido escuro, para telas educativas */
.prose { display: flex; flex-direction: column; gap: 12px; text-align: center; color: var(--heading); font-size: 16px; line-height: 1.45; }
.prose p { margin: 0; text-wrap: pretty; }
.prose strong { font-weight: 700; }

/* imagem dentro do conteúdo */
.media { width: 100%; height: auto; border-radius: var(--radius); background: var(--accent-tint); }

/* lista de fases numeradas em destaque */
.phases {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

.caption {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Botão principal (CTA) ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: var(--control-h);
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: background .2s, transform .1s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { background: var(--accent-disabled); cursor: not-allowed; transform: none; animation: none; }
.btn:focus-visible { outline: 3px solid var(--accent-border); outline-offset: 2px; }
.btn--pulse { animation: pulse 2s infinite; }

/* botão que fica preso no rodapé da tela em listas longas */
.sticky-cta {
  position: sticky;
  bottom: 0;
  margin: 0 -16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(255, 250, 245, 0), var(--bg) 35%);
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(228, 142, 22, .45); }
  70%  { box-shadow: 0 0 0 14px rgba(228, 142, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(228, 142, 22, 0); }
}

/* ---------- Opções de resposta ---------- */
.options { display: flex; flex-direction: column; gap: 10px; }

.option {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: var(--control-h);
  padding: 12px 16px;
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius);
  background: var(--accent-tint);
  color: var(--heading);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { border-color: var(--accent); }
.option:active { transform: scale(.99); }
.option[aria-pressed="true"], .option[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* marcador: letra (A, B, C…) */
.option__letter {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1.5px solid var(--accent-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
}
[aria-pressed="true"] .option__letter, [aria-checked="true"] .option__letter {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* marcador: rádio (escolha única) e checkbox (múltipla) */
.option__radio, .option__check {
  flex: none;
  width: 22px; height: 22px;
  border: 1.5px solid var(--accent-border);
  background: var(--surface);
  display: grid; place-items: center;
}
.option__radio { border-radius: 50%; }
.option__check { border-radius: 6px; }
[aria-pressed="true"] .option__radio { border: 7px solid var(--accent); }
[aria-checked="true"] .option__check { background: var(--accent); border-color: var(--accent); }
[aria-checked="true"] .option__check::after {
  content: ""; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

/* marcador: emoji */
.option__emoji { flex: none; font-size: 22px; line-height: 1; width: 26px; text-align: center; }

/* variação: pílulas lado a lado */
.options--pills { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
.options--pills .option {
  width: auto; min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  justify-content: center;
  text-align: center;
  border-color: var(--line);
  background: var(--bg);
}
.options--pills .option:hover { border-color: var(--accent-border); }
.options--pills .option[aria-pressed="true"] {   /* pílula marcada: preenchida */
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* variação: cartões com imagem em grade */
.options--cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-option {
  position: relative;
  display: flex; flex-direction: column;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.card-option:hover { border-color: var(--accent-border); }
.card-option:active { transform: scale(.99); }
.card-option[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.card-option__img { aspect-ratio: 1; width: 100%; object-fit: cover; background: var(--accent-tint); }
.card-option__img--icon { height: auto; object-fit: contain; padding: 14%; }
.card-option__img--emoji { display: grid; place-items: center; font-size: clamp(48px, 16vw, 72px); }
.card-option[aria-checked="true"] .card-option__img { background: var(--accent-soft); }
.card-option__label {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  font-size: 14px; color: var(--heading);
}

/* ---------- Lista de benefícios ✅ / ❌ ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  line-height: 1.35;
}
.checklist .is-good { background: var(--good-bg); border-color: var(--good-border); color: var(--good-text); }
.checklist .is-bad  { background: var(--bad-bg);  border-color: var(--bad-border);  color: var(--bad-text); }
.checklist li::before {
  flex: none;
  width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.checklist .is-good::before { content: "✓"; background: var(--good); }
.checklist .is-bad::before  { content: "✕"; background: var(--bad); }

/* ---------- Campos de formulário ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; color: var(--text); }
.input {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 18px;
  border: 1px solid rgba(64, 63, 61, .25);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--heading);
  font: inherit;
  font-size: 16px; /* 16px evita zoom automático no iPhone */
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); font-style: italic; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.is-invalid .input { border-color: var(--bad); }
.field__error { display: none; font-size: 13px; color: var(--bad); }
.field.is-invalid .field__error { display: block; }

/* seletor de unidade (kg | lb) */
.segmented {
  display: inline-flex; align-self: center;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.segmented button {
  border: 0; background: none;
  padding: 4px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* régua deslizante (peso / altura) — comportamento em ruler.js */
.ruler { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ruler__value { color: var(--heading); font-size: 36px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ruler__value small { font-size: 16px; font-weight: 600; margin-left: 2px; }
.ruler__track {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
  outline: none;
  border-radius: var(--radius-sm);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.ruler__track::-webkit-scrollbar { display: none; }
.ruler__track.is-dragging { cursor: grabbing; }
.ruler__track:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.ruler__scale {
  position: relative;
  height: 64px;
  /* traço pequeno a cada unidade */
  background: repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px 10px) 0 0 / 100% 16px no-repeat;
  /* inclui o último traço */
  box-sizing: content-box;
  padding-right: 2px;
}
.ruler__mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  padding-top: 34px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-left: 1px;
}
.ruler__mark::before {               /* traço grande nos números */
  content: "";
  position: absolute; top: 0; left: 50%;
  width: 2px; height: 26px; margin-left: -1px;
  background: #CFC8C0;
  border-radius: 1px;
}
.ruler__window { position: relative; width: 100%; }
.ruler__window::after {              /* ponteiro fixo no meio */
  content: "";
  position: absolute; left: 50%; top: -4px;
  width: 4px; height: 34px; margin-left: -1px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  pointer-events: none;
  z-index: 1;
}
.ruler__hint { font-size: 12px; color: var(--muted); }

/* ---------- Carregamento ("Analisando…") ---------- */
.loader { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.loader__ring {
  --p: 0;
  width: 120px; height: 120px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0);
}
.loader__ring::before {
  content: attr(data-label);
  width: 100px; height: 100px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg);
  color: var(--heading); font-size: 26px; font-weight: 700;
}
.loader__bar { width: 100%; }
.loader__bar .progress { height: 10px; }
.loader__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.loader__steps li { opacity: .35; transition: opacity .3s; }
.loader__steps li.is-done { opacity: 1; color: var(--heading); }
.loader__steps li.is-done::before { content: "✓ "; color: var(--good); font-weight: 700; }

/* ---------- Acessibilidade ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Depoimentos ---------- */
.testimonials { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Oferta ---------- */
.price { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.price p { margin: 0; }
.price__old { font-size: 16px; font-weight: 600; color: var(--muted); }
.price__new { font-size: var(--h2); font-weight: 700; color: var(--heading); }
.price__new strong { color: var(--accent); }
a.btn { text-decoration: none; }

/* ---------- Vídeo ---------- */
.video {
  width: 100%; max-width: 360px; margin-inline: auto;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius); overflow: hidden;
  background: var(--accent-tint);
}
.video > * { display: block; width: 100%; height: 100%; border: 0; }
