/**
 * Diagnóstico IDD Express - Estilos Globais e Telas
 * Padrão Visual: Quiz de Alta Conversão, Mobile First, Tema Executivo/Corporativo
 */

:root {
  --primary-green: #007BFF;
  --primary-green-hover: #0056D6;
  --primary-green-light: #0A192F;
  --primary-green-border: #2563EB;
  --progress-track: #112240;

  --dark-text: #111827;
  --dark-heading: #0f172a;
  --muted-text: #4b5563;
  --light-gray-bg: #f8fafc;

  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-border-hover: #cbd5e1;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.07);

  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Reset Básico */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: #ffffff;
  color: var(--dark-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ==============================================
   BARRA DE PROGRESSO FIXA NO TOPO
   ============================================== */
.progress-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #ffffff;
  padding: 10px 16px;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.progress-track {
  max-width: 580px;
  margin: 0 auto;
  height: 7px;
  background-color: var(--progress-track);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-green);
  border-radius: var(--radius-full);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================================
   CONTAINER PRINCIPAL (MOBILE FIRST, MAX 580PX)
   ============================================== */
.quiz-container {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 40px 18px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Gerenciamento de Telas SPA */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  width: 100%;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.screen-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ==============================================
   GRIFO VERDE PADRÃO (HIGHLIGHT)
   ============================================== */
.highlight {
  background-color: var(--primary-green);
  color: #ffffff !important;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
  display: inline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  line-height: 1.25;
}

/* ==============================================
   BOTÃO CTA PRINCIPAL VERDE
   ============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-weight: 800;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary.btn-cta {
  width: 100%;
  background-color: var(--primary-green);
  color: #ffffff;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 17px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(22, 193, 91, 0.38);
  margin-top: 14px;
}

.btn-primary.btn-cta:hover {
  background-color: var(--primary-green-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22, 193, 91, 0.45);
}

.btn-primary.btn-cta:active {
  transform: translateY(0);
}

/* ==============================================
   TELA 1: BOAS-VINDAS
   ============================================== */
.welcome-layout {
  text-align: center;
  padding-top: 12px;
}

.welcome-headline {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--dark-heading);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.welcome-subtitle {
  font-size: 0.98rem;
  font-style: italic;
  color: var(--muted-text);
  line-height: 1.55;
  margin-bottom: 22px;
  padding: 0 4px;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 22px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  background-color: #f1f5f9;
}

.hero-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1122 / 1402;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-image-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-green);
  display: inline-block;
}

.trust-badge {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted-text);
}

.trust-icon {
  font-size: 0.95rem;
}

/* ==============================================
   TELA 2: QUIZ
   ============================================== */
.quiz-layout {
  padding-top: 6px;
}

.quiz-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.btn-prev {
  background: transparent;
  border: none;
  color: var(--muted-text);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-prev:hover {
  background-color: #f1f5f9;
  color: var(--dark-heading);
}

.quiz-badge-dim {
  font-size: 0.82rem;
  font-weight: 700;
  color: #047857;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.question-title {
  text-align: center;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--dark-heading);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.question-instruction {
  text-align: left;
  font-size: 0.95rem;
  font-style: italic;
  color: #374151;
  margin-bottom: 18px;
  padding-left: 2px;
}

.required-star {
  color: var(--danger-color);
  font-weight: 700;
  font-style: normal;
}

/* CARDS DE OPÇÃO DO QUIZ */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  display: flex;
  align-items: center;
  background-color: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  gap: 14px;
}

.option-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

/* Estado Selecionado */
.option-card.selected {
  border-color: var(--primary-green) !important;
  background-color: #f0fdf4 !important;
  box-shadow: 0 4px 12px rgba(22, 193, 91, 0.16) !important;
}

.option-emoji {
  font-size: 1.7rem;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-text-group {
  flex: 1;
  min-width: 0;
  line-height: 1.38;
}

.option-title {
  font-weight: 700;
  color: var(--dark-text);
  font-size: 0.98rem;
}

.option-subtitle {
  font-style: italic;
  font-weight: 400;
  color: var(--muted-text);
  font-size: 0.92rem;
}

/* Círculo de Radio Button à Direita */
.option-radio-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background-color: #ffffff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.option-card:hover .option-radio-circle {
  border-color: #94a3b8;
}

.option-card.selected .option-radio-circle {
  border-color: var(--primary-green);
  background-color: var(--primary-green);
  box-shadow: inset 0 0 0 3px #ffffff;
}

/* ==============================================
   TELA 3: ANÁLISE DE PERFIL (#analyzing-screen)
   ============================================== */
.analyzing-layout {
  text-align: center;
  padding: 30px 4px 20px;
}

.analyzing-spinner-wrapper {
  margin-bottom: 22px;
  display: flex;
  justify-content: center;
}

.analyzing-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--progress-track);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.analyzing-headline {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--dark-heading);
  margin-bottom: 8px;
}

.loading-percent-number {
  color: var(--primary-green);
  display: inline-block;
  min-width: 60px;
}

.analyzing-subheadline {
  font-size: 0.92rem;
  color: var(--muted-text);
  margin-bottom: 26px;
}

/* Barra de Carregamento 0 a 100% */
.loading-bar-track {
  width: 100%;
  height: 10px;
  background-color: var(--progress-track);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 30px;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, var(--primary-green));
  border-radius: var(--radius-full);
  transition: width 0.08s linear;
}

