/* =====================================================================
   BERREL — Design System
   Navy sebagai warna utama, putih sebagai ruang, emas sebagai aksen tipis.
   ===================================================================== */
:root {
  --navy-950: #011A40;
  --navy-900: #012963;
  --navy-800: #0B3576;
  --navy-700: #1F4A8A;
  --navy-600: #2E5C9F;
  --navy-100: #E3EAF5;
  --navy-50:  #F1F5FB;
  --gold-500: #E8A33D;
  --gold-400: #F2BE5C;
  --gold-100: #FCF1DC;
  --ink:      #14203A;
  --ink-2:    #3A4763;
  --muted:    #6B7690;
  --line:     #E2E7F0;
  --line-2:   #EEF1F6;
  --bg:       #F5F7FB;
  --white:    #FFFFFF;
  --green:    #1E9E61;  --green-bg: #E4F6EC;
  --red:      #D2463C;  --red-bg:   #FCEAE8;
  --amber:    #E1A21B;  --amber-bg: #FDF3DC;
  --blue:     #2F6FDB;  --blue-bg:  #E7EFFD;
  --radius:   12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 27, 58, .06);
  --shadow:   0 1px 3px rgba(10, 27, 58, .06), 0 8px 24px -12px rgba(10, 27, 58, .12);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--navy-800); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; color: var(--navy-900); }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Logo (mengikuti logo e-book Berrel) ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--navy-900); }
