/* Token desain Koe ceMealan — diambil dari logo: kuning mustard, cokelat, krem. */
:root {
  --mustard-50: #fff8e6;
  --mustard-100: #fdeec4;
  --mustard-200: #f9dd8a;
  --mustard-400: #f2be45;
  --mustard-500: #e3a522;
  --brown-900: #3d1f0f;
  --brown-800: #4f2914;
  --brown-700: #6b3a1f;
  --brown-600: #7e4627;
  --brown-100: #f1e4d9;
  --cream-50: #fffbf3;
  --cream-100: #fbf3e2;
  --cream-200: #f3e6cc;
  --pandan-600: #3f7a3a;
  --pandan-100: #e3f0dc;
  --red-600: #b3261e;
  --red-100: #fbe3e0;
  --blue-600: #2f5e8c;
  --blue-100: #e1ecf6;

  /* semantik */
  --bg: var(--cream-50);
  --surface: #ffffff;
  --surface-2: var(--cream-100);
  --border: #eadcc4;
  --text: #33200f;
  --text-muted: #6f5a49;
  --primary: var(--brown-700);
  --primary-hover: var(--brown-800);
  --on-primary: #ffffff;
  --accent: var(--mustard-400);
  --on-accent: var(--brown-900);
  --success: var(--pandan-600);
  --success-bg: var(--pandan-100);
  --danger: var(--red-600);
  --danger-bg: var(--red-100);
  --info: var(--blue-600);
  --info-bg: var(--blue-100);
  --focus: #1f6feb;

  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(61, 31, 15, .06), 0 2px 8px rgba(61, 31, 15, .06);
  --shadow-2: 0 8px 28px rgba(61, 31, 15, .14);
  --shadow-3: 0 18px 50px rgba(61, 31, 15, .22);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --z-sticky: 20;
  --z-header: 30;
  --z-fab: 40;
  --z-dialog: 100;
  --z-toast: 200;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; color: var(--brown-800); }
.ic { flex: none; }
.tabular { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.25rem; border-radius: var(--r-pill);
  border: 2px solid transparent; font-weight: 800; font-size: 1rem; text-decoration: none;
  transition: background-color .18s var(--ease-out), transform .12s var(--ease-out), border-color .18s, color .18s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not([disabled]) { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover:not([disabled]) { background: var(--mustard-500); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-2); border-color: var(--brown-100); }
.btn-wa { background: #1f8f4e; color: #fff; }
.btn-wa:hover:not([disabled]) { background: #187a41; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover:not([disabled]) { background: #f7cfca; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: .45rem .95rem; font-size: .95rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-pill);
  border: 0; background: transparent; color: var(--text);
  transition: background-color .18s;
}
.icon-btn:hover { background: var(--surface-2); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* form */
.field { display: grid; gap: .35rem; }
.field > label, .label { font-weight: 700; font-size: .95rem; color: var(--brown-800); }
.req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 88px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brown-600); box-shadow: 0 0 0 3px rgba(242, 190, 69, .45); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .88rem; font-weight: 600; }
.hint { color: var(--text-muted); font-size: .88rem; }
.field p { margin: 0; }

/* toast */
.toast-wrap {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: var(--z-toast); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-radius: var(--r-md);
  background: var(--brown-900); color: #fff; box-shadow: var(--shadow-2); font-weight: 600;
  animation: toast-in .24s var(--ease-out); pointer-events: auto;
}
.toast.is-error { background: var(--red-600); }
.toast.is-leaving { animation: toast-out .16s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

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