/* ========================================
   CALCULADORA — QUIZ FUNNEL
   Estende styles.css (tokens, fontes, .fold-*, .tcard, .btn-green-*)
   ======================================== */

html, body {
  height: 100%;
  background: var(--blue);
}
body.quiz-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.quiz-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 2.5rem;
}

/* ---- Header: back + progress ---- */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 2rem;
  margin-bottom: 2rem;
}
.quiz-header[hidden] { display: none; }

.quiz-back-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-family: 'Comfortaa', cursive;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
  transition: color 0.2s;
  flex-shrink: 0;
}
.quiz-back-btn:hover { color: #fff; }
.quiz-back-btn[hidden] { visibility: hidden; }

.quiz-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #2ea85c);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.quiz-progress-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Stage / screens ---- */
.quiz-stage { flex: 1; display: flex; flex-direction: column; position: relative; }
.quiz-screen {
  display: none;
  flex-direction: column;
  flex: 1;
}
.quiz-screen[data-active="true"] {
  display: flex;
  animation: quizFadeIn 0.35s ease;
}
@keyframes quizFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Intro screen ---- */
.quiz-intro {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.quiz-logo { height: 2.1rem; margin: 0 auto 2rem; display: block; }
.quiz-eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 3px; text-transform: uppercase;
  color: var(--primary); margin-bottom: 1.25rem;
}
.quiz-title {
  font-family: 'Comfortaa', cursive; font-weight: 600;
  font-size: clamp(1.55rem, 5.5vw, 2.1rem);
  color: #fff; line-height: 1.25; margin-bottom: 1rem; letter-spacing: -0.3px;
}
.quiz-subtitle {
  font-size: 0.95rem; color: rgba(255,255,255,0.7); line-height: 1.7;
  max-width: 420px; margin: 0 auto 2.25rem;
}
.quiz-intro .hero-stats-row { margin: 0 auto 2.25rem; max-width: 420px; }

/* ---- Question screens ---- */
.quiz-question-tag { font-size: 0.78rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 0.75rem; }
.quiz-question {
  font-family: 'Comfortaa', cursive; font-weight: 600;
  font-size: clamp(1.3rem, 4.5vw, 1.7rem);
  color: #fff; line-height: 1.3; margin-bottom: 2rem; letter-spacing: -0.3px;
}
.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; }
.quiz-option {
  width: 100%; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.14);
  color: #fff; border-radius: 12px; padding: 1.1rem 1.25rem;
  font-family: 'Comfortaa', cursive; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s;
  min-height: 3.4rem;
}
.quiz-option:hover, .quiz-option:focus-visible {
  border-color: var(--primary); background: rgba(58,186,107,0.14); outline: none;
}
.quiz-option:active { transform: scale(0.98); }
.quiz-option.is-selected { border-color: var(--primary); background: rgba(58,186,107,0.2); }
.quiz-option-arrow { opacity: 0.45; flex-shrink: 0; transition: transform 0.2s; }
.quiz-option:hover .quiz-option-arrow { transform: translateX(3px); opacity: 0.9; }

/* ---- Loading screen ---- */
.quiz-loading {
  flex: 1; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 2.25rem;
}
.quiz-spinner {
  width: 3.25rem; height: 3.25rem; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--primary);
  animation: quizSpin 0.9s linear infinite;
}
@keyframes quizSpin { to { transform: rotate(360deg); } }
.quiz-loading-messages { position: relative; height: 1.8rem; width: 100%; max-width: 380px; }
.quiz-loading-message {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Comfortaa', cursive; font-size: 1rem; color: rgba(255,255,255,0.85);
  opacity: 0; transition: opacity 0.35s ease; text-align: center; padding: 0 1rem;
}
.quiz-loading-message.is-visible { opacity: 1; }

/* ---- Result screen ---- */
.quiz-result-eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--primary); margin-bottom: 1rem; }
.quiz-result-heading {
  font-family: 'Comfortaa', cursive; font-weight: 600; font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  color: #fff; line-height: 1.4; margin-bottom: 0.5rem;
}
.quiz-result-value {
  font-family: 'Comfortaa', cursive; font-weight: 800;
  font-size: clamp(1.7rem, 7vw, 2.4rem); color: var(--primary);
  line-height: 1.2; margin: 0.75rem 0 1rem;
}
.quiz-roi-note { font-size: 0.88rem; color: rgba(255,255,255,0.75); line-height: 1.6; margin-bottom: 1.25rem; }
.quiz-disclaimer {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px; padding: 0.9rem 1.1rem; margin-bottom: 1.75rem;
}
.quiz-disclaimer p { font-size: 0.78rem; color: rgba(255,255,255,0.65); line-height: 1.65; }
.quiz-result .tcard { margin-bottom: 1.75rem; }
.quiz-result-cta { margin-top: auto; }

/* ---- Validação leve (feedback visual sem travar o fluxo) ---- */
@keyframes quizShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.fold-field.is-error { border-color: #f87171 !important; box-shadow: 0 0 0 2px rgba(248,113,113,0.25); }

.quiz-confirmation {
  flex: 1; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 1rem;
}
.quiz-confirmation-icon {
  width: 3.5rem; height: 3.5rem; border-radius: 50%; background: rgba(58,186,107,0.18);
  border: 1.5px solid var(--primary); display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.quiz-confirmation h2 { font-family: 'Comfortaa', cursive; color: #fff; font-size: 1.4rem; }
.quiz-confirmation p { color: rgba(255,255,255,0.75); font-size: 0.95rem; max-width: 380px; line-height: 1.7; }

/* ---- Mobile refinements ---- */
@media (max-width: 480px) {
  .quiz-shell { padding: 1rem 1.1rem 2rem; }
  .quiz-option { padding: 1rem 1.1rem; font-size: 0.95rem; }
  .quiz-form-card { padding: 1.5rem 1.25rem; border-radius: 14px; }
}
