/* ============================================================
   Cipta CPNS: sistem desain dasar
   Pasir hangat + Turquoise + Coral, Plus Jakarta Sans
   ============================================================ */
@font-face {
  font-family: 'Jakarta';
  src: url('/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jakarta';
  src: url('/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --sand: #F6FAFA;
  --sand-2: #EAF3F3;
  --paper: #FFFFFF;
  --ink: #12292B;
  --ink-2: #3E5153;
  --muted: #5B6865;
  --hair: rgba(18, 41, 43, 0.08);
  --hair-2: rgba(18, 41, 43, 0.14);

  --teal: #2DCCD3;
  --teal-2: #28BDBF;
  --teal-deep: #0A6A6F;
  --teal-ink: #0F2F31;
  --teal-soft: #DDF5F4;

  --coral: #FF6B57;
  --sun: #FFC233;
  --sun-ink: #3A2400;
  --leaf: #118C63;
  --coral-deep: #A8351F;
  --coral-soft: #FFE6DF;

  --ok: #0F6E4F;
  --ok-soft: #DDF3E8;
  --warn: #A15C00;
  --warn-soft: #FDEBCF;
  --bad: #A42D25;
  --bad-soft: #FBE1DE;

  --r-xl: 2rem;
  --r-lg: 1.5rem;
  --r-md: 1.1rem;
  --r-sm: 0.75rem;
  --bezel: 6px;

  --shadow-soft: 0 1px 1px rgba(18, 41, 43, 0.03), 0 12px 32px -12px rgba(18, 41, 43, 0.12);
  --shadow-float: 0 2px 4px rgba(18, 41, 43, 0.04), 0 24px 60px -20px rgba(18, 41, 43, 0.22);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.85);

  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);

  --font: 'Jakarta', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Komponen gelap tetap (tombol gelap, chip gelap), dibalik saat mode gelap */
  --night: #12292B;
  --night-text: #F2FAFA;
  --night-sub: rgba(234, 244, 244, 0.72);

  /* Kaca */
  --glass: linear-gradient(155deg, #FFFFFF 0%, rgba(255, 255, 255, 0.94) 100%);
  --glass-shell: rgba(255, 255, 255, 0.34);
  --glass-edge: rgba(255, 255, 255, 0.8);
  --field-bg: #FFFFFF;
  --ghost-bg: rgba(255, 255, 255, 0.62);
  --chip-bg: rgba(255, 255, 255, 0.66);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --sand: #091517;
  --sand-2: rgba(255, 255, 255, 0.09);
  --paper: #0F2225;
  --ink: #E7F3F2;
  --ink-2: #B3C6C4;
  --muted: #8FA3A3;
  --hair: rgba(255, 255, 255, 0.08);
  --hair-2: rgba(255, 255, 255, 0.15);
  --teal-deep: #5FE1E6;
  --teal-soft: rgba(45, 204, 211, 0.14);
  --coral-deep: #FF9182;
  --coral-soft: rgba(255, 107, 87, 0.15);
  --ok: #52DDA0;
  --ok-soft: rgba(82, 221, 160, 0.13);
  --warn: #FFC266;
  --warn-soft: rgba(255, 194, 102, 0.13);
  --bad: #FF8F86;
  --bad-soft: rgba(255, 143, 134, 0.13);
  --shadow-soft: 0 1px 1px rgba(0, 0, 0, 0.2), 0 14px 36px -14px rgba(0, 0, 0, 0.6);
  --shadow-float: 0 2px 4px rgba(0, 0, 0, 0.25), 0 26px 60px -20px rgba(0, 0, 0, 0.7);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --night: #E9F6F5;
  --night-text: #0F2F31;
  --night-sub: rgba(15, 47, 49, 0.7);
  --glass: linear-gradient(155deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.03) 100%);
  --glass-shell: rgba(255, 255, 255, 0.03);
  --glass-edge: rgba(255, 255, 255, 0.09);
  --field-bg: rgba(255, 255, 255, 0.05);
  --ghost-bg: rgba(255, 255, 255, 0.06);
  --chip-bg: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--sand);
  transition: background-color 500ms var(--spring), color 500ms var(--spring);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
