/* =========================================================
   Quiz "Fábrica de Estudos" — Tamara Teixeira
   HTML/CSS/JS vanilla, sem framework, sem build.
   Visual replicado dos mockups: branco, limpo, progresso preto.
   ========================================================= */

:root {
  --ink:        #111114;   /* texto/títulos                */
  --ink-soft:   #6b7280;   /* subtítulos/ajuda             */
  --line:       #e5e7eb;   /* borda dos cards              */
  --line-2:     #d1d5db;   /* borda do radio               */
  --track:      #e5e7eb;   /* trilho da barra de progresso */
  --bar:        #111114;   /* preenchimento do progresso   */
  --card:       #ffffff;
  --bg:         #ffffff;
  --radius:     14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
               Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout geral ---------- */
.quiz {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Barra de progresso ---------- */
.progress {
  position: sticky;
  top: 0;
  height: 6px;
  width: 100%;
  background: var(--track);
  overflow: hidden;
  z-index: 10;
}
.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--bar);
  border-radius: 0 6px 6px 0;
  transition: width 320ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Corpo / centralização ---------- */
.quiz__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 56px;
}

.steps {
  width: 100%;
  max-width: 460px;
}

/* ---------- Telas ---------- */
.step { display: none; }
.step.is-active {
  display: block;
  animation: fade-in 260ms ease both;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.step__title {
  margin: 0 0 8px;
  font-size: 1.55rem;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
}
.step__help {
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- Opções ---------- */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 80ms ease;
}
.option:hover {
  border-color: var(--ink);
}
.option:active {
  transform: scale(0.99);
}
.option.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.option__radio {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  position: relative;
  transition: border-color 160ms ease;
}
.option.is-selected .option__radio {
  border-color: var(--ink);
}
.option.is-selected .option__radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--ink);
}

.option__label {
  font-size: 1rem;
  line-height: 1.35;
}

/* ---------- Tela de conclusão ---------- */
.step[data-step="conclusao"] { text-align: center; }
.spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 20px;
  border: 3px solid var(--track);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsivo ---------- */
@media (max-width: 480px) {
  .step__title { font-size: 1.35rem; }
  .quiz__body { padding: 24px 16px 48px; }
  .option { padding: 16px 16px; }
}
