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

:root {
  --red:        #FE063B;
  --red-dark:   #c90030;
  --red-glow:   rgba(254, 6, 59, 0.15);
  --bg-blue:    #0d1a36;
  --card:       #0d1a36;
  --border:     rgba(255, 255, 255, 0.14);
  --border-red: rgba(254, 6, 59, 0.55);
  --text:       #ffffff;
  --muted:      #b8c0d4;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-blue) url('/assets/background.png') center center / cover no-repeat fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── Navbar ────────────────────────────────────────────── */
.navbar {
  width: 100%;
  background: var(--bg-blue);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
}
.navbar__logo { height: 36px; }

/* ─── Tarja de progresso (pill) ─────────────────────────── */
.tarja {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 18px auto 0;
  background: rgba(90, 20, 40, 0.85);
  border: 1px solid rgba(254, 6, 59, 0.25);
  border-radius: 999px;
  color: #ffffff;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  line-height: 1.4;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.tarja strong { font-weight: 700; }

/* ─── Page wrapper ──────────────────────────────────────── */
.page {
  width: 100%;
  max-width: 680px;
  padding: 48px 24px 80px;
}

/* ─── Hero text ─────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 40px;
}
.hero__eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.72rem, 1.6vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 12px;
}
.hero__title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.6rem, 3.6vw + 0.4rem, 2.4rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.hero__title span { color: var(--red); font-weight: 800; }
.hero__sub {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

/* ─── Quiz card ─────────────────────────────────────────── */
.quiz-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.35);
}
.quiz-card__bar {
  height: 4px;
  background: rgba(255,255,255,0.10);
  position: relative;
}
.quiz-card__bar-fill {
  height: 100%;
  background: var(--red);
  border-radius: 0 4px 4px 0;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}
.quiz-card__header {
  padding: 24px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.quiz-step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.quiz-step-counter {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.quiz-step-counter em {
  color: var(--red);
  font-style: normal;
  font-weight: 700;
}

/* ─── Steps container ───────────────────────────────────── */
.steps-wrapper {
  padding: 28px 32px 32px;
  overflow: hidden;
}
.step {
  display: none;
  animation: fadeIn 0.35s ease;
}
.step.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInBack {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
.step.anim-back { animation: fadeInBack 0.35s ease; }

.step__question {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 22px;
  line-height: 1.4;
}

/* ─── Options ───────────────────────────────────────────── */
.options { display: flex; flex-direction: column; gap: 10px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  user-select: none;
  background: rgba(255,255,255,0.04);
}
.option:hover {
  border-color: var(--border-red);
  background: var(--red-glow);
}
.option input[type="radio"],
.option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color 0.18s, background 0.18s;
  position: relative;
  cursor: pointer;
}
.option input[type="checkbox"] { border-radius: 5px; }
.option input[type="radio"]:checked,
.option input[type="checkbox"]:checked {
  border-color: var(--red);
  background: var(--red);
}
.option input[type="radio"]:checked::after {
  content: '';
  display: block;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.option input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  width: 10px; height: 7px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  position: absolute;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}
.option.selected {
  border-color: var(--border-red);
  background: var(--red-glow);
  box-shadow: 0 0 0 3px rgba(254,6,59,0.15);
}
.option__label {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* ─── Scale (Q5) ────────────────────────────────────────── */
.scale-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  padding: 0 2px;
}
.scale-options {
  display: flex;
  gap: 10px;
}
.scale-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.scale-option input[type="radio"] { display: none; }
.scale-btn {
  width: 100%;
  aspect-ratio: 1;
  max-width: 70px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--muted);
  transition: border-color 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s;
}
.scale-option:hover .scale-btn,
.scale-option input:checked ~ .scale-btn {
  border-color: var(--red);
  background: var(--red-glow);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(254,6,59,0.15);
}

/* ─── Navigation buttons ────────────────────────────────── */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px 28px;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 28px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  border: none;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 18px rgba(254,6,59,0.28);
}
.btn--primary:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(254,6,59,0.35);
}
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn--ghost:hover {
  border-color: rgba(255,255,255,0.4);
  color: var(--text);
}
.btn--hidden { visibility: hidden; pointer-events: none; }

/* ─── Success screen ────────────────────────────────────── */
.success {
  display: none;
  text-align: center;
  padding: 48px 32px;
  animation: fadeIn 0.5s ease;
}
.success.active { display: block; }
.success__icon {
  width: 64px; height: 64px;
  background: var(--red-glow);
  border: 2px solid var(--border-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success__icon svg { width: 28px; height: 28px; color: var(--red); }
.success__title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.success__sub {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  width: 100%;
  text-align: center;
  padding: 32px 24px;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 520px) {
  .navbar { display: none; }
  .steps-wrapper,
  .quiz-card__header,
  .quiz-nav { padding-left: 20px; padding-right: 20px; }
  .scale-btn { font-size: 1rem; border-radius: 9px; }
  .btn { padding: 14px 20px; font-size: 0.95rem; gap: 6px; width: 100%; }
  .quiz-nav { flex-direction: column; gap: 10px; }
}
