/* ─────────────────────────────────────────────────────────────
   ต้นกล้ามะค่า — shared design tokens & components
   Ink #111412 · white · lime accent #C6F36B · seed orange #FF7A45
   ───────────────────────────────────────────────────────────── */

/* Anuphan — UI / body (self-hosted, OFL) */
@font-face { font-family: 'Anuphan'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/anuphan-thai-400-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Anuphan'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/anuphan-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anuphan'; font-style: normal; font-weight: 500; font-display: swap; src: url(/static/fonts/anuphan-thai-500-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Anuphan'; font-style: normal; font-weight: 500; font-display: swap; src: url(/static/fonts/anuphan-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anuphan'; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/anuphan-thai-600-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Anuphan'; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/anuphan-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anuphan'; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/anuphan-thai-700-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Anuphan'; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/anuphan-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Mali — rounded, school-style Thai letters for children's content */
@font-face { font-family: 'Mali'; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/mali-thai-600-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Mali'; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/mali-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Mali'; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/mali-thai-700-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Mali'; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/mali-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #111412;
  --ink-2: #3A3F3B;
  --muted: #5B605C;
  --muted-2: #6B706C;
  --line: #E6E6E1;
  --line-2: #DCDCD6;
  --soft: #F5F5F2;
  --soft-2: #ECECE7;
  --white: #FFFFFF;
  --accent: #C6F36B;
  --accent-ink: #111412;
  --pop: #FF7A45;
  --orange-text: #C2410C;
  --line-green: #06C755;
  --line-ink: #0B1A10;
  --t-blue: #E2F1FF;
  --t-peach: #FFEBDD;
  --t-lime: #EEF9D6;
  --t-yellow: #FFF4CC;
  --t-lilac: #ECE8FF;
  --danger: #B42318;
  --radius-s: 14px;
  --radius: 22px;
  --radius-l: 28px;
  --font: 'Anuphan', 'Noto Sans Thai', 'Leelawadee UI', 'Thonburi', system-ui, sans-serif;
  --font-kid: 'Mali', 'Anuphan', 'Noto Sans Thai', sans-serif;
  --shadow: 0 18px 40px -22px rgba(17, 20, 18, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--ink); }
a:hover { color: var(--orange-text); }
:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.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 {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { color: var(--white); background: #262B28; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { color: var(--accent-ink); background: #B9EA55; }
.btn-line { background: var(--line-green); color: var(--line-ink); }
.btn-line:hover { color: var(--line-ink); background: #05B34C; }
.btn-ghost { background: var(--white); color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }
.btn-soft { background: var(--soft); color: var(--ink); }
.btn-soft:hover { color: var(--ink); background: var(--soft-2); }
.btn-danger { background: var(--white); color: var(--danger); border: 1.5px solid #F2C4BE; }
.btn-danger:hover { color: var(--danger); border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn-lg { min-height: 58px; padding: 0 30px; font-size: 18px; }
.btn svg { flex: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--white); color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { color: var(--ink); background: var(--soft-2); }

/* ── Eyebrow chip ────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 5px 14px;
  border-radius: 999px; background: var(--soft); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; line-height: 1.5;
}
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pop); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; line-height: 1.5; background: var(--soft); color: var(--ink-2);
}
.chip-accent { background: var(--accent); color: var(--accent-ink); }
.chip-dark { background: var(--ink); color: var(--accent); }
.chip-warn { background: #FFE6D5; color: #8A2E0A; }

/* ── Forms ───────────────────────────────────────────────── */
label { font-weight: 600; font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 52px; padding: 12px 16px; border: 1.5px solid transparent; border-radius: 16px;
  background: var(--soft); font-size: 16px; line-height: 1.5;
}
.input:focus { outline: none; border-color: var(--ink); background: var(--white); }
textarea.input { min-height: 96px; resize: vertical; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }

/* ── Notices ─────────────────────────────────────────────── */
.notice { margin: 0; padding: 12px 16px; border-radius: 16px; font-size: 15px; line-height: 1.55; background: var(--soft); }
.notice-error { background: #FDECEA; color: #7A1A12; }
.notice-ok { background: var(--t-lime); color: #23400B; }
.notice-warn { background: var(--t-yellow); color: #5C4204; }

/* ── Segmented control & switch ──────────────────────────── */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: #E8E8E3; }
.seg button {
  flex: 1 1 0; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted);
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 2px 8px rgba(17, 20, 18, .12); }

.switch { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer; }
.switch .track { position: relative; display: block; width: 54px; height: 32px; border-radius: 999px; background: #D5D5CF; transition: background .15s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 6px rgba(17, 20, 18, .3); transition: left .15s; }
.switch[aria-checked="true"] .track { background: var(--ink); }
.switch[aria-checked="true"] .knob { left: 25px; }

/* ── Brand mark ──────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 44px; }
.brand span { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.kid-font { font-family: var(--font-kid); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
