/* ===================================================================
   Quiz page — styles for the mattress finding quiz
   =================================================================== */

.quiz-shell {
  min-height: 545px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Progress bar ---- */

.quiz-progress {
  width: 100%;
  max-width: 580px;
  margin-top: 8px;
}

.quiz-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.quiz-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #1a73e8, #6aa0ff);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ---- Question area ---- */

.quiz-question-area {
  width: 100%;
  max-width: 580px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 0 18px;
}

.quiz-question-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}

.quiz-question-text {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 6px;
}

.quiz-question-why {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 20px;
}

/* ---- Options ---- */

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.quiz-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.quiz-option-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
}

.quiz-option.selected .quiz-option-icon {
  background: var(--accent);
  color: white;
}

.quiz-option-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.quiz-option-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1px;
}

/* ---- Transition animations ---- */

.quiz-question-area {
  animation: quizFadeIn 0.35s ease both;
}

@keyframes quizFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quiz-exiting {
  animation: quizFadeOut 0.2s ease both;
}

@keyframes quizFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* ---- Results screen ---- */

.quiz-result {
  width: 100%;
  max-width: 580px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px 0 18px;
  animation: quizFadeIn 0.4s ease both;
}

.quiz-result-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #6aa0ff);
  color: white;
  margin-bottom: 20px;
}

.quiz-result-icon .material-symbols-outlined {
  font-size: 32px;
}

.quiz-result h2 {
  font-family: "Outfit", sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.quiz-result p {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 420px;
  margin: 0 0 24px;
  line-height: 1.6;
}

.quiz-profile-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  text-align: left;
}

.quiz-profile-card {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
}

.quiz-profile-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.88rem;
}

.quiz-profile-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.quiz-result-list {
  width: 100%;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}

.quiz-result-list h3 {
  margin: 0 0 var(--space-3);
}

.quiz-result-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.quiz-result-list li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
  font-size: 0.86rem;
}

.quiz-result-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.quiz-result-summary {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.quiz-result-summary h3 {
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.quiz-answer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.quiz-answer-row:last-child {
  border-bottom: none;
}

.quiz-answer-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.quiz-answer-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.quiz-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 24px 0 0;
}

/* ---- Back button ---- */

.quiz-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  margin-top: 16px;
  font-family: inherit;
  transition: color 0.15s;
}

.quiz-back:hover { color: var(--accent); }
.quiz-back .material-symbols-outlined { font-size: 17px; }

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .quiz-profile-grid { grid-template-columns: 1fr; }
  .quiz-shell { min-height: 520px; }
  .quiz-progress { margin-top: 18px; }
  .quiz-question-area { padding: 20px 0 32px; }
  .quiz-option { padding: 11px 14px; }
  .quiz-option-icon { width: 36px; height: 36px; font-size: 18px; border-radius: 8px; }
  .quiz-question-text { font-size: 1.15rem; margin-bottom: 4px; }
  .quiz-question-why { margin-bottom: 16px; }
  .quiz-result { padding: 20px 0 32px; }
  .quiz-result h2 { font-size: 1.3rem; }
  .quiz-result-summary { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-question-area { animation: none; }
  .quiz-exiting { animation: none; }
  .quiz-progress-fill { transition: none; }
}
