/* HomeMerit v3 — Quiz styling
   Extends v3.css visual language; quiz pages live alongside modules */

.quiz-app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.quiz-main {
  padding: 48px 56px 80px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.quiz-header {
  margin-bottom: 32px;
}
.quiz-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hm-blue);
  margin-bottom: 14px;
}
.quiz-eyebrow .pill {
  background: var(--hm-blue-soft);
  color: var(--hm-blue);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
}
.quiz-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.1;
}
.quiz-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  max-width: 620px;
  line-height: 1.55;
}

.quiz-progress {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.quiz-progress-track {
  flex-grow: 1;
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--hm-blue);
  border-radius: 100px;
  transition: width 0.35s ease;
}
.quiz-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* Questions container — shows all at once for review */
.quiz-questions {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 8px;
}

.quiz-q {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 30px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.quiz-q.answered { border-color: #cbd5e1; }
.quiz-q.correct { border-color: #10b981; box-shadow: 0 0 0 1px #10b981 inset; }
.quiz-q.incorrect { border-color: #ef4444; box-shadow: 0 0 0 1px #ef4444 inset; }

.quiz-q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--hm-blue-soft);
  color: var(--hm-blue);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 12px;
}
.quiz-q-text {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin: 0 0 18px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  user-select: none;
}
.quiz-option:hover { background: #eef2f7; }
.quiz-option.selected {
  border-color: var(--hm-blue);
  background: var(--hm-blue-soft);
  color: var(--ink);
}
.quiz-option-marker {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--muted-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.1s;
}
.quiz-option.selected .quiz-option-marker {
  border-color: var(--hm-blue);
  background: var(--hm-blue);
  color: white;
}

/* Locked state after grading */
.quiz-q.graded .quiz-option { cursor: default; }
.quiz-q.graded .quiz-option:hover { background: var(--bg); }
.quiz-q.graded .quiz-option.selected:hover { background: var(--hm-blue-soft); }

.quiz-q.graded .quiz-option.correct-answer {
  border-color: #10b981;
  background: #d1fae5;
  color: #065f46;
}
.quiz-q.graded .quiz-option.correct-answer .quiz-option-marker {
  border-color: #10b981;
  background: #10b981;
  color: white;
}
.quiz-q.graded .quiz-option.wrong-answer {
  border-color: #ef4444;
  background: #fee2e2;
  color: #7f1d1d;
}
.quiz-q.graded .quiz-option.wrong-answer .quiz-option-marker {
  border-color: #ef4444;
  background: #ef4444;
  color: white;
}

.quiz-explain {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border-left: 3px solid var(--hm-blue);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.quiz-explain strong { color: var(--ink); font-weight: 700; }
.quiz-q.correct .quiz-explain { border-left-color: #10b981; background: #ecfdf5; }
.quiz-q.incorrect .quiz-explain { border-left-color: #ef4444; background: #fef2f2; }
.quiz-explain-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: 2px;
}
.quiz-q.correct .quiz-explain-tag { background: #10b981; color: white; }
.quiz-q.incorrect .quiz-explain-tag { background: #ef4444; color: white; }
.quiz-q.correct .quiz-explain-tag::before { content: "Correct"; }
.quiz-q.incorrect .quiz-explain-tag::before { content: "Review"; }

/* Submit + footer */
.quiz-actions {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.quiz-btn {
  background: var(--hm-blue);
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.1s, transform 0.05s;
}
.quiz-btn:hover { background: var(--hm-blue-dark); }
.quiz-btn:active { transform: translateY(1px); }
.quiz-btn:disabled {
  background: var(--muted-2);
  cursor: not-allowed;
  opacity: 0.6;
}
.quiz-btn-secondary {
  background: white;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.quiz-btn-secondary:hover { background: var(--bg); color: var(--ink); }

.quiz-helper-text {
  font-size: 13px;
  color: var(--muted);
}

/* Results screen */
.quiz-results {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 44px;
  margin-top: 8px;
}
.quiz-results-top {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.quiz-score-ring {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--hm-blue) var(--score-pct, 0deg), var(--bg) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.quiz-score-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: white;
  border-radius: 50%;
}
.quiz-score-num {
  position: relative;
  z-index: 1;
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.quiz-score-num small {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}
.quiz-results-summary h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.quiz-results-summary p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
}

.quiz-results-section h3 {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 14px;
}
.quiz-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-review-item {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: #78350f;
  line-height: 1.5;
}
.quiz-review-item strong { color: #78350f; font-weight: 700; }
.quiz-perfect {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.55;
}

.quiz-results-cta {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Retry highlight */
.quiz-retry-link {
  color: var(--hm-blue);
  font-weight: 600;
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.quiz-retry-link:hover { text-decoration: underline; }

/* Quiz card on home index */
.module-card.quiz-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  border-left: 4px solid var(--hm-blue);
}
.module-card.quiz-card .card-num {
  background: var(--hm-blue);
  color: white;
  font-size: 22px;
}

/* Mobile */
@media (max-width: 768px) {
  .quiz-app { grid-template-columns: 1fr; }
  .quiz-main { padding: 32px 20px 60px; }
  .quiz-title { font-size: 28px; }
  .quiz-q { padding: 22px 20px; }
  .quiz-results { padding: 28px 22px; }
  .quiz-results-top { flex-direction: column; text-align: center; gap: 18px; }
}

/* Gate note shown when the score is below the pass mark (6/6) */
.quiz-gate-note {
  margin: 8px 0 18px;
  padding: 14px 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #9a3412;
  font-size: 14px;
  line-height: 1.5;
}
.quiz-gate-note strong { color: #c2410c; font-weight: 800; }
