/* Baca: shared tokens and the sign-in page. A reading room at night: slate-teal desk, white pages,
   one crimson silk ribbon for the "batas baca" mark, and four marker colours for highlights. */
:root {
  --desk: #2b3a40;
  --desk-deep: #223035;
  --bar: #1f2b30;
  --line: #3a4b52;
  --on-desk: #eef2f1;
  --on-desk-muted: #a3b4b9;
  --ribbon: #c4293b;
  --ribbon-deep: #8e1b29;
  --paper: #f3f5f4;
  --paper-line: #d9dfdd;
  --ink: #1c2326;
  --ink-muted: #56636a;
  --focus: #ffd166;
  --hl-kuning: #ffe27a;
  --hl-hijau: #a8e6a1;
  --hl-biru: #a9d4ff;
  --hl-merah: #ffb3cf;
  --hl-kuning-deep: #c99a00;
  --hl-hijau-deep: #2f8a3a;
  --hl-biru-deep: #2c6fb8;
  --hl-merah-deep: #c2427a;
  --ui: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --radius-s: 6px;
  --radius-m: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--desk);
  color: var(--on-desk);
  font: 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- sign-in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card {
  width: min(380px, 100%);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-m);
  padding: 28px 24px 24px;
  position: relative;
  box-shadow: 0 18px 40px rgb(0 0 0 / .35);
}
.gate-mark { position: absolute; top: 0; right: 28px; width: 22px; height: 44px; fill: var(--ribbon); }
.gate h1 { font: 600 30px/1.1 var(--serif); margin: 0 0 8px; }
.gate p { margin: 0 0 18px; color: var(--ink-muted); font-size: 15px; }
.gate label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.gate input[type=password] {
  width: 100%; padding: 12px; border: 1.5px solid var(--paper-line); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); font-size: 17px;
}
.gate input[type=password]:focus { border-color: var(--ink); outline: none; }
.gate-error { color: var(--ribbon-deep) !important; font-weight: 700; margin: 10px 0 0 !important; }
.gate button {
  margin-top: 18px; width: 100%; padding: 12px; border: 0; border-radius: var(--radius-s);
  background: var(--ink); color: #fff; font-weight: 700; font-size: 16px;
}

/* ---- shared by the shelf and the reader */
.ic { width: 22px; height: 22px; flex: none; }
.dlg {
  border: 0; border-radius: var(--radius-m); padding: 22px; width: min(420px, calc(100vw - 32px));
  background: var(--paper); color: var(--ink); box-shadow: 0 20px 50px rgb(0 0 0 / .45);
}
.dlg::backdrop { background: rgb(15 22 25 / .6); }
.dlg h2 { font: 600 21px/1.25 var(--serif); margin: 0 0 12px; }
.dlg p { margin: 0 0 8px; color: var(--ink-muted); }
.dlg input, .dlg textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--paper-line); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); font-size: 16px;
}
.dlg textarea { min-height: 140px; resize: vertical; font: 16px/1.5 var(--serif); }
.dlg input:focus, .dlg textarea:focus { border-color: var(--ink); outline: none; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-text, .btn-solid { min-height: 44px; padding: 0 16px; border-radius: var(--radius-s); border: 0; font-weight: 700; }
.btn-text { background: none; color: var(--ink-muted); }
.btn-text:hover { background: var(--paper-line); color: var(--ink); }
.btn-solid { background: var(--ink); color: #fff; }
.btn-solid.danger { background: var(--ribbon-deep); }

#toasts {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 40; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-m); background: var(--paper); color: var(--ink);
  box-shadow: 0 10px 26px rgb(0 0 0 / .4); font-size: 15px;
}
.toast button { border: 0; background: none; color: var(--ribbon-deep); font-weight: 700; min-height: 36px; padding: 0 6px; }
