/* Quiz wizard — mobile-first, works with Pico + site theme */
.quiz-page .hero {
  padding: 28px 0 8px;
}

.quiz-page .hero__title {
  font-size: clamp(26px, 6vw, 42px);
}

.quiz-wrap {
  max-width: 560px;
  margin: 0 auto 40px;
  padding: 0 4px;
  position: relative;
}

.quiz-progress {
  margin-bottom: 1rem;
}

.quiz-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.quiz-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.quiz-progress__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.quiz-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.25rem 1rem 1rem;
  box-shadow: var(--shadow);
}

@media (min-width: 480px) {
  .quiz-card {
    padding: 1.5rem 1.35rem 1.25rem;
  }
}

.quiz-step[hidden] {
  display: none !important;
}

.quiz-step__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  line-height: 1.25;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.quiz-step__hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.quiz-options {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.quiz-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.quiz-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quiz-option__box {
  display: block;
  padding: 0.9rem 1rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.98rem;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}

.quiz-option__box strong {
  display: block;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.quiz-option__box small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.quiz-option input:checked + .quiz-option__box {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz-option input:focus-visible + .quiz-option__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .quiz-option:hover .quiz-option__box {
    border-color: var(--accent);
  }
}

.quiz-option:active .quiz-option__box {
  transform: scale(0.985);
}

.quiz-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.quiz-nav button {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.quiz-nav__back {
  background: transparent;
  border: 2px solid var(--line) !important;
  color: var(--ink);
  flex: 0 0 auto;
  padding: 0 1.1rem;
}

.quiz-nav__next,
.quiz-nav__submit {
  background: var(--accent);
  color: #fff;
}

.quiz-nav__next:disabled,
.quiz-nav__submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiz-email {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid var(--line);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
}

.quiz-geo {
  margin-top: 0.75rem;
}

.quiz-geo button {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 2px dashed var(--line);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.quiz-geo__status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.quiz-results .fit-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: system-ui, sans-serif;
}

.quiz-results-panel__title {
  margin: 0 0 0.35rem;
  font-family: system-ui, sans-serif;
  font-size: 1.15rem;
}

.quiz-results-panel__lead {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.quiz-match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.quiz-match-list__item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.quiz-match-list__rank {
  flex: 0 0 1.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  line-height: 1.4;
}

.quiz-match-list__body {
  flex: 1;
  min-width: 0;
}

.quiz-match-list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.65rem;
}

.quiz-match-list__score {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  font-family: system-ui, sans-serif;
}

.quiz-match-list__name {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
  text-decoration: none;
  color: var(--ink);
}

.quiz-match-list__name:hover {
  color: var(--accent);
}

.quiz-match-list__meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.quiz-multi-hint {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  font-family: system-ui, sans-serif;
  color: var(--accent);
  font-weight: 600;
  min-height: 1.25rem;
}

.quiz-multi-hint:empty {
  display: none;
}

fieldset.quiz-options legend {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

fieldset.quiz-options legend .req {
  color: var(--accent);
  font-weight: 600;
}

.quiz-nav__hint {
  flex: 1 1 100%;
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-family: system-ui, sans-serif;
  font-weight: 600;
  text-align: center;
  min-height: 1.2rem;
}

.quiz-loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: rgba(255, 251, 246, 0.92);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.quiz-loading[hidden] {
  display: none !important;
}

.quiz-loading__panel {
  text-align: center;
  max-width: 280px;
}

.quiz-loading__spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: quiz-spin 0.85s linear infinite;
}

@keyframes quiz-spin {
  to {
    transform: rotate(360deg);
  }
}

.quiz-loading__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}

.quiz-loading__status {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
  min-height: 2.6rem;
}

.quiz-card.is-submitting {
  pointer-events: none;
  opacity: 0.55;
}
