/* ==========================================================================
   Sandingan — sistem desain bersama (situs, client, partner, office)
   Konsep: "janur melengkung" — lengkung janur kuning penanda rumah yang sedang
   punya hajat. Kertas putih melati, tinta hijau daun, aksen kuning janur.
   ========================================================================== */

@font-face { font-family: "Bodoni Moda"; src: url("../fonts/bodoni-moda-latin-opsz-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url("../fonts/bodoni-moda-latin-opsz-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* kertas */
  --paper: #FBFBF7;
  --paper-2: #F4F3EC;
  --paper-3: #E9E7DA;
  --white: #FFFFFF;
  /* tinta */
  --ink: #1E2A21;
  --ink-2: #3D4A40;
  --muted: #667064;
  --line: rgba(30, 42, 33, .12);
  --line-2: rgba(30, 42, 33, .2);
  /* janur */
  --janur: #D8CB6A;
  --janur-2: #CBBD55;
  --janur-tint: #F3EFCF;
  --janur-ink: #6C641B;
  /* status */
  --ok: #2E6A4C; --ok-tint: #E3EEE6;
  --bad: #A23E2C; --bad-tint: #F6E3DE;
  --warn: #9A6514; --warn-tint: #F6EBD6;
  --info: #2D5B78; --info-tint: #E1EBF1;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-sm: 10px;      /* tombol kecil, input */
  --r: 14px;         /* input besar, chip */
  --r-lg: 22px;      /* panel */
  --arch: 999px 999px var(--r-lg) var(--r-lg);   /* lengkung janur */
  --shadow-pop: 0 18px 50px -18px rgba(30, 42, 33, .35), 0 2px 6px rgba(30, 42, 33, .06);
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
::selection { background: var(--janur); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* tipografi */
.display { font-family: var(--serif); font-weight: 450; letter-spacing: -.02em; line-height: 1.04; font-optical-sizing: auto; }
.serif { font-family: var(--serif); font-optical-sizing: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.link { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--janur-2); text-decoration-thickness: 2px; }
.link:hover { text-decoration-color: var(--ink); }
.text-bad { color: var(--bad); }
.text-ok { color: var(--ok); }

/* ikon */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- tombol ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font: 600 14px/1 var(--sans); letter-spacing: .005em; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s var(--ease), box-shadow .18s;
  background: var(--white); color: var(--ink); border-color: var(--line-2);
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--janur); border-color: var(--janur); color: var(--ink); }
.btn-primary:hover { background: var(--janur-2); border-color: var(--janur-2); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #2C3B30; border-color: #2C3B30; }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-plain { background: transparent; border-color: transparent; padding-inline: 10px; }
.btn-plain:hover { background: var(--paper-2); border-color: transparent; }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(162, 62, 44, .35); }
.btn-danger:hover { background: var(--bad-tint); border-color: var(--bad); }
.btn-wa { background: #1F7A4D; border-color: #1F7A4D; color: #fff; }
.btn-wa:hover { background: #18663F; border-color: #18663F; }
.btn-lg { --h: 52px; padding: 0 26px; font-size: 15px; }
.btn-sm { --h: 36px; padding: 0 14px; font-size: 13px; }
.btn-xs { --h: 30px; padding: 0 11px; font-size: 12px; gap: 5px; }
.btn-xs .ic { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--paper-2); }
.icon-btn .ic { width: 20px; height: 20px; }

/* ---------- formulir ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > label .muted, .label .muted { font-weight: 400; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > span:first-child small, .field > span:first-child .muted { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.field > small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--white); border: 1px solid var(--line-2); color: var(--ink); font-size: 15px; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
.field textarea, textarea.input { min-height: 96px; resize: vertical; }
.field select, select.input {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A21' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(30, 42, 33, .38); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(216, 203, 106, .55); }
.input::placeholder, .field ::placeholder { color: #9AA196; }
.input-sm, .field .input-sm { min-height: 38px !important; padding: 7px 11px !important; font-size: 14px !important; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .input.has-error { border-color: var(--bad); }
.field-error { font-size: 12.5px; color: var(--bad); font-weight: 500; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--white); overflow: hidden; }
.input-group:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(216, 203, 106, .55); }
.input-group > span { display: grid; place-items: center; padding: 0 12px; background: var(--paper-2); color: var(--muted); font-size: 14px; white-space: nowrap; border-right: 1px solid var(--line); }
.input-group > input, .field .input-group > input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; min-width: 0; flex: 1; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; line-height: 1.45; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--paper-3); transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .22s var(--ease); }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--janur); }
.switch input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }
.form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2, .form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- lencana ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--paper-2); color: var(--ink-2);
}
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-bad { background: var(--bad-tint); color: var(--bad); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-info { background: var(--info-tint); color: var(--info); }
.badge-gold, .badge-janur { background: var(--janur-tint); color: var(--janur-ink); }
.badge-dark { background: var(--ink); color: var(--paper); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* tingkat template */
.tier-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.tier-bronze { background: #F1E3D6; color: #7A4B25; }
.tier-silver { background: #E7EAEC; color: #46525A; }
.tier-gold { background: var(--janur-tint); color: var(--janur-ink); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 200;
  display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px);
  padding: 12px 18px; border-radius: 99px; background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .25s, transform .3s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { color: var(--janur); }
.toast.is-error .ic { color: #F2A694; }

/* ---------- lengkung janur (motif) ---------- */
.arch { border-radius: var(--arch); overflow: hidden; }

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

/* tata letak kecil yang dipakai semua halaman */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
