/* ==========================================================================
   QUIZ DE DIAGNÓSTICO CAPILAR - DRA. MARINA FRANCO
   Design: Aplicativo de Saúde Moderno & Minimalista
   Paleta: Tons Ultra Claros (#FBFBF9), Branco Puro, Verde Saúde (#16A34A) & Ouro
   ========================================================================== */

/* --- 1. VARIÁVEIS E RESET --- */
:root {
  /* Fundo Ultra Claro & Minimalista */
  --app-bg: #F9F9F7;
  --app-card-bg: #FFFFFF;
  --app-card-hover: #F2F9F4;
  --app-border: #E8E5DF;
  --app-border-hover: #22C55E;

  /* Verde Saúde Dinâmico */
  --green-primary: #16A34A;
  --green-light: #EBF8F0;
  --green-glow: rgba(22, 163, 74, 0.25);
  
  /* Cores de Texto */
  --text-primary: #1F1B1C;
  --text-secondary: #574F51;
  --text-muted: #8E8486;

  /* Toques de Elegância Médica */
  --gold-primary: #C29B48;
  --gold-light: #FAF4E6;
  --rose-primary: #8E4A56;
  --rose-light: #F8EEF0;

  /* Tipografia */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Sombras e Raios */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-app: 0 12px 40px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 8px 24px rgba(22, 163, 74, 0.12);
  --shadow-cta: 0 10px 25px rgba(22, 163, 74, 0.35);

  --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--app-bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- 2. ESTRUTURA DO APLICATIVO --- */
.quiz-app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  background-color: var(--app-bg);
  position: relative;
}

/* --- 3. HEADER DO APP COM BARRA VERDE E TIMER --- */
.quiz-app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(251, 251, 249, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--app-border);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 20px 12px;
}

.btn-back {
  grid-column: 1;
  justify-self: start;
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-back:hover {
  background-color: #ECE7E1;
  color: var(--text-primary);
}

.app-brand {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.app-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold-primary);
}

.app-brand-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--rose-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Marcador de Tempo (~2min restante) */
.timer-badge {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.timer-icon {
  font-size: 0.85rem;
  animation: pulse-clock 2s infinite ease-in-out;
}

@keyframes pulse-clock {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.timer-text {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Barra de Progresso Verde Dinâmica no Topo */
.progress-bar-container {
  width: 100%;
  height: 5px;
  background-color: #E6E2DB;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #16A34A, #22C55E);
  border-radius: 0 4px 4px 0;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px var(--green-glow);
}

/* --- 4. CONTEÚDO PRINCIPAL DO QUIZ --- */
.quiz-main-content {
  flex: 1;
  padding: 28px 20px 40px;
}

.quiz-container {
  width: 100%;
}

/* --- 4.1 ECRÃ DE INTRODUÇÃO --- */
.intro-screen {
  text-align: center;
  padding: 10px 0 20px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.intro-screen.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

.intro-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--green-light);
  color: var(--green-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}

.intro-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.6vw, 2.65rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.22;
  margin-bottom: 16px;
}

.intro-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 580px;
  margin: 0 auto 26px;
}

/* Card da Imagem em Destaque do Quiz */
.intro-media-wrapper {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 26px;
  position: relative;
  display: flex;
  justify-content: center;
}

.intro-image-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--app-card-bg);
  border: 1.5px solid rgba(194, 155, 72, 0.4);
  box-shadow: 0 14px 32px rgba(44, 38, 39, 0.08);
  transition: var(--transition-smooth);
}

.intro-image-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(44, 38, 39, 0.12);
  border-color: rgba(194, 155, 72, 0.6);
}

.intro-cover-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 12px;
}

.intro-image-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--green-primary);
  border: 1px solid rgba(22, 163, 74, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.intro-highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto 32px;
}

.intro-highlight-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: var(--app-card-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
  box-shadow: var(--shadow-card);
}

.highlight-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: #F8F6F2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.highlight-text span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-start-intro {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  cursor: pointer;
  position: relative;
  z-index: 10;
}

.intro-doctor-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 22px;
}

.intro-doctor-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold-primary);
}

