:root {
  --brand: #10294b;
  --brand-2: #1d4d8f;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #16202e;
  --muted: #5d6878;
  --line: #dde2ea;
  --ok: #16833a;
  --ok-bg: #e5f5ea;
  --bad: #c62828;
  --bad-bg: #fdecec;
  --warn: #9a6200;
  --warn-bg: #fff4dc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 41, 75, .06), 0 2px 8px rgba(16, 41, 75, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: var(--brand-2); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.topbar img { height: 26px; width: auto; display: block; }
.topbar .title { font-weight: 600; color: var(--brand); font-size: .95rem; margin-left: auto; text-align: right; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
}
.info-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .95rem; }
.info-grid dt { color: var(--muted); }
.info-grid dd { margin: 0; font-weight: 600; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1.5px solid #c5ccd8; border-radius: 10px;
  background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29, 77, 143, .18); }
.field-error { color: var(--bad); font-size: .85rem; margin-top: 4px; min-height: 1em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 1.05rem; border: 0; border-radius: 12px; cursor: pointer;
  padding: 14px 18px; min-height: 52px; background: var(--brand); color: #fff; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.secondary { background: #e8ecf3; color: var(--brand); }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 9px; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chip {
  font: inherit; font-weight: 700; padding: 12px 0; border-radius: 10px; border: 1.5px solid #c5ccd8; background: #fff; color: var(--text); cursor: pointer;
}
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-size: .95rem; }
.alert.err { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.info { background: #e8effa; color: var(--brand); }

.instr { white-space: pre-line; font-size: 1rem; }
.spinner { width: 34px; height: 34px; border: 4px solid #d5dbe6; border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 10px; background: #e3e8f0; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand-2); width: 0; transition: width .2s; }

/* ---------- Layar tes ---------- */
.testbar {
  position: sticky; top: 0; z-index: 20; background: var(--brand); color: #fff;
  padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.timer { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 800; letter-spacing: .5px; padding: 2px 10px; border-radius: 8px; }
.timer.low { background: #e53935; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.counter { font-weight: 700; font-size: 1rem; text-align: right; }
.secret-note { background: #fff4dc; color: #7a4d00; font-size: .8rem; text-align: center; padding: 6px 12px; border-bottom: 1px solid #f0dcae; }

.no-copy, .no-copy * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-copy img { pointer-events: none; -webkit-user-drag: none; }

.q {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px;
  position: relative; scroll-margin-top: 80px;
}
.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.q-no { font-weight: 800; color: var(--brand); }
.q-state { font-size: .8rem; color: var(--muted); }
.q-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 2px 0; }
.q .ref { display: block; width: 46%; max-width: 200px; margin: 0 auto 6px; border: 2px solid var(--brand); border-radius: 8px; }
.q .opt { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.q .answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ans {
  font: inherit; font-weight: 800; font-size: 1.05rem; min-height: 54px; border-radius: 12px; cursor: pointer;
  border: 2px solid #c5ccd8; background: #fff; color: var(--text); -webkit-tap-highlight-color: transparent;
}
.ans.ada.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.ans.tidak.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.watermark {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; opacity: .07; font-weight: 800; font-size: 1.2rem;
  transform: rotate(-18deg); white-space: nowrap; color: #000;
}

.dk-row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.dk-no { font-weight: 800; color: var(--brand); text-align: center; background: #e8ecf3; border-radius: 10px; padding: 12px 0; }
.dk-row input.filled { border-color: var(--ok); background: #f6fbf7; }

.sendstate { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; padding: 10px 16px; border-radius: 99px; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); }
.sendstate.saving { background: #e8effa; color: var(--brand); }
.sendstate.saved { background: var(--ok-bg); color: var(--ok); }
.sendstate.failed { background: var(--bad-bg); color: var(--bad); }

.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 40, .55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 20px; max-width: 420px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.offline { background: #5d6878; color: #fff; text-align: center; font-size: .85rem; padding: 6px; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px 16px 30px; }
.done-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; margin: 6px auto 12px; font-size: 40px; font-weight: 800; }
