/* =====================================================================
   Quiz Kesiapan Go Live Yonyou — Design System
   Gaya: Swiss Modernism 2.0 · warm paper + ink + satu aksen oranye
   Font: Archivo (UI/display) · IBM Plex Mono (angka, label teknis)
   Font di-self-host (assets/fonts/) agar aplikasi jalan tanpa internet.
   ===================================================================== */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/archivo-var.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/plex-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/plex-mono-600.woff2') format('woff2');
}

:root {
  /* Warna dasar */
  --paper: #f5f2ea;        /* latar halaman (warm paper) */
  --card: #fffdf8;         /* permukaan kartu */
  --ink: #191712;          /* teks utama */
  --ink-2: #5b564a;        /* teks sekunder */
  --ink-3: #8d8779;        /* teks redup / label */
  --line: #e3ddcd;         /* hairline */
  --line-2: #cfc8b4;       /* garis lebih tegas */

  /* Aksen tunggal */
  --accent: #e04b00;       /* oranye sinyal */
  --accent-down: #b93e00;  /* hover/pressed */
  --accent-soft: #fbe8da;

  /* Status semantik (selalu tampil bersama ikon + label) */
  --good: #1a7f37;   --good-soft: #e2efe0;
  --warn: #9a5b00;   --warn-soft: #f7ecd4;
  --bad: #c22f22;    --bad-soft: #f9e2de;

  --radius: 3px;
  --font-ui: 'Archivo', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --shadow-pop: 0 1px 0 var(--line), 0 12px 32px -18px rgb(25 23 18 / .35);
}

/* ---------- Reset & dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-down); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
::selection { background: var(--accent-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Tipografi ---------- */
.display { font-size: clamp(26px, 5vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.h3 { font-size: 17px; font-weight: 700; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3);
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: 13.5px; }
.tiny { font-size: 12.5px; }

/* ---------- Kerangka halaman ---------- */
.shell { max-width: 720px; margin: 0 auto; padding: 0 20px 72px; }
.shell--wide { max-width: 1120px; }

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  padding: 14px 20px;
  margin-bottom: 36px;
}
.topbar-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.brandmark {
  width: 30px; height: 30px; flex: none;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  border-radius: var(--radius);
}
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.2; }
.brand-sub { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3); }

.footer {
  max-width: 720px; margin: 0 auto; padding: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  align-items: center; justify-content: space-between;
}
.footer-link { color: var(--ink-3); white-space: nowrap; text-decoration: none; }
.footer-link:hover { color: var(--accent-down); }

/* ---------- Layout util ---------- */
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }

/* ---------- Kartu ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 26px 28px; }
@media (max-width: 560px) { .card-pad { padding: 20px 18px; } }
.card-rule { border-top: 3px solid var(--ink); }
.card-rule--accent { border-top-color: var(--accent); }
.card-rule--good { border-top-color: var(--good); }
.card-rule--warn { border-top-color: var(--warn); }
.card-rule--bad { border-top-color: var(--bad); }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; text-decoration: none;
  padding: 12px 20px; min-height: 44px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--ink); color: var(--card); }
.btn-ink { background: var(--ink); color: var(--card); }
.btn-ink:hover { background: #000; border-color: #000; color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-down); border-color: var(--accent-down); color: #fff; }
.btn-quiet { border-color: var(--line-2); color: var(--ink-2); }
.btn-quiet:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
.btn-sm { padding: 7px 12px; min-height: 34px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--ink); }

/* ---------- Form ---------- */
.field { display: block; }
.field + .field { margin-top: 18px; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.field-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; font-family: var(--font-ui); font-size: 15.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 11px 14px; min-height: 46px;
  transition: border-color .15s ease;
}
.textarea { min-height: 0; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); outline: 2px solid var(--accent); outline-offset: 1px; }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23191712' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.checkline { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; cursor: pointer; }
.checkline input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); cursor: pointer; }