/* 3 Cards Verdes de Aprovação Progressiva */
.check-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: var(--primary-green-light);
  border: 1px solid var(--primary-green-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.check-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.check-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(22, 193, 91, 0.3);
}

.check-content {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
}

.check-content strong {
  display: block;
  color: #065f46;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.check-content p {
  color: #047857;
  font-size: 0.85rem;
  margin: 0;
}

/* ==============================================
   TELA 4: RESULTADOS (#result-screen)
   ============================================== */
.result-layout {
  padding-top: 10px;
}

.result-header {
  text-align: center;
  margin-bottom: 20px;
}

.result-pre-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #047857;
  background-color: var(--primary-green-light);
  border: 1px solid var(--primary-green-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.result-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--dark-heading);
}

/* Card de Classificação em Níveis */
.level-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  text-align: center;
  border: 1.5px solid;
  transition: all var(--transition-normal);
}

/* Variações de Nível */
.level-card.level-1 {
  background: #fff7ed;
  border-color: #fdba74;
}

.level-card.level-1 .level-pill {
  background: #ea580c;
  color: #ffffff;
}

.level-card.level-2 {
  background: #fffbeb;
  border-color: #fcd34d;
}

.level-card.level-2 .level-pill {
  background: #d97706;
  color: #ffffff;
}

.level-card.level-3 {
  background: #eff6ff;
  border-color: #93c5fd;
}

.level-card.level-3 .level-pill {
  background: #2563eb;
  color: #ffffff;
}

.level-card.level-4 {
  background: #f0fdf4;
  border-color: #86efac;
}

.level-card.level-4 .level-pill {
  background: #16a34a;
  color: #ffffff;
}

.level-pill {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.level-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark-heading);
  line-height: 1.35;
  margin-bottom: 10px;
}

.level-description {
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.55;
}

/* CARDS DO DASHBOARD DE GRÁFICOS */
.dashboard-chart-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.card-header-with-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-box-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark-heading);
}

.chart-box-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted-text);
  background-color: #f1f5f9;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.chart-box-explanation {
  font-size: 0.88rem;
  color: var(--muted-text);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Gráfico de Rosca */
.doughnut-chart-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
}

.doughnut-center-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.doughnut-percent {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark-heading);
  display: block;
  line-height: 1;
}

.doughnut-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doughnut-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--muted-text);
  font-weight: 600;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-color-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.autonomy-color {
  background-color: var(--primary-green);
}

.dependence-color {
  background-color: #e2e8f0;
}

/* Gráfico de Radar */
.radar-chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 320px;
  margin: 0 auto;
}

/* DETALHAMENTO DAS 5 DIMENSÕES */
.dimensions-breakdown-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}

.breakdown-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark-heading);
  margin-bottom: 16px;
}

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

.dimension-item {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.dimension-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.dimension-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark-heading);
}

.dimension-score-badge {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.dim-bar-track {
  width: 100%;
  height: 6px;
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.dim-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.dimension-item-desc {
  font-size: 0.82rem;
  color: var(--muted-text);
  line-height: 1.4;
}

/* ==============================================
   CARD FINAL DE CONVERSÃO (CTA & FORMULÁRIO)
   ============================================== */
.conversion-card {
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  border: 2px solid var(--primary-green);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  box-shadow: 0 8px 24px rgba(22, 193, 91, 0.18);
  margin-bottom: 20px;
  text-align: center;
}

.conversion-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #047857;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.conversion-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark-heading);
  line-height: 1.35;
  margin-bottom: 10px;
}

.conversion-subtitle {
  font-size: 0.92rem;
  color: var(--muted-text);
  line-height: 1.5;
  margin-bottom: 22px;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark-heading);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 1.05rem;
  pointer-events: none;
  opacity: 0.7;
}

.input-wrapper input {
  width: 100%;
  padding: 13px 14px 13px 40px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--dark-text);
  background-color: #ffffff;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(22, 193, 91, 0.18);
}

.form-privacy-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted-text);
  margin-top: 8px;
}

/* Sucesso do Formulário */
.lead-success-msg {
  padding: 20px 10px;
}

.lead-success-msg .success-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.lead-success-msg h4 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 8px;
}

.lead-success-msg p {
  font-size: 0.95rem;
  color: #047857;
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-restart {
  background-color: #ffffff;
  color: #065f46;
  border: 1.5px solid #a7f3d0;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-restart:hover {
  background-color: #ecfdf5;
  border-color: var(--primary-green);
}

.hidden {
  display: none !important;
}

/* ==============================================
   RESPONSIVIDADE (MOBILE FIRST AJUSTES)
   ============================================== */
@media (max-width: 420px) {
  .quiz-container {
    padding: 34px 14px 40px;
  }

  .welcome-headline {
    font-size: 1.45rem;
  }

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

  .btn-primary.btn-cta {
    font-size: 0.95rem;
    padding: 15px 18px;
  }

  .option-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .option-emoji {
    font-size: 1.45rem;
  }

  .option-title {
    font-size: 0.92rem;
  }

  .option-subtitle {
    font-size: 0.86rem;
  }

  .radar-chart-wrapper {
    height: 280px;
  }
}