/* =========================================================================
   Salmos Explicados. Estilos (tema claro, mobile-first, sem dependências).
   Cores base vêm de config.js e são aplicadas em :root via JS.
   Os valores abaixo são fallbacks caso o JS não rode.
   ========================================================================= */

:root {
  --bg: #ffffff;
  --primary: #BF9750;
  --secondary: #112947;

  /* derivadas (recalculadas em JS a partir das cores acima) */
  --primary-soft: rgba(191, 151, 80, 0.14);
  --primary-border: rgba(191, 151, 80, 0.55);
  --gold-ink: #7c6234;               /* dourado escurecido, legível sobre branco */

  --surface: #ffffff;
  --surface-2: #f6f3ec;              /* creme suave para opções e trilhas */
  --line: rgba(17, 41, 71, 0.14);    /* borda com leve tom marinho */
  --text: #14233b;                   /* texto principal (marinho escuro) */
  --text-dim: #5c6672;               /* texto secundário */
  --on-primary: #1a1204;             /* texto sobre o dourado */

  --radius: 16px;
  --radius-sm: 12px;
  --maxw: 560px;
  --pad: clamp(16px, 4vw, 28px);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  /* halo dourado bem sutil no topo */
  background-image: radial-gradient(120% 55% at 50% -10%, rgba(191, 151, 80, 0.12), transparent 60%);
  background-attachment: fixed;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -999px; top: 0;
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 10;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------- Shell ---------- */
.quiz-shell {
  width: 100%;
  max-width: var(--maxw);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) var(--pad) env(safe-area-inset-bottom);
}

/* ---------- Header ---------- */
.quiz-header {
  padding: clamp(16px, 4vw, 24px) 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.brand-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
}
.brand-plate img { display: block; height: 38px; width: auto; max-width: 74vw; }
.brand-fallback {
  color: var(--secondary);
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 1.05rem;
}

/* barra de progresso: apenas o trilho visual, sem contagem de etapas */
.progress { width: 100%; display: flex; align-items: center; }
.progress__bar {
  flex: 1;
  height: 7px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  border-radius: 999px;
  transition: width .45s ease;
}
.progress__label { display: none; } /* oculto: não revelar quantidade de etapas */

/* ---------- Main / card ---------- */
.quiz-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding-top: clamp(10px, 3vw, 22px);
  padding-bottom: 28px;
}
.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 5vw, 32px);
  box-shadow: 0 12px 34px rgba(17, 41, 71, 0.10);
  outline: none;
}
.card:focus-visible { box-shadow: 0 0 0 3px var(--primary-border), 0 12px 34px rgba(17,41,71,.10); }

/* animação de entrada */
.card.enter { animation: fade-in .38s ease both; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Tipografia de etapa ---------- */
.eyebrow {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-ink);
  font-weight: 700;
  margin-bottom: 12px;
}
.stage-title {
  font-size: clamp(1.35rem, 5.2vw, 1.72rem);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--text);
}
.stage-sub {
  color: var(--text-dim);
  font-size: .98rem;
  margin-bottom: 22px;
}
.stage-text {
  color: var(--text-dim);
  font-size: 1.02rem;
  margin-bottom: 24px;
}

/* ícone circular */
.stage-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--secondary);
}
.stage-icon svg { width: 32px; height: 32px; }
.centered { text-align: center; }