.logo-svg { width: 36px; height: 36px; flex: none; color: var(--navy-900); }
.logo-text { font-weight: 800; letter-spacing: .32em; font-size: 1.05rem; line-height: 1.1; color: var(--navy-900); }
.logo-text small { display: block; font-size: .58rem; letter-spacing: .2em; font-weight: 700; color: var(--gold-500); margin-top: 3px; }
.logo.on-dark .logo-svg, .logo.on-dark .logo-text { color: #fff; }
.logo.on-dark .logo-text small { color: var(--gold-400); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap; line-height: 1.2; text-decoration: none; }
.btn:focus-visible { outline: 3px solid rgba(232, 163, 61, .45); outline-offset: 2px; }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-900); color: #fff; }
.btn-gold { background: var(--gold-500); color: var(--navy-950); }
.btn-gold:hover { background: var(--gold-400); color: var(--navy-950); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--navy-600); color: var(--navy-800); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--navy-50); color: var(--navy-800); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b83a31; color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: .84rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-outline.is-loading::after { border-color: var(--line); border-top-color: var(--navy-700); }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--navy-600); cursor: pointer; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: .95rem; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(34, 71, 134, .12); }
.input.is-invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: .82rem; margin-top: 5px; }
.hint { color: var(--muted); font-size: .82rem; margin-top: 5px; }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-addon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: 6px; cursor: pointer; border-radius: 6px; }
.input-addon:hover { color: var(--navy-700); background: var(--navy-50); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--navy-700); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Cards & layout utilities ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 22px; }
.card-header { padding: 16px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--line-2); }
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stack > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt-0 { margin-top: 0 } .mb-0 { margin-bottom: 0 } .mt-2 { margin-top: 8px } .mt-3 { margin-top: 16px } .mt-4 { margin-top: 24px } .mb-3 { margin-bottom: 16px } .mb-4 { margin-bottom: 24px }
.text-right { text-align: right; } .text-center { text-align: center; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; background: var(--navy-50); color: var(--navy-700); white-space: nowrap; }
.badge-gold { background: var(--gold-100); color: #9A6412; }
.badge-green { background: var(--green-bg); color: #13724a; }
.badge-red { background: var(--red-bg); color: #a3332b; }
.badge-amber { background: var(--amber-bg); color: #96680a; }
.badge-gray { background: #EEF0F4; color: #5a6378; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Alerts / Toasts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: .92rem; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--green-bg); border-color: #bfe8d2; color: #0f5e3b; }
.alert-error { background: var(--red-bg); border-color: #f4c7c2; color: #8f2a22; }
.alert-warning { background: var(--amber-bg); border-color: #f2dca7; color: #7a5307; }
.alert-info { background: var(--blue-bg); border-color: #c9daf8; color: #1d4b9a; }
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy-700); border-radius: 10px; box-shadow: var(--shadow); padding: 12px 40px 12px 14px; font-size: .9rem; position: relative; animation: toastIn .25s ease; }
.toast-success { border-left-color: var(--green); } .toast-error { border-left-color: var(--red); } .toast-warning { border-left-color: var(--amber); } .toast-info { border-left-color: var(--blue); }
.toast-close { position: absolute; top: 8px; right: 8px; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 11px 14px; background: var(--navy-50); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFD; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table .highlight { background: var(--gold-100) !important; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: .8rem; color: var(--muted); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Empty / loading / error states ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--navy-50); color: var(--navy-600); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-icon .icon { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line-2); font-size: .85rem; color: var(--muted); }
.pagination .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span.cur { min-width: 34px; height: 34px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); background: #fff; }
.pagination span.cur { background: var(--navy-800); border-color: var(--navy-800); color: #fff; font-weight: 700; }
.pagination a:hover { border-color: var(--navy-600); }

/* ---------- Filters / toolbar ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.toolbar .input { width: auto; min-width: 160px; padding: 8px 12px; font-size: .9rem; }
.toolbar .grow { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.chip:hover { border-color: var(--navy-600); color: var(--navy-800); }
.chip.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* =====================================================================
   App shell (peserta & admin)
   ===================================================================== */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--navy-900); color: #C8D2E6; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 50; transition: transform .25s ease; }
.sidebar-head { padding: 22px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: #6F7FA3; padding: 14px 12px 6px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #C8D2E6; font-weight: 500; font-size: .92rem; position: relative; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.08); color: #fff; font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-500); }
.nav-link .icon { opacity: .85; }
.nav-link .count { margin-left: auto; background: var(--gold-500); color: var(--navy-950); font-size: .7rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; }
.sidebar-foot { padding: 14px 12px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-foot form { margin: 0; }
.sidebar-foot .nav-link { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 40; }
.topbar-title { font-weight: 700; color: var(--navy-900); font-size: 1rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-100); color: var(--navy-800); display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.avatar.gold { background: var(--gold-100); color: #9A6412; }
.user-chip .who { line-height: 1.2; }
.user-chip .who strong { display: block; font-size: .88rem; }
.user-chip .who span { font-size: .75rem; color: var(--muted); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px; cursor: pointer; color: var(--ink); }
.content { padding: 28px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--navy-700); }
.backdrop { display: none; }

/* ---------- Stat tiles ---------- */
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-700); flex: none; }
.stat-icon.gold { background: var(--gold-100); color: #9A6412; }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.55rem; font-weight: 800; color: var(--navy-900); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .78rem; color: var(--muted); }

/* ---------- Welcome banner ---------- */
.hero-card { background: var(--navy-900); color: #DCE4F2; border-radius: var(--radius); padding: 26px 28px; position: relative; overflow: hidden; border: 0; border-left: 6px solid var(--gold-500); }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(232, 163, 61, .14); }
.hero-card h1 { color: #fff; margin-bottom: 6px; }
.hero-card p { margin: 0; max-width: 560px; }
.hero-card .btn { margin-top: 16px; }

/* ---------- Package cards ---------- */
.pkg-card { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.pkg-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pkg-top { padding: 18px 20px 14px; border-bottom: 1px solid var(--line-2); }
.pkg-top h3 { margin: 10px 0 4px; font-size: 1.05rem; }
.pkg-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 20px; font-size: .85rem; color: var(--ink-2); }
.pkg-meta div { display: flex; align-items: center; gap: 8px; }
.pkg-meta .icon { width: 16px; height: 16px; color: var(--muted); }
.pkg-foot { margin-top: auto; padding: 14px 20px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line-2); }
.price { font-weight: 800; color: var(--navy-900); font-size: 1.05rem; }
.price.free { color: var(--green); }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 14px 22px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(6, 18, 41, .55); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 24px 60px -20px rgba(6, 18, 41, .45); animation: toastIn .2s ease; }
.modal-box.lg { max-width: 760px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Charts (SVG) ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.bar-row { display: grid; grid-template-columns: 70px 1fr 64px; gap: 12px; align-items: center; font-size: .85rem; margin-bottom: 10px; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy-700); border-radius: 99px; }

/* ---------- Question editor ---------- */
.option-edit { display: grid; grid-template-columns: 44px 1fr 120px; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
.option-edit.is-key { border-color: var(--green); background: #F6FCF9; }
.option-letter { width: 36px; height: 36px; border-radius: 9px; background: var(--navy-50); color: var(--navy-800); display: grid; place-items: center; font-weight: 800; }
.option-edit.is-key .option-letter { background: var(--green); color: #fff; }
.q-preview { border: 1px dashed var(--line); border-radius: 10px; padding: 18px; background: #FCFDFE; }
.q-text { font-size: 1rem; white-space: normal; }
.q-images { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.q-images figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; max-width: 320px; }
.q-images figcaption { font-size: .78rem; color: var(--muted); padding-top: 4px; }
.opt-view { display: flex; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; margin-top: 8px; }
.opt-view b { color: var(--navy-700); }
.opt-view.correct { border-color: var(--green); background: var(--green-bg); }
.opt-view .w { margin-left: auto; font-weight: 700; font-size: .8rem; color: var(--muted); }

/* =====================================================================
   Auth pages
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: #fff; }
.auth-aside { background: var(--navy-900); color: #C8D2E6; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-aside::before { content: ""; position: absolute; inset: auto -120px -160px auto; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(232, 163, 61, .1); }
.auth-aside h2 { color: #fff; font-size: 2rem; font-weight: 800; line-height: 1.2; margin: auto 0 14px; max-width: 420px; }
.auth-aside h2 em { font-style: normal; color: var(--gold-400); }
.auth-aside p { max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 auto; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; font-size: .92rem; }
.auth-points .icon { color: var(--gold-400); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 1.55rem; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 26px; }
.auth-box .alt { text-align: center; margin-top: 22px; font-size: .9rem; color: var(--muted); }
.auth-mobile-logo { display: none; margin-bottom: 26px; }
.auth.admin .auth-aside { background: var(--navy-950); }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* =====================================================================
   Landing page
   ===================================================================== */
.site-nav { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.landing-hero { background: var(--navy-900); color: #C8D2E6; padding: 84px 0 96px; position: relative; overflow: hidden; }
.landing-hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.landing-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; font-weight: 800; margin-bottom: 18px; }
.landing-hero h1 em { font-style: normal; color: var(--gold-400); }
.landing-hero p.lead { font-size: 1.08rem; max-width: 520px; margin-bottom: 28px; }
.eyebrow { display: inline-block; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--gold-400); margin-bottom: 14px; }
.mock-cat { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); color: var(--ink); }
.mock-cat .mh { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.mock-cat .mh b { color: var(--navy-900); font-variant-numeric: tabular-nums; }
.mock-cat .mq { font-size: .9rem; padding: 14px 0 6px; font-weight: 600; }
.mock-cat .mo { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: .85rem; margin-top: 7px; }
.mock-cat .mo.sel { border-color: var(--navy-700); background: var(--navy-50); font-weight: 600; }
.mock-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin-top: 14px; }
.mock-grid span { aspect-ratio: 1; border-radius: 5px; background: #E5E8EE; font-size: 9px; display: grid; place-items: center; color: var(--muted); }
.mock-grid .a { background: var(--green); color: #fff; } .mock-grid .d { background: var(--amber); color: #fff; }
.section { padding: 80px 0; }
.section-head { max-width: 620px; margin-bottom: 40px; }
.section-head h2 { font-size: 1.9rem; font-weight: 800; }
.feature { padding: 24px; }
.feature .stat-icon { margin-bottom: 14px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.cta-band { background: var(--navy-50); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 56px 0; }
.site-foot { padding: 28px 0; font-size: .85rem; color: var(--muted); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.3); }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(6,18,41,.45); z-index: 45; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-logo { display: block; }
  .landing-hero .wrap { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .content { padding: 18px 14px; }
  .topbar { padding: 0 14px; }
  .user-chip .who { display: none; }
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 14px; flex-direction: column; gap: 10px; }
  .stat-value { font-size: 1.3rem; }
  .card-body { padding: 16px; }
  .card-header, .toolbar { padding: 14px 16px; }
  .kv { grid-template-columns: 1fr !important; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .option-edit { grid-template-columns: 36px 1fr; }
  .option-edit > :last-child { grid-column: 2; }
  .toolbar .input { min-width: 0; flex: 1 1 140px; }
  .hero-card { padding: 22px; }
  .section { padding: 56px 0; }
}
.badge-blue { background: var(--blue-bg); color: #1d4b9a; }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-side-main { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .grid-main-side, .grid-side-main { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Ruang ujian CAT
   ===================================================================== */
.exam-body { background: #EEF2F8; min-height: 100vh; }
.exam-head { position: sticky; top: 0; z-index: 60; background: var(--navy-900); color: #fff; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 10px 22px; border-bottom: 3px solid var(--gold-500); }
.exam-head-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.exam-head-left .logo-svg { width: 30px; height: 30px; }
.exam-head-left .logo-text { font-size: .9rem; }
.exam-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.15); }
.exam-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.muted-light { font-size: .7rem; color: #9FB0CF; text-transform: uppercase; letter-spacing: .12em; }
.exam-timer { display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 5px 20px; }
.exam-timer-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: #9FB0CF; }
.exam-timer-value { font-size: 1.45rem; font-weight: 800; letter-spacing: .04em; }
.exam-timer.warn { background: var(--amber); border-color: var(--amber); color: var(--navy-950); }
.exam-timer.warn .exam-timer-label { color: var(--navy-900); }
.exam-timer.danger { background: var(--red); border-color: var(--red); animation: pulse 1s infinite; }
.exam-timer.danger .exam-timer-label { color: #fff; }
@keyframes pulse { 50% { opacity: .8; } }
.exam-head-right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.exam-user { display: flex; align-items: center; gap: 10px; }
.exam-user .who { line-height: 1.2; }
.exam-user .who strong { display: block; font-size: .85rem; }
.exam-user .who span { font-size: .72rem; color: #9FB0CF; }
.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: #C8D2E6; white-space: nowrap; }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: #3DD68C; }
.save-state[data-state=saving] .dot { background: var(--gold-400); animation: pulse .8s infinite; }
.save-state[data-state=error] .dot { background: #FF6B5E; }
.exam-offline { background: var(--amber-bg); color: #7a5307; border-bottom: 1px solid #f2dca7; padding: 10px 22px; font-size: .88rem; display: flex; gap: 8px; align-items: center; }
.exam-main { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; padding: 20px 22px; max-width: 1400px; margin: 0 auto; align-items: start; }
.exam-question { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: calc(100vh - 120px); }
.q-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line-2); }
.q-no { font-size: .95rem; }
.q-no strong { font-size: 1.15rem; color: var(--navy-900); }
.q-body { padding: 24px; flex: 1; }
.exam-question .q-text { font-size: 1.05rem; line-height: 1.7; white-space: pre-wrap; color: var(--ink); }
.exam-question .q-images img { max-height: 340px; }
.q-options { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.q-opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s; }
.q-opt:hover { border-color: var(--navy-600); background: var(--navy-50); }
.q-opt:focus-visible { outline: 3px solid rgba(232,163,61,.5); outline-offset: 2px; }
.q-opt .l { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--navy-800); background: #fff; }
.q-opt .t { padding-top: 4px; white-space: pre-wrap; line-height: 1.55; }
.q-opt[aria-checked=true] { border-color: var(--navy-800); background: var(--navy-50); }
.q-opt[aria-checked=true] .l { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.q-foot { display: flex; gap: 10px; justify-content: space-between; padding: 14px 24px; border-top: 1px solid var(--line-2); background: #FBFCFE; border-radius: 0 0 var(--radius) var(--radius); }
.q-foot #doubtBtn { margin-left: auto; }
.btn-doubt { background: #fff; border-color: var(--amber); color: #96680a; }
.btn-doubt:hover { background: var(--amber-bg); }
.btn-doubt[aria-pressed=true] { background: var(--amber); color: var(--navy-950); border-color: var(--amber); }
.exam-grid-toggle, .exam-grid-close { display: none; }
.exam-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow-y: auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h3 { margin: 0; }
.panel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.panel-stats div { background: var(--navy-50); border-radius: 8px; padding: 8px; text-align: center; font-size: .72rem; color: var(--muted); }
.panel-stats span { display: block; font-size: 1.15rem; font-weight: 800; color: var(--navy-900); }
.num-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.n { position: relative; aspect-ratio: 1; min-height: 38px; border-radius: 8px; border: 0; background: #DDE2EA; color: var(--ink-2); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.n:hover { filter: brightness(.95); }
.n.ans { background: var(--green); color: #fff; }
.n.dbt { background: var(--amber); color: var(--navy-950); }
.n.dbt.ans { background: var(--amber); color: var(--navy-950); box-shadow: inset 0 -6px 0 var(--green); }
.n.cur { outline: 3px solid var(--navy-800); outline-offset: 1px; }
.num-grid .cat-sep { grid-column: 1 / -1; font-size: .7rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); margin-top: 6px; }
.legend { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 7px; font-size: .8rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend .n { width: 20px; min-height: 20px; height: 20px; cursor: default; }
.finish-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.finish-stats div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.finish-stats strong { display: block; font-size: 1.5rem; color: var(--green); }
.finish-stats .warn strong { color: var(--red); }
.finish-stats .dbt strong { color: var(--amber); }
.finish-stats span { font-size: .78rem; color: var(--muted); }

@media (max-width: 1024px) {
  .exam-main { grid-template-columns: 1fr; padding: 14px; }
  .exam-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); max-height: none; border-radius: 0; z-index: 70; transform: translateX(105%); transition: transform .25s ease; }
  .exam-panel.open { transform: none; box-shadow: -20px 0 60px rgba(0,0,0,.25); }
  #panelBackdrop.open { display: block; position: fixed; inset: 0; background: rgba(6,18,41,.45); z-index: 65; }
  .exam-grid-toggle, .exam-grid-close { display: inline-flex; }
  .exam-question { min-height: calc(100vh - 100px); }
}
@media (max-width: 720px) {
  .exam-head { grid-template-columns: 1fr auto; padding: 8px 12px; gap: 10px; }
  .exam-head-right { display: none; }
  .exam-head-left .logo-text { display: none; }
  .exam-title { padding-left: 10px; }
  .exam-timer { padding: 4px 12px; }
  .exam-timer-value { font-size: 1.15rem; }
  .q-head, .q-body { padding: 14px 16px; }
  .exam-question .q-text { font-size: 1rem; }
  .q-foot { position: sticky; bottom: 0; padding: 10px; gap: 6px; flex-wrap: wrap; background: #fff; box-shadow: 0 -6px 20px rgba(10,27,58,.08); }
  .q-foot .btn { padding: 10px 12px; flex: 1; }
  .q-foot #prevBtn span, .q-foot #nextBtn span { display: none; }
  .q-foot #prevBtn, .q-foot #nextBtn { flex: 0 0 52px; }
  .q-foot #doubtBtn { margin-left: 0; }
  .exam-main { padding: 0; }
  .exam-question { border-radius: 0; border-left: 0; border-right: 0; min-height: calc(100vh - 62px); }
}

/* ---------- Halaman hasil ---------- */
.result-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; position: relative; z-index: 1; }
.total-score { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: 18px 28px; text-align: center; min-width: 190px; }
.total-score span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: #9FB0CF; }
.total-score strong { display: block; font-size: 3rem; line-height: 1.1; color: var(--gold-400); font-weight: 800; }
.total-score small { color: #C8D2E6; }
.perf-row { display: grid; grid-template-columns: 150px 1fr 56px; gap: 14px; align-items: center; margin-bottom: 16px; }
.perf-label { display: flex; flex-direction: column; line-height: 1.25; }
.perf-track { position: relative; height: 16px; background: var(--line-2); border-radius: 99px; }
.perf-fill { height: 100%; border-radius: 99px; }
.perf-fill.ok { background: var(--navy-700); } .perf-fill.no { background: var(--red); }
.perf-pg { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1px; background: var(--gold-500); border-radius: 2px; }
.perf-pg.static { position: static; display: inline-block; height: 14px; }
.perf-val { font-weight: 800; text-align: right; }
@media (max-width: 640px) { .result-hero-grid { grid-template-columns: 1fr; } .perf-row { grid-template-columns: 70px 1fr 44px; } .perf-label span { display: none; } }

/* ---------- Ranking ---------- */
.my-rank { display: inline-flex; align-items: center; gap: 8px; background: var(--gold-100); color: #7a4f0c; border-radius: 999px; padding: 7px 14px; font-size: .9rem; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; }
.podium-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 16px 18px; text-align: center; position: relative; }
.podium-card.gold { padding-top: 34px; border-color: var(--gold-500); box-shadow: 0 12px 30px -18px rgba(232,163,61,.8); }
.podium-card .avatar { width: 52px; height: 52px; margin: 0 auto 10px; font-size: 1rem; }
.podium-card.gold .avatar { background: var(--gold-100); color: #7a4f0c; width: 60px; height: 60px; }
.podium-rank { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: #9AA6BD; border: 3px solid #fff; }
.podium-card.gold .podium-rank { background: var(--gold-500); }
.podium-card.bronze .podium-rank { background: #B9774A; }
.podium-name { font-weight: 700; color: var(--navy-900); }
.podium-score { font-size: 1.7rem; font-weight: 800; color: var(--navy-900); line-height: 1.2; margin-top: 4px; }
.podium-card.gold .podium-score { color: #C47F12; font-size: 2rem; }
.podium-sub { font-size: .75rem; color: var(--muted); }
.podium-card.me { outline: 2px solid var(--navy-600); }
.rank-no { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 8px; background: var(--navy-50); font-weight: 800; color: var(--navy-800); font-variant-numeric: tabular-nums; padding: 0 6px; }
.rank-no.top1 { background: var(--gold-500); color: #fff; } .rank-no.top2 { background: #9AA6BD; color: #fff; } .rank-no.top3 { background: #B9774A; color: #fff; }
@media (max-width: 640px) { .podium { gap: 8px; } .podium-card { padding: 22px 8px 12px; } .podium-score { font-size: 1.2rem; } .podium-card.gold .podium-score { font-size: 1.4rem; } .podium-sub { display: none; } .podium-name { font-size: .8rem; } }

/* ---------- Pembahasan ---------- */
.disc-layout aside { position: sticky; top: 84px; align-self: start; }
.disc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 22px; border-bottom: 1px solid var(--line-2); }
.disc-no { width: 34px; height: 34px; border-radius: 9px; background: var(--navy-900); color: #fff; display: grid; place-items: center; font-weight: 800; }
.disc-item { border-left: 4px solid var(--line); scroll-margin-top: 84px; }
.disc-item.st-correct { border-left-color: var(--green); } .disc-item.st-wrong { border-left-color: var(--red); } .disc-item.st-blank { border-left-color: #AEB6C5; }
.opt-view.chosen-wrong { border-color: var(--red); background: var(--red-bg); }
.opt-view .w { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.disc-summary { display: flex; gap: 22px; flex-wrap: wrap; font-size: .9rem; margin: 14px 0; padding: 10px 14px; background: var(--navy-50); border-radius: 8px; }
.disc-explain { border-left: 3px solid var(--gold-500); background: #FFFBF3; padding: 12px 16px; border-radius: 0 8px 8px 0; }
.disc-explain .label { display: flex; align-items: center; gap: 6px; color: #9A6412; }
.disc-nav .num-grid { grid-template-columns: repeat(6, 1fr); }
.n.disc-correct { background: var(--green); color: #fff; } .n.disc-wrong { background: var(--red); color: #fff; } .n.disc-blank { background: #DDE2EA; }
a.n { text-decoration: none; }
@media (max-width: 1100px) { .disc-layout aside { position: static; order: -1; } .disc-nav .num-grid { grid-template-columns: repeat(10, 1fr); } }
@media (max-width: 640px) { .disc-nav .num-grid { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Pembayaran ---------- */
.pay-opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; font-weight: 400; }
.pay-opt:has(input:checked) { border-color: var(--navy-700); background: var(--navy-50); }
.pay-opt input { margin-top: 4px; accent-color: var(--navy-700); }
.pay-opt strong { display: block; color: var(--ink); }
.pay-opt small { color: var(--muted); }
.pay-amount { background: var(--navy-900); color: #fff; border-radius: 10px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-left: 5px solid var(--gold-500); }
.pay-amount span { color: #C8D2E6; font-size: .9rem; }
.pay-amount strong { font-size: 1.6rem; color: var(--gold-400); }
