/* =========================================================
   CBT Try Out — gaya tampilan sisi siswa
   Semua selector di-scope di bawah #cbt-root supaya tidak
   bertabrakan dengan CSS tema WordPress yang sedang aktif.
   ========================================================= */
#cbt-root {
  --cbt-paper: #F7F5EF;
  --cbt-ink: #1B2A4A;
  --cbt-ink-soft: #3C4F73;
  --cbt-ink-faint: #7A88A3;
  --cbt-line: #DAD4C4;
  --cbt-accent: #C1893E;
  --cbt-accent-soft: #F1DFC0;
  --cbt-success: #2F6F4E;
  --cbt-success-soft: #DCEBE2;
  --cbt-danger: #A83232;

  background: var(--cbt-paper);
  color: var(--cbt-ink);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  border: 1.5px solid var(--cbt-line);
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
}
#cbt-root * { box-sizing: border-box; }
#cbt-root button { font-family: inherit; cursor: pointer; }
#cbt-root .cbt-hidden { display: none !important; }

.cbt-btn {
  border: 1.5px solid var(--cbt-ink);
  background: transparent;
  color: var(--cbt-ink);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}
.cbt-btn-primary { background: var(--cbt-ink); color: var(--cbt-paper); }
.cbt-btn-ghost { border-color: var(--cbt-line); color: var(--cbt-ink-soft); }
.cbt-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Intro screen ---------- */
.cbt-intro { padding: 2rem 1.8rem; }
.cbt-intro h2 { margin: 0 0 0.5rem; }
.cbt-intro p { color: var(--cbt-ink-soft); line-height: 1.6; margin: 0.4rem 0; }
.cbt-intro-meta { display: flex; gap: 1.4rem; margin: 1.2rem 0; font-size: 0.9rem; color: var(--cbt-ink-soft); }

/* ---------- Exam header ---------- */
.cbt-exam-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.4rem; border-bottom: 1.5px solid var(--cbt-ink);
  background: #fff; flex-wrap: wrap; gap: 0.8rem;
}
.cbt-eyebrow { color: var(--cbt-accent); font-size: 0.78rem; font-weight: 600; margin: 0; }
.cbt-exam-title { font-size: 1.1rem; font-weight: 700; margin: 0.2rem 0 0; }
.cbt-timer { text-align: right; }
.cbt-timer-label { font-size: 0.7rem; color: var(--cbt-ink-faint); margin: 0; }
.cbt-timer-value { font-size: 1.3rem; font-weight: 600; margin: 0; letter-spacing: 0.02em; }
.cbt-timer-value.warning { color: var(--cbt-danger); }