/* Metadados da Etapa */
.step-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.step-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-primary);
  background-color: var(--green-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.step-topic {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Card Principal da Pergunta */
.question-card {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.question-card.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

.question-card.fade-in {
  opacity: 1;
  transform: translateY(0);
  animation: fadeSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.question-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4.2vw, 2.15rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 10px;
}

.question-subtitle {
  font-size: 0.975rem;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

/* --- 5. CARDS DE RESPOSTA ARREDONDADOS (ALTA RETENÇÃO) --- */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-card-btn {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  background-color: var(--app-card-bg);
  border: 1.5px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
  position: relative;
  font-family: var(--font-sans);
}

.option-card-btn:hover {
  background-color: var(--app-card-hover);
  border-color: var(--app-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.option-card-btn:active,
.option-card-btn.selected {
  transform: scale(0.985);
  background-color: var(--green-light);
  border-color: var(--green-primary);
}

.option-card-btn.selected {
  border-width: 2px;
}

/* Box do Emoji / Ícone à Esquerda */
.option-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: #F8F6F2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-right: 16px;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.option-card-btn:hover .option-icon-box,
.option-card-btn.selected .option-icon-box {
  background-color: #FFFFFF;
  transform: scale(1.08);
}

/* Textos da Resposta */
.option-text-group {
  flex: 1;
}

.option-label {
  display: block;
  font-size: 1.025rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.option-sublabel {
  display: block;
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Indicador de Seleção / Flecha Discreta */
.option-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  margin-left: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.option-card-btn:hover .option-chevron {
  color: var(--green-primary);
  transform: translateX(3px);
}

/* --- 6. TELA DE ANÁLISE INTERMEDIÁRIA (LOADING CIENTÍFICO) --- */
.analyzing-screen {
  text-align: center;
  padding: 50px 20px;
  animation: fadeIn 0.4s ease;
}

.analyzing-spinner-box {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--green-primary);
  animation: pulse-ring 1.8s infinite ease-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

.spinner-center-icon {
  font-size: 2.4rem;
  z-index: 2;
}

.analyzing-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.analyzing-status {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  min-height: 24px;
}

.analyzing-progress-bar {
  width: 100%;
  max-width: 320px;
  height: 8px;
  background-color: var(--app-border);
  border-radius: var(--radius-full);
  margin: 0 auto;
  overflow: hidden;
}

.analyzing-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #16A34A, #22C55E);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* --- 7. TELA DE RESULTADO & DIAGNÓSTICO --- */
.result-screen {
  animation: fadeSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--green-light);
  color: var(--green-primary);
  font-size: 0.825rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.result-headline {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 22px;
}

/* Card de Diagnóstico */
.diagnosis-card {
  background-color: var(--app-card-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-app);
  margin-bottom: 28px;
  border-left: 5px solid var(--rose-primary);
}

.diagnosis-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.diagnosis-icon {
  font-size: 2rem;
  line-height: 1;
}

.diagnosis-tag {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rose-primary);
  margin-bottom: 3px;
}

.diagnosis-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.diagnosis-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.diagnosis-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--app-border);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--green-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* Prescrição Médica & Card de Solução */
.prescription-box {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF7F2 100%);
  border: 1px solid rgba(194, 155, 72, 0.4);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: var(--shadow-app);
}

.prescription-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7A5C1E;
  background: var(--gold-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.prescription-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.prescription-text {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.result-product-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background-color: #FFFFFF;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 26px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.result-product-img {
  width: 95px;
  height: 95px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--app-border);
}

.result-product-info h4 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.result-product-info p {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.result-pricing {
  display: flex;
  flex-direction: column;
}

.result-old-price {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.result-current-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.result-currency {
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.result-price {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.result-savings {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--green-primary);
  margin-top: 3px;
}

/* Botão de Compra CTA do App */
.btn-app-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #16A34A, #15803D);
  color: #FFFFFF !important;
  text-decoration: none;
  padding: 18px 24px;
  border-radius: 50px;
  text-align: center;
  box-shadow: var(--shadow-cta);
  transition: var(--transition-smooth);
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: relative;
  z-index: 10;
}

.btn-app-cta:hover {
  background: linear-gradient(135deg, #15803D, #166534);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(22, 163, 74, 0.45);
  cursor: pointer;
}

.btn-app-cta:active {
  transform: translateY(1px);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
}

.btn-app-cta span {
  font-size: 1.025rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.btn-app-cta small {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 3px;
  pointer-events: none;
}

.pulse-cta {
  animation: app-pulse-cta 2.6s infinite ease-in-out;
}

@keyframes app-pulse-cta {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.app-security-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 18px;
  text-align: center;
}

/* --- 8. RODAPÉ DO APP --- */
.quiz-app-footer {
  margin-top: auto;
  border-top: 1px solid var(--app-border);
  padding: 16px 20px;
  text-align: center;
  background-color: var(--app-bg);
}

.footer-inner p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- 9. RESPONSIVIDADE MOBILE --- */
@media (max-width: 480px) {
  .quiz-main-content {
    padding: 20px 16px 32px;
  }

  .header-inner {
    padding: 12px 16px 10px;
  }

  .intro-title {
    font-size: 1.85rem;
  }

  .intro-subtitle {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }

  .intro-media-wrapper {
    max-width: 310px;
    margin-bottom: 22px;
  }

  .question-title {
    font-size: 1.55rem;
  }

  .option-card-btn {
    padding: 15px 16px;
  }

  .option-icon-box {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
    margin-right: 12px;
  }

  .option-label {
    font-size: 0.95rem;
  }

  .result-product-card {
    flex-direction: column;
    text-align: center;
  }

  .result-product-img {
    width: 100px;
    height: 100px;
  }

  .result-current-price {
    justify-content: center;
  }

  .btn-app-cta {
    padding: 16px 18px;
  }

  .btn-app-cta span {
    font-size: 0.925rem;
  }
}

