/* Additive-only visual overrides for Quiz.razor and Diagnostic.razor — restyles classes that
   still live in the old wwwroot/template/css/site.css (dormant only for pages that stopped
   using them) to the new apt- palette, without touching that file or renaming every markup
   class in these two large, logic-heavy pages. Loaded after site.css, so same-specificity
   rules here win by cascade order. */

.page-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--apt-indigo-deep); font-weight: 600;
  background: var(--apt-indigo-soft); padding: 5px 11px; border-radius: 999px;
}
.page-eyebrow .pulse-dot { width: 6px; height: 6px; background: var(--apt-indigo); border-radius: 50%; position: relative; }
.page-eyebrow .pulse-dot::after {
  content: ''; position: absolute; inset: -3px; background: var(--apt-indigo); border-radius: 50%;
  opacity: 0.3; animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(0.7); opacity: 0.5; } 100% { transform: scale(2.4); opacity: 0; } }

.page-title { font-size: clamp(30px, 3.6vw, 40px); line-height: 1.1; margin: 10px 0 6px; letter-spacing: -0.02em; font-weight: 700; color: var(--apt-ink); }
.page-title em { font-style: normal; color: var(--apt-indigo); }
.page-sub { color: var(--apt-ink-4); font-size: 14px; max-width: 600px; }

.breadcrumb {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 18px; background: var(--apt-card); border: 1px solid var(--apt-line);
  border-radius: 12px; margin-bottom: 24px; box-shadow: var(--apt-shadow);
}
.breadcrumb-item { font-size: 12.5px; color: var(--apt-ink-3); display: flex; align-items: center; gap: 6px; }
.breadcrumb-item strong { color: var(--apt-ink); font-weight: 600; }
.sep { color: var(--apt-ink-4); font-size: 11px; }

.stat-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: var(--apt-bg-muted); border-radius: 999px; font-size: 12px; color: var(--apt-ink-2); }
.stat-chip strong { color: var(--apt-ink); font-weight: 600; }

.quiz-progress { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.quiz-step-bar { flex: 1; height: 4px; background: var(--apt-bg-muted); border-radius: 999px; overflow: hidden; display: flex; gap: 3px; }
.quiz-step-bar .seg { flex: 1; height: 100%; background: var(--apt-bg-muted); border-radius: 999px; transition: background 0.4s; }
.quiz-step-bar .seg.done { background: var(--apt-ink); }
.quiz-step-bar .seg.current { background: linear-gradient(90deg, var(--apt-ink), var(--apt-indigo)); }

.quiz-card, .diag-card {
  background: var(--apt-card); border: 1px solid var(--apt-line); border-radius: var(--apt-radius);
  padding: 40px; box-shadow: var(--apt-shadow); position: relative; overflow: hidden;
}
.quiz-card::before, .diag-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--apt-indigo), var(--apt-mint));
}
.quiz-q-num, .diag-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--apt-ink-4); letter-spacing: 0.06em; text-transform: uppercase; }
.quiz-question { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.3; margin: 14px 0 26px; font-weight: 600; letter-spacing: -0.01em; color: var(--apt-ink); }

.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 14px; padding: 15px 18px;
  border: 1px solid var(--apt-line); border-radius: 12px; background: var(--apt-card);
  cursor: pointer; transition: all 0.15s; font-size: 14.5px; color: var(--apt-ink); text-align: left; width: 100%;
}
.quiz-option:hover { border-color: var(--apt-ink-3); background: var(--apt-bg); }
.quiz-option.selected { border-color: var(--apt-indigo); background: var(--apt-indigo-soft); }
.quiz-option.correct { border-color: var(--apt-mint); background: var(--apt-mint-soft); }
.quiz-option.incorrect { border-color: var(--apt-rose); background: var(--apt-rose-soft); }
/* Neutral "awaiting the engine's response" state — deliberately not colored correct/incorrect
   yet, since that result isn't known until CallSubmitApi actually returns. */
