/* ─────────────────────────────────────────────────────────────────────────
   style.css — Quiz Diagnóstico Estratégico
   Thiago Santos · Redesign 2026
   ───────────────────────────────────────────────────────────────────────── */

/* ── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  /* Cores da marca (tema claro) */
  --color-bg:          #f2f2f2;
  --color-surface:     #e0e0e0;
  --color-surface-2:   #cfcfcf;
  --color-border:      #313131;
  --color-muted:       #2a292a;
  --color-text:        #1b1b1b;
  --color-accent:      #1b1b1b;

  /* Tipografia da marca */
  --font-title:        'Merriweather', serif;
  --font-body:         'DM Sans', sans-serif;

  /* Espaçamentos */
  --spacing-xs:        8px;
  --spacing-sm:        16px;
  --spacing-md:        24px;
  --spacing-lg:        40px;
  --spacing-xl:        64px;

  /* Layout */
  --max-width:         640px;
  --radius:            12px;
  --radius-lg:         20px;
  --transition:        0.2s ease;

  /* Card */
  --card-shadow:       0 4px 24px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.04);
  --progress-h:        3px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── BARRA DE PROGRESSO ──────────────────────────────────────────────────── */
.progress-bar-track {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--progress-h);
  background-color: var(--color-surface);
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
  border-radius: 0;
}

/* Oculta a barra na tela de boas-vindas */
.progress-bar-track.hidden {
  opacity: 0;
  pointer-events: none;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-text);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 0;
}

/* ── HEADER COM LOGOTIPO ─────────────────────────────────────────────────── */
.site-header {
  background: transparent;
  padding: 24px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
}

.site-header__logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

/* ── CONTAINER PRINCIPAL ─────────────────────────────────────────────────── */
.quiz-container {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* ── ETAPAS ──────────────────────────────────────────────────────────────── */
.quiz-step {
  width: 100%;
  min-height: calc(100dvh - 88px); /* desconta o header */
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg) var(--spacing-sm);

  /* Estado inicial para animação de entrada */
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

/* Etapa ativa */
.quiz-step.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

/* Etapa saindo (animate para fora à esquerda) */
.quiz-step.step-exit {
  opacity: 0 !important;
  transform: translateX(-16px) !important;
  transition: opacity 0.18s ease, transform 0.18s ease !important;
  pointer-events: none;
}

/* ── CARD PRINCIPAL (.step-inner) ────────────────────────────────────────── */
.step-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.step-inner--center {
  align-items: center;
  text-align: center;
}

/* ── TELA DE BOAS-VINDAS (step-welcome) ──────────────────────────────────── */
.welcome-description {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.65;
  max-width: 480px;
}

.welcome-detail {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-surface-2);
  margin-top: -8px;
}

/* ── TIPOGRAFIA — TÍTULOS ─────────────────────────────────────────────────── */
.step-title {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.3;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.step-subtitle {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(16px, 2.8vw, 22px);
  line-height: 1.4;
  color: var(--color-muted);
  margin-top: -8px;
}

/* Pergunta do quiz */
.question-text {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(18px, 3.2vw, 24px);
  line-height: 1.35;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* ── CAMPO DE INPUT ───────────────────────────────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.quiz-input {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e0e0e0;
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 18px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.quiz-input::placeholder {
  color: var(--color-surface-2);
}

.quiz-input:focus {
  border-color: var(--color-text);
  box-shadow: 0 0 0 3px rgba(27, 27, 27, 0.08);
}

/* Texto auxiliar */
.field-hint {
  font-size: 13px;
  color: var(--color-surface-2);
  line-height: 1.5;
}

/* ── OPÇÕES DO QUIZ ───────────────────────────────────────────────────────── */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.option-item {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e0e0e0;
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  padding: 14px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.option-item:hover {
  border-color: var(--color-muted);
  background: #f9f9f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.option-item.selected {
  border-color: var(--color-text);
  background: var(--color-bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ── BOTÃO PRIMÁRIO ───────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}

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

.btn-primary:disabled {
  background: var(--color-surface-2);
  color: #ffffff;
  cursor: not-allowed;
  transform: none;
}

/* CTA do resultado */
.btn-cta {
  margin-top: var(--spacing-xs);
}

/* ── LOADING ──────────────────────────────────────────────────────────────── */
.loading-text {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(16px, 2.8vw, 20px);
  color: var(--color-muted);
  margin-bottom: var(--spacing-md);
}

/* Três pontos pulsantes */
.loading-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.loading-dots span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-surface-2);
  animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40%            { opacity: 1;    transform: scale(1); }
}

/* ── RESULTADO ────────────────────────────────────────────────────────────── */

/* Saudação */
.result-greeting {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: var(--color-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Nome do cenário */
.result-scenario-name {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

/* Blocos de conteúdo */
.result-block {
  background: #f9f9f9;
  border-radius: var(--radius);
  border: 1px solid #e0e0e0;
  padding: 20px 24px;
  margin-bottom: 0; /* gap via flex */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Container dos blocos com gap */
.result-blocks {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-surface-2);
  display: block;
}

.result-content {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
}

/* CTA do resultado */
.result-cta {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding-top: var(--spacing-lg);
}

.cta-question {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(15px, 2.5vw, 18px);
  color: var(--color-muted);
}

/* ── RESPONSIVIDADE ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .step-inner {
    padding: 32px 24px;
    border-radius: 14px;
  }

  .quiz-step {
    padding: var(--spacing-sm);
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .step-title {
    font-size: 20px;
  }
  .step-subtitle {
    font-size: 16px;
  }
  .question-text {
    font-size: 17px;
  }
  .result-scenario-name {
    font-size: 19px;
  }
}
