/* ============================================================
   VARIÁVEIS / PALETA DE CORES
   Paleta quente e acolhedora: laranja + azul, tom "adulto"
   ============================================================ */
:root {
  --color-primary: #E8622C;        /* laranja principal */
  --color-primary-dark: #C74E1E;
  --color-primary-light: #FFE8DC;
  --color-secondary: #1F4E5F;      /* azul petróleo */
  --color-secondary-light: #2E7086;
  --color-bg: #FBF7F2;             /* off-white quente */
  --color-card: #FFFFFF;
  --color-text: #2A2320;
  --color-text-muted: #6B5F58;
  --color-border: #EDE2D9;

  --color-green: #2E9E5B;
  --color-green-bg: #E5F6EC;
  --color-yellow: #D69A1B;
  --color-yellow-bg: #FCF3DD;
  --color-red: #D6432B;
  --color-red-bg: #FCE7E3;

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius: 16px;
  --shadow: 0 8px 24px rgba(42, 35, 32, 0.08);
  --shadow-lg: 0 16px 40px rgba(42, 35, 32, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: var(--font-heading); margin: 0; }

.hidden { display: none !important; }

/* ============================================================
   BARRA DE PROGRESSO
   ============================================================ */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  z-index: 100;
}

/* [NOVO] Barra de progresso redesenhada: trilha + preenchimento em
   gradiente + linha de meta (bolinhas de bloco + percentual) */
.progress-bar-container {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary-light) 100%);
  transform-origin: left center;
  transition: width 0.5s ease;
  will-change: width;
}

.progress-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-blocks {
  display: flex;
  gap: 6px;
}

.progress-block-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.3s ease, transform 0.3s ease;
}

.progress-block-dot.active {
  background: var(--color-primary);
  transform: scale(1.3);
}

.progress-block-dot.done {
  background: var(--color-secondary-light);
}

.progress-bar-percent {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}

/* [NOVO] Mascote-guia fixo no canto da tela */
.mascot {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 64px;
  height: 64px;
  z-index: 90;
  filter: drop-shadow(0 6px 14px rgba(42, 35, 32, 0.2));
  transition: transform 0.3s ease;
  will-change: transform;
}

.mascot.mascot-react {
  animation: mascotBlink 0.5s ease;
}

@keyframes mascotBlink {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(-4deg); }
}

@media (min-width: 768px) {
  .mascot { width: 88px; height: 88px; bottom: 24px; right: 24px; }
}

/* ============================================================
   LAYOUT GERAL
   ============================================================ */
.app {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px 16px;
}

.screen {
  display: none;
  width: 100%;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen.slide-out {
  animation: fadeOut 0.25s ease forwards;
}

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

.container {
  width: 100%;
  max-width: 520px;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
}

/* ============================================================
   TELA DE ABERTURA (LANDING)
   ============================================================ */
.landing-container {
  text-align: center;
  box-shadow: none;
  background: transparent;
  padding: 16px;
}

.badge {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-secondary);
  margin-bottom: 16px;
}

.subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.microcopy {
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* [NOVO] Foto ilustrativa na landing */
.landing-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
  display: block;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(232, 98, 44, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-large {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
}

/* ============================================================
   TELA DE PERGUNTAS
   ============================================================ */
.question-container { padding-top: 40px; }

.question-block-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.question-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-secondary);
  line-height: 1.4;
  margin-bottom: 24px;
}

/* [NOVO] Imagem ilustrativa opcional acima do título da pergunta.
   object-fit: contain (em vez de cover) garante que a imagem inteira
   apareça, sem cortar as bordas — a altura se ajusta ao conteúdo. */
.question-image {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--color-bg);
  margin-bottom: 20px;
  display: block;
}

/* [NOVO] Imagem ilustrativa opcional abaixo das respostas da pergunta */
.question-image-below {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--color-bg);
  margin-top: 20px;
  display: block;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  cursor: pointer;
  transform: scale(1);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
}

.option-btn:hover,
.option-btn:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  outline: none;
}

.option-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(232, 98, 44, 0.35);
}

.option-btn:active {
  transform: scale(0.98);
}