.quiz-option.submitting { border-color: var(--apt-indigo); background: var(--apt-indigo-soft); opacity: 0.85; }
.quiz-option[disabled] { cursor: not-allowed; }
.quiz-option .opt-key {
  width: 26px; height: 26px; border-radius: 8px; background: var(--apt-bg-muted);
  display: grid; place-items: center; font-size: 12px; color: var(--apt-ink-2); flex-shrink: 0; font-weight: 700;
}
.quiz-option.selected .opt-key { background: var(--apt-indigo); color: white; }
.quiz-option.correct .opt-key { background: var(--apt-mint); color: white; }
.quiz-option.incorrect .opt-key { background: var(--apt-rose); color: white; }
.quiz-option.submitting .opt-key { background: var(--apt-indigo); color: white; }
.quiz-option .opt-text { padding-top: 3px; }
.opt-spinner {
  width: 15px; height: 15px; margin-left: auto; flex-shrink: 0; align-self: center;
  border-radius: 50%; border: 2px solid var(--apt-indigo-soft); border-top-color: var(--apt-indigo);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.quiz-meta-bar {
  display: flex; gap: 24px; flex-wrap: wrap; padding: 16px 22px; background: var(--apt-bg);
  border: 1px solid var(--apt-line-soft); border-radius: 12px; margin-top: 24px; font-size: 12.5px;
}
.quiz-meta-bar .item { display: flex; align-items: center; gap: 8px; color: var(--apt-ink-3); }
.quiz-meta-bar .item strong { color: var(--apt-ink); font-weight: 600; }

.difficulty { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--apt-ink-3); }
.difficulty .bar-mini { width: 4px; border-radius: 1px; background: var(--apt-line); }
.difficulty .bar-mini.on { background: var(--apt-indigo); }
.difficulty .bar-mini.h1 { height: 6px; }
.difficulty .bar-mini.h2 { height: 9px; }
.difficulty .bar-mini.h3 { height: 12px; }
.difficulty .bar-mini.h4 { height: 15px; }

.result-hero { background: linear-gradient(160deg,var(--apt-navy),var(--apt-navy-2)); color: white; border-radius: var(--apt-radius); padding: 48px; }
.kpi { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 18px; }
.kpi-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.65); margin-bottom: 8px; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; line-height: 1; color: white; }

/* "Topic mastered" — light card matching the same apt-mint success language as
   .feedback-card.correct above and Lesson.razor's mastery treatment, replacing the old
   dark-navy/oklch-literal .result-hero styling for this specific screen. */
.mastered-card {
  background: var(--apt-card); border: 1px solid var(--apt-line); border-radius: var(--apt-radius);
  box-shadow: var(--apt-shadow); padding: 40px 32px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 14px;
}
.mastered-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--apt-mint); color: white; display: grid; place-items: center; }
.mastered-eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--apt-mint); font-weight: 700; }
.mastered-title { font-size: clamp(22px,3vw,30px); margin: 0; color: var(--apt-ink); font-weight: 700; letter-spacing: -0.01em; }
.mastered-body { margin: 0; color: var(--apt-ink-3); font-size: 14px; line-height: 1.55; max-width: 440px; }
.mastered-stats { display: flex; gap: 12px; width: 100%; justify-content: center; }
.mastered-stat {
  flex: 1; max-width: 180px; background: var(--apt-mint-soft); border: 1px solid #b8e6e1; border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
}
.mastered-stat .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--apt-ink-3); }
.mastered-stat .stat-value { font-size: 26px; font-weight: 700; color: var(--apt-ink); }
.mastered-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

.scrim { display: none; position: fixed; inset: 0; background: rgba(16,42,67,0.35); z-index: 40; backdrop-filter: blur(2px); }
.scrim.show { display: block; }

.feedback-card {
  margin-top: 18px; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--apt-line);
  background: var(--apt-bg); display: grid; grid-template-columns: 32px 1fr; gap: 14px;
}
.feedback-card.correct { background: var(--apt-mint-soft); border-color: #b8e6e1; }
.feedback-card.incorrect { background: var(--apt-rose-soft); border-color: #f3c9c5; }
.feedback-card .fb-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--apt-mint); color: white; display: grid; place-items: center; flex-shrink: 0; }
.feedback-card .fb-icon.incorrect { background: var(--apt-rose); }
.feedback-card .fb-title { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--apt-mint); margin-bottom: 4px; }
.feedback-card .fb-title.incorrect { color: var(--apt-rose); }
.feedback-card .fb-body { font-size: 13.5px; color: var(--apt-ink-2); line-height: 1.55; }

