/* Ruang Ujian: aplikasi siswa (PWA). Warna utama dan foto latar diatur sekolah lewat variabel di <body>. */
:root { --ink: #10231b; --muted: #4b5d55; --line: #e3ebe6; --bg: #f4f7f5; --gold: #d4a72c; --bad: #8f1d1d; --bad-bg: #fdecec; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ink); background: var(--bg); -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }
button, input, textarea, select { font: inherit; }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 1.05rem; font-weight: 800; background: var(--brand); color: #fff; text-align: center; text-decoration: none; cursor: pointer; }
.btn.light { background: #fff; color: var(--ink); border: 1px solid #cfdcd5; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn[disabled] { opacity: .5; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
.field input { font-size: 1.05rem; padding: 13px; border: 1px solid #cfdcd5; border-radius: 12px; background: #fff; width: 100%; }
.field input.code { font-size: 1.4rem; font-weight: 800; letter-spacing: .3em; text-align: center; text-transform: uppercase; border: 2px solid var(--gold); }
.err { background: var(--bad-bg); color: #7a1c1c; padding: 10px 12px; border-radius: 10px; font-size: .9rem; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* Layar berfoto */
.photo { min-height: 100vh; min-height: 100dvh; position: relative; background-color: var(--brand); background-size: cover; background-position: var(--bg-pos, center); color: #fff; }
.photo::before { content: ''; position: absolute; inset: 0; background: #06281e; opacity: var(--shade, .55); }
.photo > .inner { position: relative; min-height: 100vh; min-height: 100dvh; max-width: 480px; margin: 0 auto; padding: 52px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { width: 48px; height: 48px; border-radius: 14px; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; object-fit: contain; flex: none; }
.logo.big { width: 84px; height: 84px; border-radius: 24px; font-size: 1.8rem; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.sheet { margin-top: auto; background: #fff; color: var(--ink); border-radius: 22px; padding: 22px; box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.center { text-align: center; align-items: center; }

/* Beranda */
.hero { position: relative; height: 270px; background-color: var(--brand); background-size: cover; background-position: var(--bg-pos, center); color: #fff; }
.hero::before { content: ''; position: absolute; inset: 0; background: #06281e; opacity: var(--shade, .5); }
.hero .inner { position: relative; height: 100%; max-width: 480px; margin: 0 auto; padding: 24px 20px 60px; display: flex; flex-direction: column; justify-content: space-between; }
.home-main { max-width: 480px; margin: -44px auto 0; position: relative; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.box.lift { border: 0; box-shadow: 0 8px 24px rgba(16,35,27,.12); }
.eyebrow { font-size: .75rem; font-weight: 800; color: #8a6508; letter-spacing: .06em; text-transform: uppercase; }
.line { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; padding: 4px 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }

/* Mengerjakan */
.exam { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; background: var(--bg); user-select: none; -webkit-user-select: none; }
.exam header { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 2; }
.timer { background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.low { background: var(--bad); }
.progress { height: 6px; background: var(--line); }
.progress div { height: 6px; background: var(--brand); transition: width .2s; }
.exam main { flex: 1; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.q-body { font-size: 1.08rem; line-height: 1.6; margin: 0; white-space: pre-line; }
.opt { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 1rem; cursor: pointer; }
.opt input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.opt b { width: 22px; flex: none; }
.opt.on { border: 2px solid var(--brand); background: color-mix(in srgb, var(--brand) 10%, #fff); }
textarea.answer { width: 100%; min-height: 160px; border: 1px solid #cfdcd5; border-radius: 12px; padding: 12px; font-size: 1rem; user-select: text; -webkit-user-select: text; }
input.answer { width: 100%; border: 1px solid #cfdcd5; border-radius: 12px; padding: 13px; font-size: 1.05rem; user-select: text; -webkit-user-select: text; }
.doubt { display: flex; gap: 10px; align-items: center; color: #6b5310; font-size: .92rem; }
.doubt input { width: 20px; height: 20px; }
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; }
.nav-grid button { border: 1px solid #cfdcd5; background: #fff; border-radius: 8px; padding: 7px 0; font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--ink); }
.nav-grid button.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.nav-grid button.ragu { background: #f3d77a; border-color: #f3d77a; color: var(--ink); }
.nav-grid button.here { outline: 2px solid var(--ink); outline-offset: 1px; }
.exam footer { background: #fff; border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; position: sticky; bottom: 0; }
.exam footer .btn { padding: 14px; font-size: .98rem; }
.save-state { font-size: .75rem; color: var(--muted); }

/* Lapisan penuh: mulai, kembali ke layar penuh, terkunci */
.overlay { position: fixed; inset: 0; z-index: 10; background: #10231b; color: #fff; display: flex; align-items: center; justify-content: center; padding: 24px; }
.overlay[hidden] { display: none; }
.overlay .panel { max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 16px; text-align: center; align-items: center; }
.lock-icon { width: 88px; height: 88px; border-radius: 28px; background: #3a1414; display: grid; place-items: center; }
.events { width: 100%; background: #1c3a2e; border-radius: 14px; padding: 12px 14px; font-size: .9rem; color: #d1e7dd; text-align: left; }
