@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap");

:root {
  --gold: #E8B931;
  --gold-2: #C99A2E;
  --gold-soft: #F5DC8E;
  --ink: #1C140E;
  --ink-2: #2B1D14;
  --brown: #5A3E2B;
  --muted: #7A6A5A;
  --muted-2: #9C8D7C;
  --cream: #F4F0E8;
  --paper: #FFFFFF;
  --line: rgba(28, 20, 14, .12);
  --ok: #3E9B63;
  --danger: #C2412D;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* One typeface everywhere: labels, figures and official documents all use Plus Jakarta Sans. */
  --mono: var(--sans);
  --serif: var(--sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; -webkit-font-smoothing: antialiased; }
body { font-family: var(--sans); }
.rec, .timer, .ms, .num, .holdbar, table.list .no, table.list .when { font-variant-numeric: tabular-nums; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }

.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 700; font-size: 14px; transition: transform .08s, filter .12s, background .12s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-gold { color: var(--ink); background: linear-gradient(180deg, #EFD47C, #C99E35); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 10px 24px -12px rgba(212,175,55,.6); }
.btn-gold:hover:not(:disabled) { filter: brightness(1.05); }
.btn-dark { color: var(--gold); background: var(--ink); box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.btn-dark:hover:not(:disabled) { background: var(--ink-2); }
.btn-ghost { color: inherit; border: 1px solid currentColor; opacity: .85; }
.btn-ghost:hover:not(:disabled) { opacity: 1; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-danger { color: #fff; background: var(--danger); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }
.caret::after { content: "▍"; animation: blink 1s steps(1) infinite; margin-left: 1px; color: var(--gold); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; padding: 12px 20px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 20px 40px -16px rgba(0,0,0,.6); border: 1px solid rgba(232,185,49,.35); max-width: calc(100vw - 32px); }

/* ─────────── Official documents (BAP / Laporan Polisi) ─────────── */
.doc { animation: scaleIn .55s var(--ease-out) both; width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; padding: 22mm 22mm 24mm; background: #fff; color: #000; font-family: var(--serif); font-size: 12pt; line-height: 1.5; box-shadow: 0 30px 70px -30px rgba(40,25,10,.45); }
.doc h1, .doc h2, .doc h3 { font-family: var(--serif); margin: 0; }
.doc .kop { display: grid; grid-template-columns: 1fr; text-align: center; gap: 0; font-weight: 700; line-height: 1.3; font-size: 11.5pt; }
.doc .kop-left { text-align: left; display: inline-block; }
.doc .kop-left div { border-bottom: 0; }
.doc .kop-rule { border-bottom: 1.5pt solid #000; width: 72mm; margin: 2px 0 0; }
.doc .logo { display: block; width: 64px; height: 64px; object-fit: contain; margin: 14px auto 6px; }
.doc .title { text-align: center; margin: 10px 0 2px; font-weight: 700; font-size: 13pt; text-decoration: underline; letter-spacing: .02em; }
.doc .subtitle { text-align: center; font-size: 11.5pt; margin: 0 0 14px; }
.doc .projustitia { text-align: right; font-weight: 700; text-decoration: underline; font-size: 11.5pt; margin-bottom: 4px; }
.doc p { margin: 0 0 8px; text-align: justify; }
.doc table.kv { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.doc table.kv td { vertical-align: top; padding: 1.5px 0; }
.doc table.kv td:first-child { width: 44%; padding-left: 18px; }
.doc table.kv td:nth-child(2) { width: 14px; }
.doc table.grid { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 11pt; }
.doc table.grid th, .doc table.grid td { border: 0.75pt solid #000; padding: 4px 6px; vertical-align: top; text-align: left; }
.doc table.grid th { background: #f1f1f1; }
.doc .sec { font-weight: 700; margin: 12px 0 4px; }
.doc .qa { margin: 0 0 10px; page-break-inside: avoid; }
.doc .qa .row { display: grid; grid-template-columns: 26px 98px 10px 1fr; }
.doc .ai-mark { font-family: var(--mono); font-size: 7pt; color: #8A6512; border: 0.5pt solid #C99A2E; padding: 0 3px; border-radius: 2px; margin-left: 6px; vertical-align: 2px; }
.doc .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; text-align: center; page-break-inside: avoid; }
.doc .sign .space { height: 70px; }
.doc .sign .name { font-weight: 700; text-decoration: underline; }
.doc .stamp { margin-top: 18px; padding-top: 8px; border-top: 0.5pt dashed #999; font-family: var(--mono); font-size: 7.5pt; color: #555; line-height: 1.5; }
.doc ol, .doc ul { margin: 0 0 8px; padding-left: 22px; }
.doc .badge-class { display: inline-block; border: 1pt solid #000; padding: 1px 8px; font-weight: 700; font-size: 10.5pt; }

@media print {
  @page { size: A4; margin: 0; }
  body * { visibility: hidden !important; }
  .doc, .doc * { visibility: visible !important; }
  .doc { position: absolute; left: 0; top: 0; box-shadow: none; margin: 0; width: 210mm; }
}

/* ─────────── Motion: subtle, short, eased — never decorative noise ─────────── */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes softPop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes goldGlow { 0% { box-shadow: 0 0 0 0 rgba(232,185,49,.55); } 100% { box-shadow: 0 0 0 10px rgba(232,185,49,0); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.035); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes flash { from { background-color: rgba(232,185,49,.18); } to { background-color: transparent; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

.a-up { animation: fadeUp .5s var(--ease-out) both; }
.a-in { animation: fadeIn .4s var(--ease-out) both; }
.a-scale { animation: scaleIn .45s var(--ease-out) both; }
.a-flash { animation: flash 1.2s var(--ease-out); }
.stagger > * { animation: fadeUp .5s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; } .stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; } .stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; } .stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; } .stagger > *:nth-child(8) { animation-delay: .30s; }
.stagger > *:nth-child(n+9) { animation-delay: .34s; }

/* thin gold line that sweeps while the AI is working */
.working { position: relative; overflow: hidden; }
.working::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: sweep 1.1s var(--ease-in-out) infinite; }

.toast { animation: toastIn .35s var(--ease-out) both; }
.btn, .chip, .pill, .ctl, .round { transition: transform .15s var(--ease-out), filter .15s, background-color .2s, color .2s, border-color .2s, box-shadow .2s, opacity .2s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