.hint-area { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.hint-block { border-radius: 10px; border: 1px solid #f0d9ae; background: var(--apt-amber-soft); padding: 12px 14px; }
.hint-block.info { background: var(--apt-indigo-soft); border-color: #cddcfb; }
.hint-block.info .hint-label { color: var(--apt-indigo-deep); }
.hint-label { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--apt-amber); margin-bottom: 6px; }
.hint-text { font-size: 13.5px; color: var(--apt-ink-2); line-height: 1.55; }

.modal-x-backdrop { position: fixed; inset: 0; background: rgba(16,42,67,0.5); backdrop-filter: blur(4px); z-index: 60; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-x-backdrop.show { display: flex; }
.modal-x { background: var(--apt-card); border-radius: var(--apt-radius); max-width: 520px; width: 100%; padding: 32px 32px 26px; box-shadow: var(--apt-shadow); position: relative; text-align: center; border: 1px solid var(--apt-line); }
.modal-x .modal-glyph { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 14px; background: linear-gradient(135deg, var(--apt-indigo-soft), var(--apt-mint-soft)); display: grid; place-items: center; color: var(--apt-indigo-deep); }
.modal-x h3 { font-size: 22px; letter-spacing: -0.01em; margin-bottom: 10px; font-weight: 700; color: var(--apt-ink); }
.modal-x p { color: var(--apt-ink-3); font-size: 14px; line-height: 1.55; max-width: 380px; margin: 0 auto 22px; }
.modal-x .modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-x .modal-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border: 0; background: transparent; border-radius: 8px; color: var(--apt-ink-4); cursor: pointer; }
.modal-x .modal-close:hover { background: var(--apt-bg-muted); color: var(--apt-ink); }

.prereq-block { border-radius: 12px; border: 1px solid #cddcfb; background: var(--apt-indigo-soft); padding: 12px 14px; }
.prereq-label { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--apt-indigo-deep); margin-bottom: 4px; }
.prereq-topic { font-size: 13.5px; color: var(--apt-ink-2); font-weight: 500; }

.up-next-container { display: flex; justify-content: space-between; align-items: center; background: var(--apt-indigo-soft); border-radius: 10px; padding: 11px 14px; margin-bottom: 12px; }
.up-next-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--apt-indigo); margin-bottom: 3px; }
.up-next-title { font-size: 14px; font-weight: 600; color: var(--apt-ink); }

/* ── Diagnostic.razor-specific ─────────────────────────── */
.diag-progress-strip { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--apt-indigo-soft); border-bottom: 1px solid #cddcfb; margin-bottom: 4px; border-radius: 10px; }
.diag-label { font-size: 12.5px; font-weight: 600; color: var(--apt-indigo-deep); white-space: nowrap; }
.diag-bar-track { flex: 1; height: 6px; background: #cddcfb; border-radius: 99px; overflow: hidden; }
.diag-bar-fill { height: 100%; background: var(--apt-indigo); border-radius: 99px; transition: width 0.4s ease; }

.diag-status-card { background: var(--apt-card); border: 1px solid var(--apt-line); border-radius: var(--apt-radius); padding: 24px; box-shadow: var(--apt-shadow); }
.diag-status-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.diag-status-label { font-size: 13px; font-weight: 600; color: var(--apt-ink); }
.diag-status-line { font-size: 13px; color: var(--apt-ink-3); margin: 4px 0; }
.diag-status-date { font-size: 12px; color: var(--apt-ink-4); }
.diag-status-divider { height: 1px; background: var(--apt-line-soft); margin: 14px 0; }
.diag-status-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.diag-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 16px 0; }
.diag-kpi { background: var(--apt-bg); border: 1px solid var(--apt-line-soft); border-radius: 10px; padding: 14px; text-align: center; }
.diag-mini-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.diag-mini-stat { font-size: 12.5px; color: var(--apt-ink-3); }

.diag-level-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.diag-level-pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--apt-indigo-soft); color: var(--apt-indigo-deep); }
.diag-level { font-size: 14px; font-weight: 600; color: var(--apt-ink); }

.diag-domain-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--apt-line-soft); }
.diag-domain-name { font-size: 13.5px; color: var(--apt-ink-2); }
.diag-domain-level { font-size: 12px; color: var(--apt-ink-4); }

.diag-detail-card { background: var(--apt-bg); border: 1px solid var(--apt-line-soft); border-radius: 10px; padding: 16px; margin-top: 12px; }
.diag-item-log-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--apt-line-soft); font-size: 12.5px; color: var(--apt-ink-3); }
.diag-collapse-footer { text-align: center; margin-top: 12px; }
.diag-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--apt-bg-muted); color: var(--apt-ink-4); }
