/* Quiz Treino Combinado — design system reusa tokens do /site */

:root {
  --fundo: #FFFFFF;
  --superficie: #F4F4F6;
  --card: #FFFFFF;
  --card-2: #F8F8FA;
  --borda: #E5E5EA;
  --borda-forte: #D1D1D8;

  --texto: #18181D;
  --texto-sec: #6B6B7A;

  --acento: #4071FF;
  --acento-hover: #305AE0;
  --acento-suave: rgba(64, 113, 255, .08);

  --sucesso: #22c55e;
  --erro: #ef4444;

  --progress-fill: linear-gradient(92deg, #4071FF 0%, #6FA8FF 100%);

  --radius-card: 16px;
  --radius-btn: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--superficie);
  color: var(--texto);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input { font-family: inherit; }

/* Layout principal */
.shell {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 20px 32px;
  background: var(--fundo);
  display: flex;
  flex-direction: column;
}

/* Topo: voltar + progress */
.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 36px;
}

.back-btn {
  background: transparent;
  border: 0;
  color: var(--texto-sec);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  visibility: hidden;
}
.back-btn:hover, .back-btn:focus-visible {
  background: var(--superficie);
  color: var(--texto);
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress {
  flex: 1;
  height: 6px;
  background: var(--borda);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--progress-fill);
  width: 0%;
  border-radius: 999px;
  transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-text {
  font-size: 0.7rem;
  color: var(--texto-sec);
  font-weight: 600;
  min-width: 28px;
  text-align: right;
}

/* Step container */
.stage { flex: 1; display: flex; flex-direction: column; }

.step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fade-in { animation: fadeIn 220ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Imagem de step (topo) */
.step-image {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--superficie);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Result e loading: imagem aparece 100% sem crop nem altura fixa (deixa container seguir foto) */
.step-result .step-image,
.step-loading .step-image {
  aspect-ratio: auto;
  height: auto;
  background: transparent;
}
.step-result .step-image img,
.step-loading .step-image img {
  height: auto;
  width: 100%;
  max-height: none;
}

/* Texto */
.headline {
  font-family: 'Anton', 'Inter', sans-serif;
  font-size: clamp(1.5rem, 7vw, 2rem);
  line-height: 1.1;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.5px;
}
.headline-form {
  font-size: clamp(1.25rem, 5.5vw, 1.5rem);
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}
.subheadline {
  font-size: 0.95rem;
  color: var(--texto-sec);
  line-height: 1.5;
  margin: 0;
}
.question {
  font-size: clamp(1.15rem, 5vw, 1.4rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.hint {
  font-size: 0.85rem;
  color: var(--texto-sec);
  margin: -8px 0 0 0;
}

/* Botões */
.btn-primary {
  background: var(--acento);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: 0;
  border-radius: var(--radius-btn);
  padding: 14px 20px;
  cursor: pointer;
  transition: background 150ms, transform 100ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--acento-hover);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-secondary {
  background: var(--superficie);
  color: var(--texto);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--borda);
  border-radius: var(--radius-btn);
  padding: 12px 18px;
  cursor: pointer;
}

.arrow { font-weight: 600; }

/* Opções de choice texto */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option {
  background: var(--card);
  color: var(--texto);
  border: 1px solid var(--borda);
  border-radius: var(--radius-btn);
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 150ms;
}
.option:hover, .option:focus-visible {
  border-color: var(--acento);
  background: var(--acento-suave);
}
.option:active { transform: scale(0.98); }

/* Opções visuais (com imagem) */
.options-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.option-visual {
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: var(--radius-card);
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 150ms;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  color: var(--texto);
}
.option-visual:hover, .option-visual:focus-visible {
  border-color: var(--acento);
  background: var(--acento-suave);
}
.option-visual:active { transform: scale(0.98); }
.option-image {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--superficie);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.option-label {
  padding: 4px 4px 6px;
  color: var(--acento);
  font-weight: 700;
}

/* Trust badges */
.trust-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--texto-sec);
}
.badge { line-height: 1.4; }

/* Loading */
.step-loading {
  align-items: center;
  text-align: center;
  padding: 40px 0;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--borda);
  border-top-color: var(--acento);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg {
  font-size: 1rem;
  color: var(--texto);
  font-weight: 600;
  transition: opacity 150ms;
}
.loading-msg.fade-out { opacity: 0; }

/* Result */
.step-result {
  gap: 12px;
  padding-bottom: 96px; /* reserva espaço pro CTA sticky */
}
.result-header { display: flex; flex-direction: column; gap: 8px; }
.result-body { display: flex; flex-direction: column; gap: 12px; }
.result-cta-sticky {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,0.0) 0%, rgba(255,255,255,0.95) 30%, #fff 100%);
  display: flex;
  justify-content: center;
  z-index: 50;
}
.result-cta-sticky .btn-primary {
  width: 100%;
  max-width: 420px;
  font-size: 1.05rem;
  padding: 16px 20px;
  box-shadow: 0 6px 20px rgba(64,113,255,0.35);
}
.result-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--texto-sec);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.result-name {
  font-family: 'Anton', 'Inter', sans-serif;
  font-size: clamp(1.7rem, 8vw, 2.2rem);
  font-weight: 400;
  margin: 0;
  line-height: 1.1;
  background: var(--progress-fill);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
}
.pitch-paragraph {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--texto);
  margin: 0;
}
.bullets {
  background: var(--superficie);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.bullets-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--texto-sec);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.bullet { font-size: 0.9rem; line-height: 1.4; color: var(--texto); }

/* Form (capture) */
.step-form { gap: 12px; }
.capture-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texto);
}
.field input {
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--texto);
  transition: border-color 150ms;
}
.field input:focus {
  outline: none;
  border-color: var(--acento);
  background: #fff;
}
.field input[aria-invalid="true"] { border-color: var(--erro); }
.field-error {
  color: var(--erro);
  font-size: 0.8rem;
  min-height: 1em;
}
.field-help {
  font-size: 0.68rem;
  color: var(--texto-sec);
  line-height: 1.35;
  margin-top: 2px;
}

/* Thanks */
.step-thanks {
  align-items: center;
  text-align: center;
  padding-top: 40px;
}
.thanks-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sucesso);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tablet+: container um pouco mais largo */
@media (min-width: 640px) {
  .shell { max-width: 480px; padding: 24px 24px 40px; }
}
