/* Belajar Cepat — token desain bersama (publik & aplikasi). */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f7;
  --surface-3: #e3e6f1;
  --text: #161a2b;
  --muted: #5a6178;
  --border: #dadeeb;
  --primary: #4c5fd5;
  --primary-hover: #3f51c2;
  --primary-ink: #ffffff;
  --primary-soft: #e8ebfc;
  --accent: #0f8a6c;
  --accent-soft: #e0f4ee;
  --ok: #1a7a45;
  --ok-bg: #e4f4ea;
  --bad: #b42318;
  --bad-bg: #fde9e7;
  --warn: #8a5300;
  --warn-bg: #fff3d6;
  --focus: #2f6fe0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 45, .05), 0 6px 20px rgba(20, 24, 45, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220; --surface: #161b2c; --surface-2: #1e2438; --surface-3: #273049; --text: #e7eaf4; --muted: #9ba3bd;
    --border: #2d3550; --primary: #8b9bff; --primary-hover: #a3b0ff; --primary-ink: #0c1024; --primary-soft: #252d52;
    --accent: #4fd1ae; --accent-soft: #15362f; --ok: #6ad69a; --ok-bg: #133022; --bad: #ff8f85; --bad-bg: #3b1715;
    --warn: #f3c46b; --warn-bg: #342710; --focus: #8ab4ff; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1220; --surface: #161b2c; --surface-2: #1e2438; --surface-3: #273049; --text: #e7eaf4; --muted: #9ba3bd;
  --border: #2d3550; --primary: #8b9bff; --primary-hover: #a3b0ff; --primary-ink: #0c1024; --primary-soft: #252d52;
  --accent: #4fd1ae; --accent-soft: #15362f; --ok: #6ad69a; --ok-bg: #133022; --bad: #ff8f85; --bad-bg: #3b1715;
  --warn: #f3c46b; --warn-bg: #342710; --focus: #8ab4ff; --shadow: none; color-scheme: dark;
}
:root[data-fs="s"] { --fs: 15px; }
:root[data-fs="l"] { --fs: 17.5px; }
:root[data-fs="xl"] { --fs: 19px; }
* { box-sizing: border-box; }
html, body { margin: 0; }
html { font-size: var(--fs); }
body { background: var(--bg); color: var(--text); font: 1rem/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--primary); }
img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--primary-soft); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before { animation: none !important; transition: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: .6em 1.05em; cursor: pointer;
  background: var(--primary); color: var(--primary-ink); font-weight: 600; min-height: 44px; line-height: 1.2;
  transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: var(--primary-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover:not(:disabled) { background: var(--primary-soft); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { min-height: 36px; padding: .35em .75em; font-size: .9rem; }
.btn.block { width: 100%; }
.field { display: grid; gap: .35em; margin-bottom: 1rem; }
.field > label, .label { font-weight: 600; font-size: .92rem; }
.hint { font-size: .85rem; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; padding: .65em .85em; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); min-height: 44px;
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--primary); }
.check { display: flex; gap: .6em; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--primary); }
.notice { padding: .75em 1em; border-radius: var(--radius-sm); font-size: .95rem; margin-bottom: 1rem; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.info { background: var(--primary-soft); color: var(--text); }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.brand { display: inline-flex; align-items: center; gap: .55em; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; }

/* Atribut hidden harus selalu menang atas aturan display komponen. */
[hidden] { display: none !important; }
