/* Quiz de vendas do FitScan — usa os tokens da marca (src/styles/tokens.css). */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.5;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.quiz {
  width: 100%; max-width: 560px; margin: 0 auto; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + var(--sp-4)) var(--sp-4) calc(env(safe-area-inset-bottom) + var(--sp-8));
  display: flex; flex-direction: column; gap: var(--sp-5);
}
.quiz__boot { margin: auto; display: grid; justify-items: center; gap: var(--sp-3); color: var(--text-2); font-size: var(--fs-sm); }
.quiz__boot img { border-radius: var(--r-md); }

/* topo: marca, voltar, progresso */
.q-top { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; }
.q-brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); }
.q-brand img { width: 28px; height: 28px; border-radius: 8px; }
.q-back {
  width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border-strong); border-radius: var(--r-pill);
}
.q-back svg { width: 20px; height: 20px; }
.q-progress { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.q-progress__bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.q-progress__fill { height: 100%; background: linear-gradient(90deg, var(--brand-emerald), var(--brand-green)); transition: width .25s ease; }
.q-progress__label { font-size: var(--fs-xs); color: var(--text-3); }

/* textos */
.q-eyebrow { font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.q-title { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: 1.2; letter-spacing: -0.01em; }
.q-display { font-size: var(--fs-display); font-weight: var(--fw-bold); line-height: 1.1; letter-spacing: -0.02em; }
.q-lead { color: var(--text-2); max-width: 60ch; }
.q-note { font-size: var(--fs-xs); color: var(--text-3); max-width: 70ch; }
.accent { color: var(--accent); }

/* opções */
.q-options { display: flex; flex-direction: column; gap: var(--sp-3); }
.q-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  width: 100%; min-height: 56px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color .12s ease, background .12s ease, transform .1s ease;
}
.q-option:hover { border-color: var(--accent-ring); }
.q-option:active { transform: scale(.99); }
.q-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.q-option__label { font-weight: var(--fw-semibold); }
.q-option__sub { font-size: var(--fs-sm); color: var(--text-2); }

/* cartões e listas */
.q-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.q-card--accent { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.q-card--warn { border-color: var(--status-atencao); }
.q-card--warn p { color: var(--status-atencao); }
.q-features { display: flex; flex-direction: column; gap: var(--sp-3); padding: 0; margin: 0; list-style: none; }
.q-features li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.q-features svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.q-features strong { display: block; }
.q-features span { font-size: var(--fs-sm); color: var(--text-2); }
.q-summary { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.q-summary div { background: var(--surface-2); border-radius: var(--r-sm); padding: var(--sp-3); }
.q-summary dt { font-size: var(--fs-xs); color: var(--text-3); }
.q-summary dd { margin: 2px 0 0; font-weight: var(--fw-bold); }

/* botões */
.q-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  width: 100%; min-height: 52px; padding: 14px 20px; border-radius: var(--r-sm);
  font-weight: var(--fw-bold); font-size: 1rem; border: 1px solid transparent; text-decoration: none;
}
.q-btn--primary { background: linear-gradient(180deg, var(--brand-green), var(--accent-strong)); color: #04140A; }
.q-btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.q-actions { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: auto; }

/* formulários (captura de lead e login) */
.q-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.q-label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-2); }
.q-input {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; color: var(--text);
  font-size: max(16px, 1em); /* abaixo de 16 px o iPhone dá zoom ao tocar no campo (e o zoom fica no app instalado) */
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
}
.q-input:focus { border-color: var(--accent); outline: none; }
.q-error { min-height: 1.2em; font-size: var(--fs-sm); color: var(--status-fraco); }
.q-check { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.q-check input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.q-check a, .q-link { color: var(--accent); }
.q-btn:disabled { opacity: .55; pointer-events: none; }

/* oferta */
.q-plans { display: flex; flex-direction: column; gap: var(--sp-3); }
.q-plan { position: relative; display: flex; flex-direction: column; gap: var(--sp-2); }
.q-plan__badge { position: absolute; top: -10px; right: 16px; background: var(--accent); color: #04140A; font-size: var(--fs-xs); font-weight: var(--fw-bold); padding: 3px 10px; border-radius: var(--r-pill); }
.q-plan__name { font-weight: var(--fw-bold); }
.q-plan__price { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: 1.1; }
.q-plan__note { font-size: var(--fs-sm); color: var(--text-2); }

/* consentimento de cookies de marketing */
.q-consent {
  position: fixed; left: var(--sp-3); right: var(--sp-3); bottom: calc(env(safe-area-inset-bottom) + var(--sp-3)); z-index: 10;
  max-width: 560px; margin: 0 auto; background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); box-shadow: var(--shadow-md);
}
.q-consent p { font-size: var(--fs-sm); color: var(--text-2); }
.q-consent__actions { display: flex; gap: var(--sp-2); }
.q-consent__actions .q-btn { min-height: 44px; font-size: var(--fs-sm); }

/* carregando */
.q-loading { margin: auto 0; display: flex; flex-direction: column; gap: var(--sp-5); align-items: center; text-align: center; }
.q-steps { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; padding: 0; margin: 0; list-style: none; }
.q-steps li { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); color: var(--text-3); }
.q-steps li[data-state="active"] { color: var(--accent); }
.q-steps li[data-state="done"] { color: var(--text); }
.q-steps svg { width: 16px; height: 16px; }
.q-step-mark { display: inline-flex; width: 16px; height: 16px; flex-shrink: 0; align-items: center; justify-content: center; }
.q-spinner { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: q-spin .8s linear infinite; }
@keyframes q-spin { to { transform: rotate(360deg); } }

.q-hero {
  border-radius: var(--r-xl); border: 1px solid var(--border); padding: var(--sp-6) var(--sp-5);
  background: radial-gradient(120% 80% at 80% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(160deg, var(--surface-3), var(--neutral-950));
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.q-screen { display: flex; flex-direction: column; gap: var(--sp-5); flex: 1; animation: q-in .2s ease; }
@keyframes q-in { from { opacity: 0; transform: translateY(6px); } }

/* perguntas por imagem: 2 por linha no celular */
.q-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.q-image-option {
  display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; text-align: left;
  background: var(--surface); border: 2px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color .12s ease, transform .1s ease;
}
.q-image-option img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.q-image-option__label { padding: 10px 12px 12px; font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: 1.3; min-height: 44px; }
.q-image-option:active { transform: scale(.98); }
.q-image-option[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--shadow-glow); }
/* cartão que sobra sozinho na última linha: mesmo tamanho dos outros, centralizado */
.q-image-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - var(--sp-3) / 2); }

