/* CKT 1 Quiz + Study Guide pages */

.quiz-main {
  flex: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 1.75rem;
}

.back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--green); }

.page-title { margin: 0 0 0.25rem; font-size: 1.35rem; }
.page-sub { margin: 0 0 1.5rem; color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }

/* ---------- Cards ---------- */
.quiz-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
}
.quiz-card__title {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
}

.quiz-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
}
.quiz-field label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.quiz-field select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.btn {
  background: var(--green);
  color: #06210f;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.3rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: var(--sans);
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
}
.btn-ghost:hover { color: var(--green); border-color: var(--green); }

.quiz-note {
  color: var(--text-faint);
  font-size: 0.82rem;
  font-family: var(--mono);
  margin: 1rem 0 0;
}

/* ---------- Progress + question header ---------- */
.quiz-progress {
  height: 5px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.9rem;
}
.quiz-progress__bar {
  height: 100%;
  background: var(--green);
  transition: width 0.25s ease;
}
.quiz-qhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.4px;
}
.quiz-qnum { color: var(--text-dim); text-transform: uppercase; }
.quiz-qcat {
  color: var(--amber);
  background: rgba(255, 176, 0, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  text-transform: uppercase;
}

.quiz-question {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  line-height: 1.45;
}

/* ---------- Choices ---------- */
.quiz-choices { display: flex; flex-direction: column; gap: 0.55rem; }
.quiz-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 7px;
  padding: 0.7rem 0.85rem;
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.quiz-choice:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--green-dim);
}
.quiz-choice:disabled { cursor: default; opacity: 0.95; }
.quiz-choice__key {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.quiz-choice__text { flex: 1; }
.quiz-choice.is-correct {
  border-color: var(--green);
  background: rgba(61, 220, 132, 0.14);
}
.quiz-choice.is-correct .quiz-choice__key {
  background: var(--green); color: #06210f; border-color: var(--green);
}
.quiz-choice.is-wrong {
  border-color: var(--danger);
  background: rgba(224, 87, 74, 0.14);
}
.quiz-choice.is-wrong .quiz-choice__key {
  background: var(--danger); color: #2a0b08; border-color: var(--danger);
}

.quiz-kbd-hint {
  margin: 0.9rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: center;
}

/* ---------- Feedback ---------- */
.quiz-feedback {
  margin-top: 1.1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.quiz-feedback__tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.quiz-feedback.ok .quiz-feedback__tag { color: var(--green); }
.quiz-feedback.no .quiz-feedback__tag { color: var(--danger); }
.quiz-feedback__explain { margin: 0 0 0.5rem; font-size: 0.9rem; line-height: 1.5; }
.quiz-feedback__ref {
  margin: 0 0 0.8rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}
.quiz-feedback .btn { margin-top: 0.2rem; }

/* ---------- Results ---------- */
.quiz-score {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.4rem;
}
.quiz-score__pct { font-size: 2.4rem; font-weight: 800; font-family: var(--mono); }
.quiz-score__pct.pass { color: var(--green); }
.quiz-score__pct.fail { color: var(--amber); }
.quiz-score__frac { color: var(--text-dim); font-size: 0.9rem; }

.quiz-review__title {
  margin: 1.3rem 0 0.6rem;
  font-size: 0.82rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.quiz-review {
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  background: var(--bg-card);
}
.quiz-review__q { margin: 0 0 0.4rem; font-size: 0.9rem; font-weight: 600; }
.quiz-review__ans { margin: 0 0 0.35rem; font-size: 0.88rem; color: var(--green); }
.quiz-review__explain { margin: 0 0 0.35rem; font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }

.quiz-actions { display: flex; gap: 0.7rem; margin-top: 1.2rem; flex-wrap: wrap; }

@media (max-width: 640px) {
  .quiz-main { padding: 1.1rem; }
  .quiz-score__pct { font-size: 2rem; }
}

/* inline links inside page intros pick up the theme green */
.page-sub a { color: var(--green); text-decoration: none; border-bottom: 1px solid var(--green-dim); }
.page-sub a:hover { border-bottom-color: var(--green); }
