@font-face { font-family: 'Poppins'; font-weight: 300; font-display: swap; src: url('/fonts/poppins-300.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('/fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('/fonts/poppins-500.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('/fonts/poppins-600.woff2') format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 400; font-display: swap; src: url('/fonts/caveat-400.woff2') format('woff2'); }

:root {
  --bg: #eef3ee;
  --panel: #e2ebe3;
  --ink: #1f3a2e;
  --mute: #5e7468;
  --green: #2f6b4f;
  --green-soft: #ddefe3;
  --pop: #d6336c;
  --pop-soft: #f7e1e8;
  --white: #ffffff;
  --r-lg: 22px;
  --r-md: 18px;
  --r-sm: 14px;
  --shadow: 0 10px 30px rgba(31, 58, 46, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--green); color: var(--white); }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 8px; }

.i {
  display: inline-block;
  flex: none;
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}

.script { font-family: 'Caveat', cursive; font-weight: 400; color: var(--pop); }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 17px;
  font-weight: 500;
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn.sec { background: transparent; color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.btn.danger { background: var(--pop); }

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 500;
  font-size: 14px;
}

.lbl { font-size: 13px; font-weight: 500; color: var(--mute); }

.field { display: flex; flex-direction: column; gap: 6px; }
.input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--white);
  font-size: 16px;
  outline: none;
  box-shadow: inset 0 0 0 2px transparent;
  transition: box-shadow 0.15s ease;
}
.input:focus { box-shadow: inset 0 0 0 2px var(--green); }
.input::placeholder { color: #8a9b91; }
textarea.input { resize: none; line-height: 1.45; }

.card { background: var(--white); border-radius: var(--r-md); padding: 14px 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--white);
  font-size: 14px;
  font-weight: 500;
}
.chip[aria-pressed='true'] { background: var(--green); color: var(--white); }

.toggle {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--panel);
  transition: background 0.2s ease;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.2s ease;
}
.toggle[aria-checked='true'] { background: var(--green); }
.toggle[aria-checked='true']::after { transform: translateX(20px); }

.seg { display: flex; padding: 4px; border-radius: 999px; background: var(--white); }
.seg button {
  flex: 1;
  min-height: 44px;
  border-radius: 999px;
  color: var(--mute);
  font-size: 14px;
  font-weight: 500;
}
.seg button[aria-pressed='true'] { background: var(--green); color: var(--white); }

.round {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg);
  color: var(--mute);
}
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--pop-soft); color: var(--pop); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.demo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--pop-soft);
  color: var(--ink);
  font-size: 13px;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