/* Butiran kertas halus, statis & tidak ikut scroll */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2.5px solid var(--teal-deep); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--teal); color: var(--teal-ink); }
.ic { flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
h3, h4 { letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }

/* ---------- Label kecil di atas isi kartu (tanpa pil/titik) ---------- */
.label { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }

/* ---------- Bezel ganda (kartu) ---------- */
.shell {
  padding: var(--bezel);
  border-radius: var(--r-xl);
  background: rgba(18, 41, 43, 0.035);
  box-shadow: 0 0 0 1px var(--hair);
}
.core {
  border-radius: calc(var(--r-xl) - var(--bezel));
  background: var(--paper);
  box-shadow: var(--inset-hi), var(--shadow-soft);
  height: 100%;
}
.shell.lg { --r-xl: 2.25rem; }
.core.pad { padding: 1.5rem; }

/* ---------- Tombol ---------- */
.btn {
  --bg: var(--teal); --fg: var(--teal-ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 48px;
  padding: 0.4rem 1.4rem;
  border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: 0.9375rem; letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 24px -12px rgba(14, 124, 130, 0.7);
  transition: transform 500ms var(--spring), box-shadow 500ms var(--spring), background-color 400ms var(--spring);
  white-space: nowrap;
}
.btn:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 16px 32px -14px rgba(14, 124, 130, 0.8); }
.btn:active { transform: scale(0.98); }
.btn.dark { --bg: var(--night); --fg: var(--night-text); box-shadow: none; }
.btn.ghost { --bg: var(--ghost-bg); --fg: var(--ink); box-shadow: 0 0 0 1px var(--hair-2); }
.btn.ghost:hover { box-shadow: 0 0 0 1px var(--ink-2); }
.btn.dark:hover { box-shadow: none; opacity: 0.92; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:active { transform: none; }
.btn.loading { opacity: 0.7; pointer-events: none; }
.btn.loading::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link { color: var(--teal-deep); font-weight: 600; text-underline-offset: 3px; text-decoration-thickness: from-font; }
.link:hover { text-decoration: underline; }

/* ---------- Chip & badge ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.28rem 0.65rem; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  background: var(--teal-soft); color: var(--teal-deep);
}
.chip.coral { background: var(--coral-soft); color: var(--coral-deep); }
.chip.ink { background: var(--night); color: var(--night-text); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.line { background: transparent; box-shadow: 0 0 0 1px var(--hair-2); color: var(--ink-2); }

/* ---------- Form ---------- */
.field { display: grid; gap: 0.45rem; }
.field > label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.input-wrap {
  position: relative; display: flex; align-items: center;
  border-radius: 1rem;
  background: var(--field-bg);
  box-shadow: 0 0 0 1px var(--hair-2), inset 0 1px 2px rgba(18, 41, 43, 0.04);
  transition: box-shadow 400ms var(--spring);
}
.input-wrap:focus-within { box-shadow: 0 0 0 1.5px var(--teal-deep), 0 0 0 6px rgba(45, 204, 211, 0.18); }
.input-wrap.err { box-shadow: 0 0 0 1.5px var(--bad), 0 0 0 6px rgba(180, 50, 42, 0.1); }
.input-wrap > [data-icon] { position: absolute; left: 1rem; display: grid; color: var(--muted); pointer-events: none; transition: color 300ms var(--spring); }
.input-wrap:focus-within > [data-icon] { color: var(--teal-deep); }
.input-wrap input, .input-wrap select {
  width: 100%; min-height: 52px;
  padding: 0.8rem 1rem 0.8rem 2.85rem;
  border: 0; outline: 0; background: transparent; border-radius: 1rem;
  font-size: 1rem; /* 16px: iPhone tidak memperbesar halaman saat mengetik */
}
.input-wrap select { appearance: none; cursor: pointer; }
.input-wrap input::placeholder { color: var(--muted); opacity: 0.85; }
.input-wrap .eye {
  position: absolute; right: 0.5rem;
  width: 44px; height: 44px; border-radius: 0.8rem;
  display: grid; place-items: center; color: var(--muted);
  transition: background-color 300ms var(--spring);
}
.input-wrap .eye:hover { background: var(--hair); color: var(--ink); }
.input-wrap.has-eye input { padding-right: 3.2rem; }
.hint { font-size: 0.8125rem; color: var(--muted); }
.field-err { font-size: 0.8125rem; color: var(--bad); font-weight: 500; }

.alert {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.8rem 1rem; border-radius: 1rem;
  font-size: 0.875rem; font-weight: 500;
  background: var(--bad-soft); color: var(--bad);
}
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert .ic { margin-top: 2px; }

/* ---------- Animasi masuk ---------- */
.rise { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 900ms var(--out), transform 900ms var(--out), filter 900ms var(--out); }
.rise.in { opacity: 1; transform: none; filter: none; }
.rise.d1 { transition-delay: 80ms; } .rise.d2 { transition-delay: 160ms; } .rise.d3 { transition-delay: 240ms; } .rise.d4 { transition-delay: 320ms; } .rise.d5 { transition-delay: 400ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .rise { opacity: 1; transform: none; filter: none; }
}

/* ---------- Logo ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; }
.brand-mark { width: 34px; height: 34px; }
.brand > span { font-weight: 800; color: var(--teal-deep); }
.brand b { font-weight: 800; color: var(--coral); }