/* [NOVO] Estado de "selecionado" — feedback visual antes de avançar */
.option-btn.selected {
  border-color: var(--color-secondary);
  background: var(--color-primary-light);
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

.option-btn.selected .option-check {
  opacity: 1;
  transform: scale(1);
}

.option-letter {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* [NOVO] Ícone ilustrativo da alternativa. A cor (verde/âmbar/vermelho)
   é herdada via currentColor a partir de data-level no botão pai,
   reforçando visualmente a gravidade sem precisar redesenhar o ícone. */
.option-icon {
  flex: none;
  width: 26px;
  height: 26px;
}

.option-icon svg { width: 100%; height: 100%; display: block; }

.option-btn[data-level="A"] .option-icon { color: var(--color-green); }
.option-btn[data-level="B"] .option-icon { color: var(--color-yellow); }
.option-btn[data-level="C"] .option-icon { color: var(--color-red); }

.option-text { flex: 1; }

/* [NOVO] Perguntas 1 e 2 (gênero/idade): grade de cartões com ícone
   ilustrativo animado, em vez da lista de texto A/B/C. */
.options-grid {
  display: grid;
  gap: 12px;
}

.gender-grid {
  grid-template-columns: 1fr 1fr;
}

.age-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 480px) {
  .age-grid { grid-template-columns: repeat(4, 1fr); }
}

.option-btn-visual {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px 12px;
  position: relative;
}

.option-btn-visual .option-check {
  position: absolute;
  top: 8px;
  right: 8px;
}

.option-btn-age { padding: 16px 8px; }

.visual-icon {
  width: 48px;
  height: 48px;
  color: var(--color-secondary);
  /* [NOVO] "Imagem de animação": leve bounce contínuo para chamar
     atenção sem distrair — usa transform (não top/margin) */
  animation: iconBounce 2.2s ease-in-out infinite;
  will-change: transform;
}

.visual-icon svg { width: 100%; height: 100%; display: block; }

.option-btn-visual:hover .visual-icon,
.option-btn-visual:focus-visible .visual-icon {
  color: var(--color-primary);
}

.option-btn-visual.selected .visual-icon {
  color: var(--color-primary);
  animation: iconBounceSelected 0.5s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes iconBounceSelected {
  0% { transform: scale(1); }
  40% { transform: scale(1.25) translateY(-8px); }
  100% { transform: scale(1.1) translateY(-6px); }
}

.age-icon { width: 32px; height: 40px; }

/* [NOVO] Check animado que aparece ao selecionar a alternativa */
.option-check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* [NOVO] Badge "+N" de pontuação, estilo gamificado, some sozinho */
.points-badge {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, 0);
  background: var(--color-secondary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  animation: badgePop 1s ease forwards;
  will-change: transform, opacity;
}

@keyframes badgePop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  35% { transform: translate(-50%, -14px) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -30px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(0.9); }
}

/* [NOVO] Pergunta em formato de escala arrastável (1 a 10) */
.scale-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.scale-track {
  position: relative;
  height: 8px;
  background: var(--color-border);
  border-radius: 999px;
  margin: 20px 4px;
}

.scale-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary-light) 100%);
  pointer-events: none;
}

.scale-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--color-secondary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  transition: left 0.05s linear, background 0.15s ease, box-shadow 0.15s ease;
  touch-action: none;
  will-change: left;
}

.scale-thumb:active {
  cursor: grabbing;
  background: var(--color-primary);
}

.scale-thumb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(232, 98, 44, 0.35);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.scale-labels span:first-child { text-align: left; }
.scale-labels span:last-child { text-align: right; }

/* [NOVO] Transição suave entre perguntas: slide horizontal + fade */
.question-container {
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
  will-change: transform, opacity;
}

.question-container.q-enter {
  animation: qSlideIn 0.35s ease;
}

@keyframes qSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-container.q-exit {
  opacity: 0;
  transform: translateX(-24px);
}

/* ============================================================
   [NOVO] INTERSTÍCIO DE VÍDEO (entre Pergunta 6 e 7)
   ============================================================ */
.video-cta-container .question-title {
  color: var(--color-red);
}

.video-wrap {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 480px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin-bottom: 16px;
}

.cta-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-cta-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 16px;
}

#btn-video-cta:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
}

/* ============================================================
   TELA DE LOADING
   ============================================================ */
.loading-container {
  text-align: center;
  box-shadow: none;
  background: transparent;
}

/* [NOVO] Animação de engrenagens girando (substitui o spinner genérico) */
.gears {
  position: relative;
  width: 100px;
  height: 90px;
  margin: 0 auto 20px;
}

.gear {
  position: absolute;
  color: var(--color-primary);
  will-change: transform;
}

.gear-big {
  width: 64px;
  height: 64px;
  top: 0;
  left: 8px;
  animation: spinCW 3s linear infinite;
}

.gear-small {
  width: 40px;
  height: 40px;
  top: 30px;
  left: 56px;
  color: var(--color-secondary-light);
  animation: spinCCW 2.2s linear infinite;
}

@keyframes spinCW {
  to { transform: rotate(360deg); }
}

@keyframes spinCCW {
  to { transform: rotate(-360deg); }
}

.loading-message {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-secondary);
  min-height: 24px;
  animation: fadeInOutText 0.9s ease;
}

@keyframes fadeInOutText {
  0% { opacity: 0; transform: translateY(4px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 1; }
}

/* [NOVO] Barra de progresso "falsa" da tela de loading, 0%→100% */
.fake-progress-track {
  width: 100%;
  height: 8px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 20px;
}

.fake-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary-light));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 3.6s linear;
  will-change: transform;
}

.fake-progress-fill.filling {
  transform: scaleX(1);
}

/* ============================================================
   TELA DE RESULTADO
   ============================================================ */
.result-container {
  text-align: center;
}

.result-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

.result-tag {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.result-tag.green { background: var(--color-green-bg); color: var(--color-green); }
.result-tag.yellow { background: var(--color-yellow-bg); color: var(--color-yellow); }
.result-tag.red { background: var(--color-red-bg); color: var(--color-red); }

.result-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-secondary);
  margin-bottom: 16px;
  line-height: 1.35;
}

.result-text {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  text-align: left;
}

/* [NOVO] Termômetro visual de resultado (escala 10–30 pontos) */
.thermometer-wrap {
  position: relative;
  width: 100px;
  height: 260px;
  margin: 8px auto 4px;
}

.thermometer {
  width: 100%;
  height: 100%;
  display: block;
}

/* Ponteiro: posicionado via --marker-bottom (custom property definida em
   quiz.js) e animado com transform (não com `bottom`) para performance. */
.thermometer-marker {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, calc(-1 * var(--marker-bottom, 20px)));
  color: var(--color-secondary);
  font-size: 22px;
  line-height: 1;
  transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.thermometer-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ============================================================
   RESPONSIVIDADE (mobile-first já é o padrão acima; ajustes p/ desktop)
   ============================================================ */
@media (min-width: 768px) {
  .title { font-size: 38px; }
  .subtitle { font-size: 18px; }
  .container { padding: 40px; }
  .question-title { font-size: 26px; }
}
