/* ============================================================
   Dream Village Zoo — design tokens & shared primitives
   ============================================================ */
:root {
  --forest-900: #0a2a20;
  --forest-800: #0f3d2e;
  --forest-700: #14523c;
  --forest-600: #1c6b4d;
  --green-500: #2e8b57;
  --green-400: #47a874;
  --green-300: #7cc79e;
  --leaf-100: #e6f3ec;
  --leaf-50: #f2f9f5;

  --sand-100: #f8f1e2;
  --sand-200: #f1e4c8;
  --sand-300: #e6d3ad;

  --amber-500: #f0a500;
  --amber-400: #ffb821;
  --amber-100: #fdf1d4;

  --terra-500: #c65d3b;
  --terra-100: #fbe9e2;

  --ink-900: #14211b;
  --ink-700: #33443c;
  --ink-500: #5f7069;
  --ink-400: #7b8a83;
  --ink-300: #a2ada7;

  --line: #e3ebe6;
  --line-soft: #eef4f0;
  --white: #ffffff;
  --bg: #f6faf7;

  --danger: #d64545;
  --danger-bg: #fdeaea;
  --success: #1f9d63;
  --success-bg: #e4f6ec;
  --warning: #b97a00;
  --warning-bg: #fdf1d4;
  --info: #2f6fd0;
  --info-bg: #e8f0fc;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 34px;

  --shadow-sm: 0 1px 2px rgba(15, 61, 46, 0.06), 0 2px 8px rgba(15, 61, 46, 0.04);
  --shadow: 0 10px 30px -12px rgba(15, 61, 46, 0.25);
  --shadow-lg: 0 24px 60px -20px rgba(15, 61, 46, 0.35);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;

  --header-h: 76px;
  --maxw: 1200px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: min(var(--maxw), calc(100% - 48px)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Buttons ---------------------------------------------------------- */
.btn {
  --btn-bg: var(--green-500);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px;
  border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: 0.95rem; line-height: 1; white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
  box-shadow: 0 8px 20px -8px rgba(46, 139, 87, 0.6);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(46, 139, 87, 0.65); }
.btn:active { transform: translateY(0); }
.btn--dark { --btn-bg: var(--forest-800); box-shadow: 0 8px 20px -8px rgba(15, 61, 46, 0.55); }
.btn--amber { --btn-bg: var(--amber-500); --btn-fg: var(--forest-900); box-shadow: 0 8px 20px -8px rgba(240, 165, 0, 0.6); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--forest-800); box-shadow: inset 0 0 0 1.5px rgba(15, 61, 46, 0.18); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(15, 61, 46, 0.4); }
.btn--light { --btn-bg: #fff; --btn-fg: var(--forest-800); box-shadow: var(--shadow-sm); }
.btn--sm { padding: 9px 16px; font-size: 0.85rem; }
.btn--lg { padding: 16px 30px; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn--danger { --btn-bg: var(--danger); box-shadow: 0 8px 20px -8px rgba(214, 69, 69, 0.55); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* Badges / pills --------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  background: var(--leaf-100); color: var(--forest-700);
  text-transform: uppercase;
}
.badge--amber { background: var(--amber-100); color: #8a6000; }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--muted { background: #eef1ef; color: var(--ink-500); }

/* Form controls ---------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 0.82rem; font-weight: 600; color: var(--ink-700); }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-900);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--green-400);
  box-shadow: 0 0 0 3.5px rgba(46, 139, 87, 0.14);
}
.textarea { resize: vertical; min-height: 96px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-300); }

/* Toast ------------------------------------------------------------ */
.toast-wrap {
  position: fixed; z-index: 3000; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: 14px;
  background: var(--forest-800); color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem; font-weight: 500;
  animation: toastIn 0.28s var(--ease);
}
.toast--success { background: #146b45; }
.toast--error { background: #a83232; }
.toast--info { background: #24486f; }
.toast__icon { font-size: 1.1rem; line-height: 1.2; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

/* Modal ------------------------------------------------------------ */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(8, 28, 21, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity 0.22s, visibility 0.22s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__panel {
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.985); transition: transform 0.28s var(--ease);
}
.modal.is-open .modal__panel { transform: none; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal__body { padding: 20px 24px 26px; }
.modal__title { font-size: 1.35rem; }
.modal__close {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--leaf-100); color: var(--forest-700);
  font-size: 1.2rem; line-height: 1; display: grid; place-items: center;
  transition: background 0.15s;
}
.modal__close:hover { background: var(--green-300); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
