/* ==========================================================================
   cat.css — antarmuka ujian CAT & lembar hasil (dipakai Cek Kesiapan, Tryout, Rapor)
   ========================================================================== */

/* ==========================================================================
   CAT: tampilan kuis
   ========================================================================== */
.cat { background: var(--bg); min-height: 70vh; }
.cat-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.cat-bar .container { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
.cat-title { display: flex; flex-direction: column; line-height: 1.25; }
.cat-title b { font-size: var(--fs-md); }
.cat-title span { font-size: var(--fs-xs); color: var(--muted); }
.cat-timer {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-md);
  background: var(--fg); color: var(--bg);
  padding: 6px 12px; border-radius: 6px;
}
.cat-timer small { font-family: var(--font-body); font-size: var(--fs-xs); opacity: .75; font-weight: 600; }

.cat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--sp-5);
  padding-block: var(--sp-5) var(--sp-7);
  align-items: start;
}
@media (max-width: 900px) {
  .cat-layout { grid-template-columns: 1fr; }
  .cat-side { order: -1; }
}
.cat-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cat-qhead {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.cat-qhead .qno { font-weight: 800; }
.cat-qbody { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.question-text { font-size: var(--fs-lg); font-weight: 600; line-height: 1.55; }
.question-context {
  padding: var(--sp-3) var(--sp-4);
  border-left: 4px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
}

/* opsi gaya CAT: radio bulat berlabel */
.cat .options { gap: var(--sp-2); }
.cat .option { padding: 12px var(--sp-4); border-width: 1px; align-items: center; border-radius: var(--radius); }
.cat .option .key { border-radius: 50%; width: 30px; height: 30px; border: 2px solid var(--line); background: var(--surface); }
.cat .option[aria-checked="true"] .key { border-color: var(--primary); }

.cat-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.cat-actions .btn { min-height: 44px; padding: 0 var(--sp-4); }
.cat-actions #btn-next { justify-self: end; }
.cat-actions #btn-prev { justify-self: start; }
.btn-doubt { background: var(--surface); border: 1px solid var(--accent); color: var(--accent); }
.btn-doubt[aria-pressed="true"] { background: var(--accent); color: #1a1204; }
@media (max-width: 480px) {
  .cat-actions { grid-template-columns: 1fr 1fr; }
  .cat-actions .btn-doubt { grid-column: 1 / -1; grid-row: 1; }
}

/* panel nomor soal */
.cat-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-3);
  position: sticky; top: 76px;
}
@media (max-width: 900px) { .cat-side { position: static; } }
.cat-side h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (max-width: 900px) { .qgrid { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
@media (max-width: 420px) { .qgrid { grid-template-columns: repeat(5, 1fr); } }
.qgrid button {
  aspect-ratio: 1;
  min-height: 34px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.qgrid button.answered { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.qgrid button.doubt { background: var(--accent); border-color: var(--accent); color: #1a1204; }
.qgrid button.current { outline: 2px solid var(--fg); outline-offset: 2px; }
.qlegend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: var(--fs-xs); color: var(--muted); }
.qlegend span { display: inline-flex; align-items: center; gap: 6px; }
.qlegend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface); }
.qlegend .l-a { background: var(--primary); border-color: var(--primary); }
.qlegend .l-r { background: var(--accent); border-color: var(--accent); }
.cat-side .summary { font-size: var(--fs-sm); display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: var(--sp-3); }

/* konfirmasi selesai */
.confirm {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 15, 30, .55);
  display: grid; place-items: center;
  padding: var(--sp-4);
}
.confirm .card { max-width: 440px; width: 100%; display: flex; flex-direction: column; gap: var(--sp-4); }

/* ==========================================================================
   Lembar hasil
   ========================================================================== */
.result-shell { max-width: 880px; margin-inline: auto; display: flex; flex-direction: column; gap: var(--sp-5); }
.report {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.report-head {
  background: var(--header-bg);
  color: #ffffff;
  padding: var(--sp-4) var(--sp-5);
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
}
.report-head b { font-size: var(--fs-md); letter-spacing: .02em; }
.report-head span { color: #b9c8e0; font-size: var(--fs-xs); font-family: var(--font-mono); }
.report-body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-5); }

.score-hero { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-5); align-items: center; }
@media (max-width: 560px) { .score-hero { grid-template-columns: 1fr; justify-items: start; } }

.gauge { position: relative; width: 150px; height: 150px; flex: 0 0 auto; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { stroke: var(--surface-2); }
.gauge .bar { stroke: var(--primary); transition: stroke-dashoffset .8s ease; }
.gauge .value { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .value b { font-size: 2.6rem; font-weight: 800; line-height: 1; display: block; font-variant-numeric: tabular-nums; }
.gauge .value small { color: var(--muted); font-size: var(--fs-xs); }

.score-table td .progress { height: 8px; min-width: 90px; }
.score-table td:nth-child(2), .score-table th:nth-child(2) { text-align: right; white-space: nowrap; }
.score-table .low .progress > span { background: var(--warn); }

.reco-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.reco-list li {
  display: grid; grid-template-columns: 34px 1fr; gap: var(--sp-3);
  padding: var(--sp-4); border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
}
.reco-list .n { width: 34px; height: 34px; border-radius: 8px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; }
.review-item { border-top: 1px solid var(--line); padding-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.review-item:first-of-type { border-top: 0; padding-top: 0; }

.save-cta {
  background: var(--header-bg);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.save-cta h2 { color: #ffffff; }
.save-cta .muted { color: #c9d6ea; }
.save-cta .btn-outline-light { background: transparent; color: #ffffff; border-color: rgba(255, 255, 255, .4); }
.save-cta .btn-outline-light:hover { border-color: #ffffff; color: #ffffff; }
.cat .option[aria-checked="true"] .key { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