/* ---------- Opções ---------- */
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  min-height: 44px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s ease, background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.option:hover { border-color: var(--primary-border); background: var(--surface-2); }
.option:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.option:active { transform: scale(.99); }
.option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary);
}
.option__emoji {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.35rem;
  line-height: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.option.selected .option__emoji { background: #fff; border-color: var(--primary-border); }
.option__body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.option__label { font-weight: 600; line-height: 1.3; }
.option__desc { font-size: .84rem; color: var(--text-dim); }
.option__check {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  color: var(--on-primary);
}
.option.selected .option__check { background: var(--primary); border-color: var(--primary); }
.option__check svg { width: 13px; height: 13px; opacity: 0; }
.option.selected .option__check svg { opacity: 1; }

/* ---------- Botões ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  border: none;
  width: 100%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
  font-size: 1.06rem;
  font-family: inherit;
  padding: 16px 20px;
  min-height: 52px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
  box-shadow: 0 8px 20px rgba(191, 151, 80, 0.30);
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(.99); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft), 0 8px 20px rgba(191,151,80,.30); }

.note {
  margin-top: 14px;
  text-align: center;
  font-size: .82rem;
  color: var(--text-dim);
}

/* ---------- Footer ---------- */
.quiz-footer { padding: 0 0 18px; }

/* ---------- Pilares (etapa 10) ---------- */
.pillars { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 26px; }
.pillar {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: left;
}
.pillar__num {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--gold-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: .95rem;
}
.pillar__k { font-weight: 700; }
.pillar__v { color: var(--text-dim); font-size: .92rem; }

/* ---------- Loading / análise ---------- */
.loader-ring {
  width: 84px; height: 84px;
  margin: 6px auto 22px;
  position: relative;
}
.loader-ring svg { transform: rotate(-90deg); }
.loader-ring__track { stroke: var(--surface-2); }
.loader-ring__value {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset .2s linear;
}
.loader-ring__pct {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.2rem;
  color: var(--gold-ink);
  font-variant-numeric: tabular-nums;
}
.dots::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots { 0%{content:""} 25%{content:"."} 50%{content:".."} 75%{content:"..."} 100%{content:""} }

/* ---------- Barras de perfil (etapa 14) ---------- */
.profile-bars { display: flex; flex-direction: column; gap: 18px; margin: 6px 0 22px; }
.pbar__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pbar__label { font-weight: 600; font-size: .96rem; }
.pbar__val { color: var(--gold-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.pbar__track {
  height: 10px; border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.pbar__fill {
  display: block;            /* span é inline por padrão e ignoraria width/height */
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width .9s cubic-bezier(.22,.61,.36,1);
}
.profile-insight {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  color: var(--text);
  font-size: .96rem;
  margin-bottom: 24px;
}
.profile-badge {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--secondary); font-weight: 700; font-size: .82rem;
  letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 10px;
}
.profile-badge svg { width: 18px; height: 18px; }

/* ---------- Resultado (etapa 19) ---------- */
.result-synth { color: var(--text-dim); font-size: 1.02rem; margin-bottom: 24px; }
.result-synth strong { color: var(--text); }

.section-label {
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-ink); font-weight: 700; margin: 22px 0 12px;
}

.roadmap { display: flex; flex-direction: column; gap: 0; margin-bottom: 8px; }
.milestone {
  display: flex; gap: 14px; align-items: flex-start;
  padding-bottom: 18px; position: relative;
}
.milestone:not(:last-child)::before {
  content: ""; position: absolute;
  left: 13px; top: 30px; bottom: 0;
  width: 2px; background: var(--line);
}
.milestone__dot {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  color: var(--secondary); display: grid; place-items: center; z-index: 1;
}
.milestone__dot svg { width: 15px; height: 15px; }
.milestone__k { font-weight: 700; margin-bottom: 2px; }
.milestone__v { color: var(--text-dim); font-size: .93rem; }

.deliverables { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.deliverables li { display: flex; gap: 10px; align-items: flex-start; font-size: .96rem; }
.deliverables .tick {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  color: var(--secondary); display: grid; place-items: center; margin-top: 1px;
}
.deliverables .tick svg { width: 13px; height: 13px; }

.result-cta-wrap { margin-top: 8px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .card.enter { animation: none; }
}

/* ---------- desktop refinamento ---------- */
@media (min-width: 600px) {
  .quiz-shell { padding-left: 0; padding-right: 0; }
  .brand-plate img { height: 44px; }
}
