/* ============================================================
   lagirame-tes — satu sistem desain
   Palet: kertas (#f6f5f1), tinta (#1a2332), aksen hijau tua (#0e6b5c)
   ============================================================ */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1a2332;
  --muted: #5b6572;
  --line: #e4e2dc;
  --accent: #0e6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0ed;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #b54708;
  --warn-soft: #fdf3e7;
  --ok: #067647;
  --ok-soft: #e7f4ec;
  --radius: 10px;
  --wrap: 1120px;
  --shadow: 0 1px 2px rgba(26, 35, 50, .06), 0 8px 24px rgba(26, 35, 50, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: clamp(21px, 3vw, 27px); }
h3 { font-size: 18px; }
p { margin: 0 0 .9em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .92em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 58px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; letter-spacing: -.02em;
}
.topbar .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--warn);
  background: var(--warn-soft); border: 1px solid #f2ddc4;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

/* ---------- disclaimer banner ---------- */
.disclaimer {
  background: var(--warn-soft);
  border-bottom: 1px solid #f2ddc4;
  color: #6b3a0a;
  font-size: 13.5px;
  padding: 8px 0;
}
.disclaimer strong { font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--accent); --btn-fg: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: var(--radius); border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-weight: 650; font-size: 15px;
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); filter: brightness(1.05); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:focus-visible, a:focus-visible, .opt:focus-visible, .pal-btn:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(14, 107, 92, .45); outline-offset: 2px;
}
.btn.ghost { --btn-bg: var(--surface); --btn-fg: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: #cfccc2; }
.btn.warn { --btn-bg: var(--warn); }
.btn.danger { --btn-bg: var(--danger); }
.btn.big { min-height: 52px; padding: 13px 26px; font-size: 16.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- hero / beranda ---------- */
.hero { padding: 56px 0 40px; }
.hero .kicker {
  font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 62ch; }

.grid-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px; padding: 8px 0 48px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.card { color: var(--ink); text-decoration: none; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d4d1c8; text-decoration: none; }
.card .t-name { font-size: 20px; font-weight: 750; }
.card .t-meta { color: var(--muted); font-size: 14px; }
.card .t-desc { font-size: 14.5px; color: var(--muted); flex: 1; }
.card .t-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.tag {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

/* lanjutkan sesi */
.resume-bar {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 16px 18px; margin: 0 0 26px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.resume-bar .grow { flex: 1; min-width: 200px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.footer .wrap { padding: 26px 20px 34px; display: grid; gap: 8px; }
.footer p { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 90ch; }

/* ---------- halaman ujian ---------- */
.exam-top {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 58px; z-index: 20;
}
.exam-top .wrap { display: flex; align-items: center; gap: 14px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.exam-top .t-name { font-weight: 700; font-size: 15px; }
.exam-top .sec-name { color: var(--muted); font-size: 14px; }
.timer {
  margin-left: auto; font-family: var(--mono); font-weight: 700; font-size: 19px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid #cfe4df; border-radius: 8px; padding: 5px 14px; font-variant-numeric: tabular-nums;
}
.timer.low { background: var(--danger-soft); color: var(--danger); border-color: #f3c9c4; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .65; } }

.exam-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 20px;
  padding: 24px 0 60px; align-items: start;
}
@media (max-width: 900px) { .exam-body { grid-template-columns: 1fr; } }

.q-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.q-num { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.q-text { font-size: 17.5px; font-weight: 550; margin-bottom: 18px; white-space: pre-wrap; }
.q-passage {
  background: #faf9f6; border: 1px solid var(--line); border-radius: 8px;
  padding: 16px 18px; font-size: 15.5px; margin-bottom: 18px; white-space: pre-wrap;
}
.q-audio-ref { font-size: 13px; color: var(--muted); margin: -8px 0 14px; }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 9px;
  padding: 12px 14px; font: inherit; font-size: 15.5px; cursor: pointer; color: var(--ink);
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
  min-height: 48px; width: 100%;
}
.opt:hover { border-color: #b9b5a9; transform: translateY(-1px); }
.opt .key {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px;
  border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 750; font-size: 13.5px; color: var(--muted); background: #faf9f6;
}
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-pressed="true"] .key { background: var(--accent); border-color: var(--accent); color: #fff; }

.q-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* audio bar */
.audio-bar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 18px; display: grid; gap: 10px;
}
.audio-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.audio-item .a-title { font-weight: 650; font-size: 14.5px; }
.audio-item .a-state { font-size: 13px; color: var(--muted); }
.play-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 7px 14px; border-radius: 8px;
  border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent);
  font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
  transition: background .12s ease, transform .12s ease;
}
.play-btn:hover { background: var(--accent-soft); transform: translateY(-1px); }
.play-btn:disabled { opacity: .5; cursor: default; transform: none; }
.play-btn.playing { background: var(--accent); color: #fff; }

/* palet nomor */
.palette {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; position: sticky; top: 126px;
}
.palette h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.pal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 12px; }
.pal-btn {
  aspect-ratio: 1; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface);
  font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; color: var(--muted);
  transition: all .12s ease; position: relative;
}
.pal-btn:hover { border-color: #b9b5a9; transform: translateY(-1px); }
.pal-btn.current { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pal-btn.answered { background: var(--accent-soft); border-color: #bcd9d2; color: var(--accent); }
.pal-btn.flagged::after {
  content: ""; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--warn); border: 2px solid var(--surface);
}
.legend { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--line); display: inline-block; }
.legend i.a { background: var(--accent-soft); border-color: #bcd9d2; }
.legend i.f::after { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin: 1px; }

.pal-nav { display: grid; gap: 8px; }
.pal-nav .btn { width: 100%; }

/* writing */
.writing-box textarea {
  width: 100%; min-height: 260px; resize: vertical;
  font: inherit; font-size: 15.5px; line-height: 1.6; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 9px; padding: 14px 16px; background: #fdfdfc;
}
.writing-box textarea:focus { outline: 3px solid rgba(14,107,92,.35); outline-offset: 1px; border-color: var(--accent); }
.wordcount { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.wordcount b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* speaking */
.speak-box { display: grid; gap: 12px; }
.rec-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 16px;
  border-radius: 9px; border: 1.5px solid var(--danger); background: var(--surface); color: var(--danger);
  font: inherit; font-weight: 650; cursor: pointer; transition: all .12s ease;
}
.rec-btn:hover { background: var(--danger-soft); transform: translateY(-1px); }
.rec-btn.recording { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
.rec-list { display: grid; gap: 8px; }
.rec-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: #faf9f6; font-size: 14px;
}
.rec-item audio { height: 36px; max-width: 260px; }
.rec-item .del { border: 0; background: none; color: var(--danger); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; }

/* intro tes */
.intro-card { max-width: 720px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.intro-card .meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.intro-card ul.sec-list { margin: 0 0 20px; padding-left: 0; list-style: none; display: grid; gap: 7px; }
.intro-card ul.sec-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; font-size: 15px; }
.intro-card ul.sec-list .m { color: var(--muted); white-space: nowrap; }

/* hasil */
.results { padding: 30px 0 60px; display: grid; gap: 20px; }
.score-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }
.score-big { font-size: clamp(40px, 7vw, 62px); font-weight: 800; letter-spacing: -.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.score-sub { color: var(--muted); font-size: 14.5px; }
.score-note { margin-top: 10px; font-size: 13px; color: var(--warn); }
.sec-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.sec-score { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; }
.sec-score .n { font-size: 13px; color: var(--muted); }
.sec-score .v { font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; }

.pembahasan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px 18px; }
.pembahasan details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.pembahasan details:last-child { border-bottom: 0; }
.pembahasan summary { cursor: pointer; font-weight: 650; font-size: 15px; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.pembahasan summary::-webkit-details-marker { display: none; }
.pembahasan summary .dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; }
.dot.ok { background: var(--ok); } .dot.no { background: var(--danger); } .dot.skip { background: var(--muted); }
.pb-body { padding: 10px 0 6px 19px; font-size: 14.5px; display: grid; gap: 6px; }
.pb-body .row { display: flex; gap: 8px; }
.pb-body .lbl { color: var(--muted); flex: 0 0 110px; font-size: 13px; padding-top: 1px; }
.pb-correct { color: var(--ok); font-weight: 650; }
.pb-wrong { color: var(--danger); font-weight: 650; }
.pb-explain { background: #faf9f6; border-left: 3px solid var(--accent-soft); padding: 8px 12px; border-radius: 0 7px 7px 0; color: var(--ink); }
.pb-text { white-space: pre-wrap; background: #faf9f6; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

.banner {
  border-radius: var(--radius); padding: 13px 16px; font-size: 14.5px; margin-bottom: 18px;
  border: 1px solid; display: flex; gap: 10px; align-items: flex-start;
}
.banner.info { background: var(--accent-soft); border-color: #cfe4df; color: #0a4a40; }
.banner.warn { background: var(--warn-soft); border-color: #f2ddc4; color: #6b3a0a; }

@media (max-width: 640px) {
  .hero { padding: 36px 0 26px; }
  .q-card { padding: 18px; }
  .exam-top { top: 57px; }
  .timer { font-size: 16.5px; padding: 4px 10px; }
  .palette { position: static; }
  .btn.big { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