/* ---------- Alert / flash ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-left: 3px solid var(--ink);
  background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; font-size: 14px;
}
.alert svg { flex: none; margin-top: 1px; }
.alert-good { border-left-color: var(--good); } .alert-good svg { color: var(--good); }
.alert-warn { border-left-color: var(--warn); } .alert-warn svg { color: var(--warn); }
.alert-bad  { border-left-color: var(--bad); }  .alert-bad svg { color: var(--bad); }

/* ---------- Badge status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 9px; border-radius: var(--radius); white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad  { background: var(--bad-soft); color: var(--bad); }
.badge-ink  { background: var(--ink); color: var(--card); }
.badge-line { border: 1px solid var(--line-2); color: var(--ink-2); }
.badge-accent { background: var(--accent-soft); color: var(--accent-down); }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3);
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ink);
}
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.table th.num { text-align: right; }
.row-off td { color: var(--ink-3); background: color-mix(in srgb, var(--paper) 55%, var(--card)); }

/* ---------- Quiz: kartu soal & opsi ---------- */
.q-index {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: .1em;
}
.q-index b { color: var(--ink); font-weight: 600; }
.choice { display: block; cursor: pointer; }
.choice + .choice { margin-top: 10px; }
.choice input { position: absolute; opacity: 0; }
.choice-body {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--card); padding: 13px 15px;
  transition: border-color .15s ease, background .15s ease;
}
.choice:hover .choice-body { border-color: var(--ink); }
.choice-key {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-2);
  transition: all .15s ease;
}
.choice-text { font-size: 15px; line-height: 1.5; padding-top: 3px; }
.choice input:checked + .choice-body { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:checked + .choice-body .choice-key { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Pick: pilihan jamak ringkas (form identitas) ----------
   Sekeluarga dengan .choice tapi peran berbeda: .choice = opsi jawaban quiz,
   .pick = memilih atribut diri. Dibedakan lewat grid 2 kolom, kode mono di
   kiri, dan tanda centang di kanan — bukan kunci huruf A-D. */
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset + .field, .field + .fieldset { margin-top: 18px; }
.fieldset > .field-label { padding: 0; }

.pick-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 480px) { .pick-grid { grid-template-columns: 1fr 1fr; } }

.pick { display: block; cursor: pointer; touch-action: manipulation; }
.pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick-body {
  display: flex; gap: 10px; align-items: center;
  min-height: 46px; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--card);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.pick:hover .pick-body { border-color: var(--ink); }
.pick-code {
  flex: none; min-width: 32px; padding: 3px 6px; text-align: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pick-name { flex: 1 1 auto; font-size: 14.5px; line-height: 1.35; }
.pick-mark {
  flex: none; width: 20px; height: 20px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  color: transparent; transition: all .15s ease;
}
.pick input:checked + .pick-body {
  border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink);
}
/* --accent-down, bukan --accent: teks mono 12px di atas #e04b00 hanya 4.06:1,
   sedangkan di atas #b93e00 mencapai 5.60:1 (lolos WCAG AA). */
.pick input:checked + .pick-body .pick-code {
  background: var(--accent-down); border-color: var(--accent-down); color: #fff;
}
.pick input:checked + .pick-body .pick-mark {
  background: var(--ink); border-color: var(--ink); color: var(--card);
}
.pick input:focus-visible + .pick-body { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ringkasan pilihan — angka pakai tabular-nums agar tidak bergoyang */
.pick-summary { margin-top: 10px; font-variant-numeric: tabular-nums; }
.pick-summary b { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }

.quiz-progress { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.quiz-progress-inner { max-width: 720px; margin: 0 auto; padding: 10px 20px; }
.progress-track { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 7px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; width: 0; transition: width .2s ease; }

/* ---------- Skor besar ---------- */
.score-hero { text-align: center; padding: 34px 20px 30px; }
.score-num { font-size: clamp(72px, 18vw, 108px); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.score-of { font-family: var(--font-mono); font-size: 14px; color: var(--ink-3); letter-spacing: .1em; }

/* ---------- Statistik & bar (dashboard) ---------- */
.stat { padding: 18px 20px; }
.stat-num { font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 6px; }
.stacked-bar { display: flex; gap: 2px; height: 20px; border-radius: var(--radius); overflow: hidden; background: var(--line); }
.stacked-bar > div { min-width: 2px; }
.mini-bar { display: flex; gap: 2px; height: 8px; border-radius: 2px; overflow: hidden; background: var(--line); min-width: 90px; }
.gap-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 12px; align-items: center; }
@media (max-width: 640px) { .gap-row { grid-template-columns: 1fr; gap: 4px; } }
.gap-track { background: var(--line); border-radius: 2px; height: 14px; }
.gap-fill { background: var(--ink); border-radius: 2px; height: 100%; min-width: 2px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 6px; }

/* ---------- Admin: sidebar ---------- */
.admin { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: none;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--paper);
}
.sidebar .brand-row { display: flex; gap: 10px; align-items: center; padding: 0 8px 18px; }
.navlink {
  display: flex; align-items: center; gap: 11px;
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink-2);
  padding: 10px 12px; border-radius: var(--radius);
  border-left: 2px solid transparent;
}
.navlink svg { flex: none; color: var(--ink-3); }
.navlink:hover { color: var(--ink); background: var(--card); }
.navlink.active { color: var(--ink); font-weight: 700; border-left-color: var(--accent); background: var(--card); }
.navlink.active svg { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-main { flex: 1; min-width: 0; padding: 30px 34px 72px; max-width: 1160px; }
@media (max-width: 940px) {
  .admin { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); width: 250px; }
  .sidebar.open { transform: none; }
  .admin-main { padding: 20px 18px 64px; }
  .admin-topbar { display: flex !important; }
  .scrim { position: fixed; inset: 0; z-index: 40; background: rgb(25 23 18 / .35); }
}
.admin-topbar {
  display: none; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--paper);
  position: sticky; top: 0; z-index: 30;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--card); color: var(--ink); cursor: pointer;
}

/* ---------- Halaman kosong ---------- */
.empty { text-align: center; padding: 56px 24px; color: var(--ink-2); }
.empty svg { color: var(--line-2); margin: 0 auto 14px; }

/* ---------- Lightbox gambar soal ---------- */
.zoomable { cursor: zoom-in; }
.img-btn { display: block; width: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; text-align: left; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgb(25 23 18 / .88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: var(--radius); background: #fff; }
.lightbox-hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: rgb(255 255 255 / .75);
}

/* ---------- Panel kumpul jawaban (soal belum terjawab / konfirmasi) ---------- */
.submit-panel { border-left: 3px solid var(--warn); }
.submit-panel--ok { border-left-color: var(--good); }
.missed-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.missed-link {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--warn); color: var(--warn);
  padding: 5px 11px; border-radius: var(--radius); cursor: pointer; background: transparent;
}
.missed-link:hover { background: var(--warn-soft); color: var(--warn); }
.q-flash { animation: qflash 1.2s ease 2; }
@keyframes qflash {
  0%, 100% { border-color: var(--line); }
  35% { border-color: var(--warn); box-shadow: 0 0 0 2px var(--warn-soft); }
}

/* ---------- Paginasi ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pager-info { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); letter-spacing: .06em; }

/* ---------- Util kecil ---------- */
.hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }
.mt-0 { margin-top: 0 !important; }
.thumb { max-height: 150px; border: 1px solid var(--line); border-radius: var(--radius); }
