:root {
  --forest: #17352B;
  --forest-deep: #0F2620;
  --forest-soft: #2A5446;
  --coral: #E76F42;
  --coral-deep: #CE5B2E;
  --bg: #FBFAF6;
  --surface: #FFFFFF;
  --ink: #1C2B25;
  --muted: #71807A;
  --line: #E7E4DB;
  --wa: #25A65B;
  --wa-deep: #1E8C4C;
  --danger: #C0483A;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 3px rgba(23,53,43,.05), 0 14px 40px rgba(23,53,43,.07);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 22px 56px;
}

/* ---------- Brand wordmark ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 21px;
  color: var(--forest);
  letter-spacing: -.03em;
  margin-bottom: 28px;
  text-decoration: none;
}
.brand .dot {
  width: 14px; height: 14px;
  border-radius: 5px;
  background: var(--coral);
  display: inline-block;
}

/* ---------- Type ---------- */
h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--forest);
}
h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 14px;
  color: var(--forest);
}
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px;
  margin-bottom: 18px;
}

/* ---------- Public scan page ---------- */
.scan-hero { text-align: center; padding-top: 4px; }

.scan-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--coral);
  margin-bottom: 20px;
}

.child-name {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.05;
  color: var(--forest);
  margin: 0 0 6px;
}
.child-sub {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 30px;
}

.child-photo {
  width: 118px; height: 118px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 22px;
  display: block;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 18px rgba(23,53,43,.14);
}

/* Buttons on scan page */
.call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  background: var(--coral);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  padding: 19px;
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform .06s ease, background .15s ease;
}
.call-btn svg { width: 22px; height: 22px; }
.call-btn:active { transform: scale(.985); background: var(--coral-deep); }
.call-btn + .call-btn { margin-top: 12px; }

/* secondary / whatsapp / edit variants via inline style overrides remain,
   but provide clean class variants too */
.btn-forest { background: var(--forest) !important; }
.btn-forest:active { background: var(--forest-deep) !important; }
.btn-wa { background: var(--wa) !important; }
.btn-wa:active { background: var(--wa-deep) !important; }

/* Alert cards (allergy / medical) */
.alert-card {
  background: #FBEEE6;
  border: 1px solid #F3D9C8;
  border-left: 4px solid var(--coral);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  margin-top: 14px;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.alert-card .ac-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--coral-deep);
  margin-top: 2px;
}
.alert-card .ac-icon svg { width: 20px; height: 20px; display: block; }
.alert-card .info-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--coral-deep); margin-bottom: 3px;
}
.alert-card .info-value { font-size: 15.5px; font-weight: 500; color: var(--forest); }

.info-block { margin-top: 14px; text-align: left; }
.info-row { padding: 4px 0; }
.info-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); margin-bottom: 4px;
}
.info-value { font-size: 15.5px; color: var(--ink); }

/* ---------- Forms ---------- */
label {
  display: block;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--forest);
  margin: 16px 0 7px;
}
input[type=text], input[type=email], input[type=password], input[type=tel],
textarea, select, input[type=file] {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #A7B0AB; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(23,53,43,.08);
}
textarea { min-height: 74px; resize: vertical; }

.checkbox-row { display: flex; align-items: center; gap: 11px; margin: 12px 0; }
.checkbox-row input { width: 19px; height: 19px; accent-color: var(--forest); }
.checkbox-row label { margin: 0; font-weight: 500; font-size: 14.5px; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--forest);
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  font-family: inherit;
  padding: 15px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  margin-top: 22px;
  transition: background .15s ease, transform .06s ease;
}
.btn:active { background: var(--forest-deep); transform: scale(.99); }
.btn-primary { background: var(--coral); }
.btn-primary:active { background: var(--coral-deep); }
.btn-ghost {
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--line);
  margin-top: 10px;
}
.btn-ghost:active { background: #F3F1E9; }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #E6C9C3;
  margin-top: 8px;
}
.btn-sm { width: auto; padding: 9px 15px; font-size: 13.5px; margin-top: 0; }

/* ---------- Flash ---------- */
.flash {
  background: #EAF1EC;
  color: var(--forest);
  border: 1px solid #CFE0D4;
  padding: 13px 17px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-weight: 500;
  font-size: 14.5px;
}

/* ---------- Dashboard ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.topbar a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.topbar a:hover { color: var(--forest); }

.child-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.child-card h3 {
  margin: 0 0 5px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--forest);
}
.child-card .meta { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }

.band-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 11px;
  border-radius: 999px;
}
.band-pill.active { background: #E6F0E9; color: var(--forest-soft); }
.band-pill.disabled { background: #F5E7E4; color: var(--danger); }
.band-pill.unactivated { background: #FBEEE6; color: var(--coral-deep); }

/* ---------- Misc ---------- */
.center-narrow { max-width: 400px; }
.link { color: var(--coral-deep); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 24px;
  line-height: 1.5;
}