/* resultado */
.q-subtitle { font-size: var(--fs-h3); font-weight: var(--fw-semibold); line-height: 1.3; }
.q-hero--compact { padding: var(--sp-5); }
.q-identity .q-display { color: var(--accent); }
.q-locked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.q-locked li {
  display: flex; gap: var(--sp-2); align-items: center; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-3); font-size: var(--fs-sm);
}
.q-locked li svg { flex-shrink: 0; color: var(--text-3); }
.q-locked__text { filter: blur(3.5px); user-select: none; }
.q-locked__label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--accent); }
.q-actions__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.q-btn--ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.q-toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); z-index: 20;
  background: var(--surface-3); border: 1px solid var(--border-strong); padding: 10px 16px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); max-width: calc(100vw - 32px);
}

/* carregamento com barra cronometrada */
.q-loading__bar { width: 100%; max-width: 320px; }
.q-progress__fill--timed { width: 0; animation: q-fill linear forwards; }
@keyframes q-fill { to { width: 100%; } }

/* página de vendas */
.q-section { display: flex; flex-direction: column; gap: var(--sp-4); }
.q-display--sm { font-size: var(--fs-h1); }
.q-features--compact { gap: var(--sp-2); }
.q-features--compact span { display: none; }
.q-steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.q-steps-list li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.q-steps-list strong { display: block; }
.q-steps-list span:not(.q-steps-list__n) { font-size: var(--fs-sm); color: var(--text-2); }
.q-steps-list__n {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-bold);
}
.q-guarantee { flex-direction: row; align-items: flex-start; }
.q-guarantee svg { flex-shrink: 0; margin-top: 2px; }
.q-faq { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 var(--sp-4); }
.q-faq summary { min-height: 52px; display: flex; align-items: center; font-weight: var(--fw-semibold); cursor: pointer; list-style: none; }
.q-faq summary::-webkit-details-marker { display: none; }
.q-faq summary::after { content: "+"; margin-left: auto; padding-left: var(--sp-3); color: var(--accent); font-size: 1.3rem; }
.q-faq[open] summary::after { content: "−"; }
.q-faq p { padding-bottom: var(--sp-4); }
.q-final { text-align: center; align-items: center; }

@media (min-width: 768px) {
  .quiz { padding-top: var(--sp-10); }
  .q-actions { margin-top: var(--sp-2); }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* Demais campos (painel, formulários): mínimo de 16 px, para o iPhone não dar zoom ao tocar. */
input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: max(16px, 1em); }
