/* Quiz funnel — reuses :root variables from styles.css */
.quiz-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px;
}

.quiz-top { display: flex; align-items: center; gap: 14px; padding: 8px 0 22px; }
.quiz-back {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  display: inline-flex; padding: 6px; border-radius: 8px;
}
.quiz-back:hover { color: var(--fg); background: var(--surface); }
.quiz-back[hidden] { visibility: hidden; }
.quiz-progress { flex: 1; height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.quiz-progress-bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.35s ease; }
.quiz-step-count { font-size: 13px; color: var(--muted); min-width: 40px; text-align: right; }

.quiz-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 0 22px; }
.quiz-eyebrow { color: var(--primary); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.quiz-body h1 { font-family: var(--font-head); font-size: clamp(24px, 4.6vw, 32px); font-weight: 800; margin: 10px 0 6px; }
.quiz-body .q-sub { color: var(--muted); margin-bottom: 22px; }

/* ---- Option grids ---- */
.q-options { display: grid; gap: 12px; }
.q-options.cols-2 { grid-template-columns: 1fr 1fr; }
.q-options.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Icon / list option */
.q-option {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 16px; border-radius: 16px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg); cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.q-option:hover { border-color: var(--primary); }
.q-option:active { transform: scale(0.99); }
.q-option.selected { border-color: var(--primary); background: rgba(47, 107, 255, 0.12); }
.q-option .q-ic { width: 42px; height: 42px; border-radius: 11px; background: rgba(47, 107, 255, 0.15); display: grid; place-items: center; flex-shrink: 0; }
.q-option .q-ic svg { width: 22px; height: 22px; color: var(--primary); }
.q-option.selected .q-ic { background: var(--primary); }
.q-option.selected .q-ic svg { color: #fff; }
.q-option .q-txt strong { display: block; font-family: var(--font-head); font-size: 15px; line-height: 1.25; }
.q-option .q-txt span { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.q-option .q-check { margin-left: auto; color: var(--primary); opacity: 0; flex-shrink: 0; }
.q-option.selected .q-check { opacity: 1; }

/* Photo option card */
.q-imgcard {
  position: relative; border-radius: 16px; overflow: hidden; cursor: pointer;
  border: 2px solid var(--border-strong); background: var(--surface);
  transition: border-color 0.15s, transform 0.1s; text-align: left; padding: 0; color: var(--fg);
}
.q-imgcard:hover { border-color: var(--primary); }
.q-imgcard:active { transform: scale(0.99); }
.q-imgcard.selected { border-color: var(--primary); }
.q-imgcard .q-photo { width: 100%; height: 110px; object-fit: cover; display: block; }
.q-imgcard .q-cap { padding: 14px 16px 16px; text-align: center; }
.q-imgcard .q-cap strong { display: block; font-family: var(--font-head); font-size: 15px; line-height: 1.25; }
.q-imgcard .q-cap span { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.q-imgcard .q-check {
  position: absolute; top: 9px; right: 9px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}
.q-imgcard.selected .q-check { opacity: 1; transform: scale(1); }

/* Body-type silhouette card */
.q-silo {
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  border-radius: 16px; border: 2px solid var(--border-strong); background: var(--surface);
  padding: 16px 10px; color: var(--muted); transition: border-color 0.15s, color 0.15s, transform 0.1s;
}
.q-silo:hover { border-color: var(--primary); }
.q-silo:active { transform: scale(0.99); }
.q-silo.selected { border-color: var(--primary); color: var(--primary); background: rgba(47,107,255,0.1); }
.q-silo svg { width: 54px; height: 96px; }
.q-silo strong { font-family: var(--font-head); font-size: 13px; color: var(--fg); }

/* Illustrated comparative card (intensity bars, week dots, clock, glass, diet icons) */
.q-illus {
  display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer;
  border-radius: 16px; border: 2px solid var(--border-strong); background: var(--surface);
  padding: 16px 8px 14px; color: var(--muted); text-align: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
}
.q-illus:hover { border-color: var(--primary); }
.q-illus:active { transform: scale(0.99); }
.q-illus.selected { border-color: var(--primary); color: var(--primary); background: rgba(47,107,255,0.1); }
.q-illus svg { width: 100%; height: 50px; }
.q-illus strong { font-family: var(--font-head); font-size: 13px; color: var(--fg); line-height: 1.2; }
.q-illus span { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* Number fields */
.q-fields { display: grid; gap: 16px; }
.q-field label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 7px; }
.q-field .q-input { display: flex; align-items: center; gap: 8px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); padding: 0 16px; }
.q-field .q-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.18); }
.q-field input { flex: 1; background: transparent; border: 0; color: var(--fg); font-size: 18px; font-family: var(--font-head); font-weight: 700; padding: 14px 0; outline: none; }
.q-field .q-suffix { color: var(--muted); font-size: 14px; }
.q-field .q-range { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.q-input.invalid { border-color: #ff6b6b; box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15); }
.q-err { color: #ff8d8d; font-size: 12px; margin-top: 6px; }
.q-err:empty { display: none; }
.q-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---- Plan result ---- */
.q-rec {
  position: relative; border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(47, 107, 255, 0.45); margin-bottom: 18px;
}
.q-rec .q-rec-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.q-rec::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,15,23,0.35) 10%, rgba(11,15,23,0.94)); z-index: 1; }
.q-rec-body { position: relative; z-index: 2; padding: 20px; min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; }
.q-rec-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.q-rec-body h2 { font-family: var(--font-head); font-size: 24px; font-weight: 800; }
.q-rec-body p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.q-rec-meta { display: flex; gap: 18px; margin-top: 14px; }
.q-rec-meta div strong { display: block; font-family: var(--font-head); font-size: 16px; }
.q-rec-meta div span { font-size: 11px; color: var(--muted); }

.q-alt-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 4px 0 10px; }
.q-alt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface);
  padding: 8px; margin-bottom: 10px; cursor: pointer; color: var(--fg);
  transition: border-color 0.15s, transform 0.1s;
}
.q-alt:hover { border-color: var(--primary); }
.q-alt:active { transform: scale(0.99); }
.q-alt img { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.q-alt .q-alt-txt strong { display: block; font-family: var(--font-head); font-size: 15px; }
.q-alt .q-alt-txt span { font-size: 12px; color: var(--muted); }
.q-alt .q-alt-go { margin-left: auto; color: var(--primary); flex-shrink: 0; }

/* Footer CTA */
.quiz-foot { padding-top: 8px; }
.quiz-cta {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: 16px; padding: 16px;
  box-shadow: 0 8px 24px var(--primary-glow); transition: background 0.15s, opacity 0.15s;
}
.quiz-cta:hover { background: var(--primary-600); }
.quiz-cta:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.quiz-secondary { text-align: center; margin-top: 14px; font-size: 14px; color: var(--muted); }
.quiz-secondary a { color: var(--primary); font-weight: 600; }