/* ---------- Body layout ---------- */
.cbt-exam-body { display: flex; }
.cbt-sidebar {
  width: 220px; flex-shrink: 0; border-right: 1.5px solid var(--cbt-line);
  padding: 1rem; background: #fff; max-height: 70vh; overflow-y: auto;
}
.cbt-summary { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.82rem; margin-bottom: 1rem; }
.cbt-summary span { display: flex; justify-content: space-between; color: var(--cbt-ink-soft); }
.cbt-summary b { color: var(--cbt-ink); }
.cbt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
.cbt-grid-btn {
  aspect-ratio: 1; border: 1.5px solid var(--cbt-line); border-radius: 4px;
  background: #fff; font-size: 0.8rem; color: var(--cbt-ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.cbt-grid-btn.current { border-width: 2px; border-color: var(--cbt-ink); font-weight: 700; color: var(--cbt-ink); }
.cbt-grid-btn.answered { background: var(--cbt-success-soft); border-color: var(--cbt-success); color: var(--cbt-success); }
.cbt-grid-btn.flagged { background: var(--cbt-accent-soft); border-color: var(--cbt-accent); color: var(--cbt-accent); }

.cbt-main { flex: 1; padding: 1.4rem 1.6rem 1.8rem; min-width: 0; max-height: 70vh; overflow-y: auto; }
.cbt-context {
  border: 1.5px solid var(--cbt-line); border-radius: 6px; padding: 1rem 1.2rem;
  margin-bottom: 1.2rem; background: #fff;
}
.cbt-context-label { font-size: 0.72rem; color: var(--cbt-accent); font-weight: 600; display: block; margin-bottom: 0.5rem; }
.cbt-section-image { margin: 0 0 1rem; }
.cbt-section-image img { max-width: 100%; max-height: 340px; border-radius: 6px; border: 1.5px solid var(--cbt-line); display: block; }

/* "Kertas" bacaan ala dokumen Word: tiap paragraf jelas terpisah,
   rata kanan-kiri, dan enak dibaca — bukan satu blok teks numpuk. */
.cbt-passage-paper {
  background: #fff;
  border: 1px solid var(--cbt-line);
  border-radius: 4px;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 1px 3px rgba(27, 42, 74, 0.08);
  font-family: Georgia, "Times New Roman", serif;
  max-height: 340px;
  overflow-y: auto;
}
.cbt-passage-paper p {
  line-height: 1.8;
  color: var(--cbt-ink);
  font-size: 0.98rem;
  text-align: justify;
  margin: 0 0 1.1em;
}
.cbt-passage-paper p:last-child { margin-bottom: 0; }
.cbt-audio audio { width: 100%; }
.cbt-audio-note { font-size: 0.78rem; color: var(--cbt-ink-faint); margin: 0.5rem 0 0; }

.cbt-q-number { font-size: 0.78rem; color: var(--cbt-ink-faint); margin: 0 0 0.4rem; }
.cbt-q-image { margin: 0 0 1rem; }
.cbt-q-image img { max-width: 100%; max-height: 320px; border-radius: 6px; border: 1.5px solid var(--cbt-line); display: block; }
.cbt-q-text { font-size: 1.15rem; font-weight: 600; line-height: 1.5; margin: 0 0 1.1rem; }
.cbt-options { display: flex; flex-direction: column; gap: 0.6rem; }
.cbt-essay-textarea {
  width: 100%; min-height: 160px; padding: 0.8rem 0.9rem; border: 1.5px solid var(--cbt-line);
  border-radius: 6px; font-family: inherit; font-size: 0.95rem; line-height: 1.5; resize: vertical;
}
.cbt-essay-textarea:focus { border-color: var(--cbt-ink); outline: none; }
.cbt-option {
  display: flex; align-items: flex-start; gap: 0.7rem; border: 1.5px solid var(--cbt-line);
  border-radius: 6px; padding: 0.75rem 0.9rem;
}
.cbt-option.selected { border-color: var(--cbt-ink); background: var(--cbt-accent-soft); }
.cbt-option-letter { font-weight: 700; color: var(--cbt-ink-soft); flex-shrink: 0; }
.cbt-option.selected .cbt-option-letter { color: var(--cbt-ink); }
.cbt-option input { margin: 0.2rem 0 0; flex-shrink: 0; }
.cbt-option.cbt-option-tfng .cbt-option-letter { display: none; }
.cbt-short-answer-hint { font-size: 0.82rem; color: var(--cbt-accent); font-weight: 600; margin: 0 0 0.6rem; }
.cbt-short-answer-input {
  width: 100%; max-width: 360px; padding: 0.7rem 0.9rem; border: 1.5px solid var(--cbt-line);
  border-radius: 6px; font-family: inherit; font-size: 1rem;
}
.cbt-short-answer-input:focus { border-color: var(--cbt-ink); outline: none; }

.cbt-nav { display: flex; justify-content: space-between; margin-top: 1.6rem; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- Result screen ---------- */
.cbt-result { padding: 1.8rem; }
.cbt-score-block { display: flex; align-items: center; gap: 1.4rem; padding: 1.3rem; border: 1.5px solid var(--cbt-line); border-radius: 6px; background: #fff; margin: 1rem 0 1.4rem; flex-wrap: wrap; }
.cbt-score-number { font-size: 2.6rem; font-weight: 700; }
.cbt-review-item { border: 1.5px solid var(--cbt-line); border-radius: 6px; padding: 1rem 1.2rem; margin-bottom: 0.8rem; background: #fff; }
.cbt-review-item.correct { border-left: 4px solid var(--cbt-success); }
.cbt-review-item.incorrect { border-left: 4px solid var(--cbt-danger); }
.cbt-review-item.pending { border-left: 4px solid var(--cbt-accent); }
.cbt-review-image { max-width: 100%; max-height: 240px; border-radius: 6px; margin: 0.4rem 0 0.6rem; display: block; }
.cbt-review-q { font-weight: 600; margin: 0 0 0.4rem; }
.cbt-review-row { font-size: 0.88rem; margin: 0.2rem 0; }
.cbt-review-row.wrong { color: var(--cbt-danger); }
.cbt-review-row.right { color: var(--cbt-success); }
.cbt-review-explain { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--cbt-line); font-size: 0.85rem; color: var(--cbt-ink-soft); }

/* ---------- Login wall & notices (outside #cbt-root) ---------- */
.cbt-login-wall { border: 1.5px solid #DAD4C4; border-radius: 8px; padding: 2rem; text-align: center; background: #F7F5EF; }
.cbt-login-btn { display: inline-block; margin-top: 1rem; background: #1B2A4A; color: #fff !important; padding: 0.6rem 1.4rem; border-radius: 6px; text-decoration: none; font-weight: 600; }
.cbt-notice { padding: 1rem; border: 1.5px solid #DAD4C4; border-radius: 6px; background: #F7F5EF; }
.cbt-test-list { display: flex; flex-direction: column; gap: 1rem; }
.cbt-test-list-item { border: 1.5px solid #DAD4C4; border-radius: 6px; padding: 1rem 1.2rem; background: #fff; }
.cbt-test-list-meta { font-size: 0.85rem; color: #7A88A3; }
.cbt-notice-inline { font-size: 0.82rem; color: #7A88A3; }

@media (max-width: 700px) {
  .cbt-exam-body { flex-direction: column; }
  .cbt-sidebar { width: 100%; max-height: none; border-right: none; border-bottom: 1.5px solid var(--cbt-line); }
  .cbt-grid { grid-template-columns: repeat(8, 1fr); }
  .cbt-main { max-height: none; }
}

/* =========================================================
   DASHBOARD (guru & siswa) & AUTH (daftar/login)
   Elemen ini dirender di luar #cbt-root, jadi variabel warna
   didefinisikan ulang lewat class .cbt-dash / .cbt-auth-box.
   ========================================================= */
.cbt-dash, .cbt-auth-box {
  --cbt-paper: #F7F5EF; --cbt-ink: #1B2A4A; --cbt-ink-soft: #3C4F73; --cbt-ink-faint: #7A88A3;
  --cbt-line: #DAD4C4; --cbt-accent: #C1893E; --cbt-accent-soft: #F1DFC0;
  --cbt-success: #2F6F4E; --cbt-success-soft: #DCEBE2; --cbt-danger: #A83232;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--cbt-ink);
}
.cbt-dash-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1rem; }
.cbt-dash-header h2 { margin: 0; }
.cbt-dash-title-small { font-size: 1.05rem !important; font-weight: 700; }
.cbt-dash-header-bordered { padding-bottom: 0.9rem; margin-bottom: 1.3rem; border-bottom: 1.5px solid var(--cbt-line); }
.cbt-dash-header-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.cbt-btn-logout { border-color: var(--cbt-danger); color: var(--cbt-danger); background: transparent; text-decoration: none; display: inline-block; }
.cbt-btn-logout:hover { background: var(--cbt-danger); color: #fff; }
.cbt-dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.cbt-dash-card { border: 1.5px solid var(--cbt-line); border-radius: 8px; padding: 1.1rem 1.3rem; background: #fff; }
.cbt-dash-card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.cbt-dash-desc { font-size: 0.88rem; color: var(--cbt-ink-soft); margin: 0 0 0.6rem; }
.cbt-dash-stats { display: flex; gap: 0.8rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--cbt-ink-faint); margin-bottom: 0.7rem; }
.cbt-dash-actions { font-size: 0.85rem; }
.cbt-dash-actions a { color: var(--cbt-ink-soft); text-decoration: none; }
.cbt-dash-actions a:hover { text-decoration: underline; }
.cbt-badge { font-size: 0.7rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 4px; vertical-align: middle; }
.cbt-badge-success { background: var(--cbt-success-soft); color: var(--cbt-success); }
.cbt-badge-draft { background: var(--cbt-accent-soft); color: var(--cbt-accent); }
.cbt-dash-table { width: 100%; border-collapse: collapse; background: #fff; }
.cbt-dash-table th, .cbt-dash-table td { border-bottom: 1px solid var(--cbt-line); padding: 0.5rem 0.7rem; text-align: left; font-size: 0.88rem; }
.cbt-dash-table th { color: var(--cbt-ink-faint); font-weight: 600; }

/* ---------- Sidebar layout (Kelas / Latihan Soal / Try Out / Raport) ---------- */
.cbt-dash-with-sidebar .cbt-shell { display: flex; gap: 1.4rem; align-items: flex-start; }
.cbt-sidebar-toggle {
  display: none; background: var(--cbt-ink); color: #fff; border: none; border-radius: 6px;
  padding: 0.5rem 0.8rem; font-size: 1rem; margin-bottom: 0.8rem; cursor: pointer;
}
.cbt-sidebar {
  width: 210px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.35rem;
  background: #fff; border: 1.5px solid var(--cbt-line); border-radius: 10px; padding: 0.7rem;
  position: sticky; top: 1rem;
}
.cbt-sidebar-item {
  display: flex; align-items: center; gap: 0.55rem; text-align: left; background: transparent;
  border: none; border-radius: 6px; padding: 0.6rem 0.7rem; font-size: 0.92rem; font-weight: 600;
  color: var(--cbt-ink-soft); cursor: pointer; width: 100%;
}
.cbt-sidebar-item:hover { background: var(--cbt-paper); }
.cbt-sidebar-item.active { background: var(--cbt-accent-soft); color: var(--cbt-ink); }
.cbt-sidebar-icon { font-size: 1rem; }
.cbt-panel-area { flex: 1; min-width: 0; }
.cbt-panel-hint { font-size: 0.85rem; color: var(--cbt-ink-faint); margin: -0.3rem 0 1rem; }

.cbt-category-divider {
  background: var(--cbt-accent-soft); color: var(--cbt-purple, #6B5FA8); font-weight: 700;
  font-size: 0.85rem; padding: 0.5rem 0.9rem; border-radius: 6px; margin: 1.4rem 0 0.8rem;
}
.cbt-category-divider:first-child { margin-top: 0; }

@media (max-width: 800px) {
  .cbt-sidebar-toggle { display: inline-block; }
  .cbt-dash-with-sidebar .cbt-shell { flex-direction: column; }
  .cbt-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000; width: 240px;
    transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  }
  .cbt-sidebar.open { transform: translateX(0); }
}

.cbt-join-code {
  background: var(--cbt-accent-soft); color: var(--cbt-accent); font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 4px; letter-spacing: 1px;
}
.cbt-dash-card-locked { background: #FAF9F5; opacity: 0.85; }
.cbt-locked-hint { font-size: 0.8rem; color: var(--cbt-ink-faint); margin: 0.4rem 0 0; line-height: 1.5; }
.cbt-locked-hint b { color: var(--cbt-accent); }
.cbt-join-form { display: flex; gap: 0.6rem; margin: 0.8rem 0 1.2rem; flex-wrap: wrap; }
.cbt-join-form input[type="text"] {
  border: 1.5px solid var(--cbt-line); border-radius: 6px; padding: 0.55rem 0.8rem;
  font-size: 0.95rem; flex: 1; min-width: 200px; font-family: inherit;
}
.cbt-material-feed { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.6rem; }
.cbt-material-item { border-top: 1px dashed var(--cbt-line); padding-top: 0.7rem; }
.cbt-material-title { font-weight: 600; margin: 0 0 0.25rem; font-size: 0.95rem; }
.cbt-material-desc { font-size: 0.85rem; color: var(--cbt-ink-soft); margin: 0 0 0.4rem; }
.cbt-material-links { font-size: 0.82rem; margin: 0; }
.cbt-material-links a { color: var(--cbt-blue, #3C6E9E); text-decoration: none; margin-right: 0.8rem; }
.cbt-material-links a:hover { text-decoration: underline; }
.cbt-material-date { color: var(--cbt-ink-faint); }

.cbt-auth-box { max-width: 420px; }
.cbt-auth-form { display: flex; flex-direction: column; gap: 0.9rem; }
.cbt-auth-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; font-weight: 600; color: var(--cbt-ink-soft); }
.cbt-auth-form input, .cbt-auth-form select {
  border: 1.5px solid var(--cbt-line); border-radius: 6px; padding: 0.55rem 0.7rem; font-size: 0.95rem; font-family: inherit;
}
.cbt-auth-error { background: #F3DCDC; color: var(--cbt-danger); padding: 0.7rem 0.9rem; border-radius: 6px; font-size: 0.88rem; }
.cbt-auth-hint { font-size: 0.78rem; color: var(--cbt-ink-faint); margin: 0.2rem 0 0; }
.cbt-auth-box .login label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; font-weight: 600; color: var(--cbt-ink-soft); margin-bottom: 0.8rem; }
.cbt-auth-box .login input[type="text"], .cbt-auth-box .login input[type="password"] {
  border: 1.5px solid var(--cbt-line); border-radius: 6px; padding: 0.55rem 0.7rem; font-size: 0.95rem; width: 100%;
}
.cbt-auth-box .login input[type="submit"] {
  background: var(--cbt-ink); color: #fff; border: none; border-radius: 6px; padding: 0.6rem 1.2rem; font-weight: 600; cursor: pointer;
}
