/* ============================================================
   Nurtura Care Group - MOBILE design layer
   Reuses brand tokens from ../styles.css, retunes scale/spacing
   for a dense, app-like phone experience.
   ============================================================ */

.m-app {
  /* Mobile-tuned geometry */
  --m-pad: 18px;            /* screen side padding */
  --m-sec: 34px;           /* section vertical rhythm */
  --m-gap: 13px;
  --m-radius: 18px;
  --m-radius-sm: 12px;
  --topbar-h: 50px;        /* visible bar height (below status bar) */
  --statusbar: max(env(safe-area-inset-top, 0px), 14px); /* clears the notch on real phones, tight elsewhere */
  --tabbar-h: 64px;
  --home-ind: max(env(safe-area-inset-bottom, 0px), 12px);

  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Scroll region ---- */
.m-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.m-scroll::-webkit-scrollbar { width: 0; display: none; }

/* page wrapper adds top clearance (under fixed bar) + bottom clearance (above tab bar) */
.m-page {
  padding-top: calc(var(--statusbar) + var(--topbar-h));
  padding-bottom: 0;
  animation: mPageIn 0.42s cubic-bezier(0.22,1,0.36,1) both;
}
/* footer clearance so last content clears the tab bar */
.m-footer { padding-bottom: calc(var(--home-ind) + 28px); }
@keyframes mPageIn {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}

/* ============================================================
   Typography
   ============================================================ */
.m-app h1, .m-app h2, .m-app h3, .m-app h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.m-h1 { font-size: 30px; line-height: 1.08; letter-spacing: -0.025em; }
.m-h2 { font-size: 23px; line-height: 1.14; }
.m-h3 { font-size: 18px; line-height: 1.22; }
.m-app em { font-style: italic; color: var(--accent-deep); }
.m-app p { margin: 0; text-wrap: pretty; }

.m-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.m-eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.7;
}
.m-eyebrow.on-dark { color: var(--gold-soft); }

.m-lead { font-size: 15.5px; color: var(--ink-soft); line-height: 1.55; }
.m-muted { color: var(--ink-soft); }
.m-mute2 { color: var(--ink-mute); }

/* ============================================================
   Layout helpers
   ============================================================ */
.m-container { padding-inline: var(--m-pad); }
.m-section { padding-block: var(--m-sec); }
.m-stack { display: flex; flex-direction: column; }
.m-row { display: flex; align-items: center; }
.gap6{gap:6px}.gap8{gap:8px}.gap10{gap:10px}.gap12{gap:12px}.gap14{gap:14px}.gap16{gap:16px}.gap20{gap:20px}

.m-divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* ============================================================
   Section header
   ============================================================ */
.m-sechead .m-eyebrow { margin-bottom: 12px; }
.m-sechead h2 { margin-bottom: 0; }
.m-sechead p { margin-top: 12px; }
.m-sechead.center { text-align: center; }
.m-sechead.center .m-eyebrow::before { display: none; }

/* ============================================================
   Buttons
   ============================================================ */
.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.m-btn:active { transform: scale(0.97); }
.m-btn--block { width: 100%; }
.m-btn--lg { padding: 15px 24px; font-size: 15.5px; }
.m-btn--sm { padding: 10px 16px; font-size: 13.5px; }

.m-btn--primary { background: var(--primary); color: var(--cream-soft); }
.m-btn--ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.m-btn--light { background: var(--cream-soft); color: var(--ink); border-color: var(--line); }
.m-btn--gold { background: var(--gold); color: var(--forest-deep); }
.m-btn--on-dark { background: var(--gold); color: var(--forest-deep); }
.m-btn--ghost-on-dark { background: rgba(255,255,255,0.08); color: var(--cream-soft); border-color: rgba(255,255,255,0.4); }
.m-btn .arrow { transition: transform 0.2s ease; }
.m-btn:active .arrow { transform: translateX(2px); }

/* ============================================================
   Top bar
   ============================================================ */
.m-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 40;
  padding-top: var(--statusbar);
  height: calc(var(--statusbar) + var(--topbar-h));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--m-pad);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  border-bottom: 1px solid transparent;
}
.m-topbar[data-scrolled="true"] {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom-color: var(--line-soft);
}
.m-brand { display: flex; align-items: center; gap: 9px; }
.m-brand img { height: 30px; width: auto; display: block; }
.m-brand__txt { display: flex; flex-direction: column; line-height: 1; }
.m-brand__txt .t { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--forest-deep); letter-spacing: -0.01em; }
.m-brand__txt .b { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--forest); font-weight: 600; margin-top: 3px; }

.m-topbar__menu {
  width: 42px; height: 42px; margin-right: -8px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--forest-deep);
  -webkit-tap-highlight-color: transparent;
}
.m-topbar__menu svg { width: 23px; height: 23px; }
.m-topbar__menu svg circle { fill: currentColor; }
.m-topbar__menu svg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.m-topbar__menu:active { transform: scale(0.94); }

/* ============================================================
   Full-screen waffle menu (website-style nav)
   ============================================================ */
.m-menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: max(env(safe-area-inset-top, 0px), 14px) var(--m-pad) calc(max(env(safe-area-inset-bottom, 0px), 12px) + 20px);
  animation: mMenuIn 0.22s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes mMenuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.m-menu__head { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; }
.m-menu__links { margin-top: 10px; display: flex; flex-direction: column; }
.m-menu__link {
  padding: 16px 2px;
  font-family: var(--font-display); font-size: 25px; letter-spacing: -0.01em;
  color: var(--ink); border-bottom: 1px solid var(--line-soft);
}
.m-menu__link[data-active="true"] { color: var(--primary); }
.m-menu__cta { margin-top: auto; padding-top: 22px; }

/* ============================================================
   Bottom tab bar
   ============================================================ */
.m-tabbar {
  position: relative;
  z-index: 45;
  flex-shrink: 0;
  height: calc(var(--tabbar-h) + var(--home-ind));
  padding-bottom: var(--home-ind);
  display: flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--line-soft);
}
.m-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-mute);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  padding-top: 8px;
}
.m-tab svg { width: 23px; height: 23px; display: block; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.m-tab .lbl { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; }
.m-tab[data-active="true"] { color: var(--primary); }
.m-tab[data-active="true"] svg { stroke-width: 2; }

/* center raised refer tab */
.m-tab--refer { gap: 0; }
.m-tab--refer .bubble {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--primary); color: var(--cream-soft);
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px; margin-bottom: 3px;
  box-shadow: 0 8px 20px rgba(31,86,49,0.32);
  border: 3px solid var(--bg);
}
.m-tab--refer .bubble svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; }
.m-tab--refer .lbl { color: var(--primary); }
.m-tab--refer:active .bubble { transform: scale(0.94); }

/* ============================================================
   Sheet (More menu / overlays)
   ============================================================ */
.m-sheet-backdrop {
  position: absolute; inset: 0; z-index: 80;
  background: rgba(22,38,27,0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: mFade 0.2s ease both;
  display: flex; flex-direction: column; justify-content: flex-end;
}
@keyframes mFade { from { opacity: 0 } to { opacity: 1 } }
.m-sheet {
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 10px 16px calc(var(--home-ind) + 20px);
  box-shadow: 0 -10px 40px rgba(22,38,27,0.2);
  animation: mSheetUp 0.32s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes mSheetUp { from { transform: translateY(100%) } to { transform: translateY(0) } }
.m-sheet__grip { width: 38px; height: 4px; border-radius: 99px; background: var(--line); margin: 6px auto 14px; }
.m-sheet__title { font-family: var(--font-display); font-size: 17px; padding: 0 6px 12px; color: var(--ink-mute); }
.m-sheet-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 8px;
  border-bottom: 1px solid var(--line-soft);
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  width: 100%;
}
.m-sheet-row:last-child { border-bottom: 0; }
.m-sheet-row .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--cream); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.m-sheet-row .ic svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.m-sheet-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-sheet-row .tx .a { display: block; font-weight: 600; font-size: 15.5px; color: var(--ink); }
.m-sheet-row .tx .b { display: block; font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; }
.m-sheet-row[data-active="true"] .a { color: var(--primary); }
.m-sheet-row .chev { color: var(--ink-mute); }

/* ============================================================
   Cards
   ============================================================ */
.m-card {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--m-radius);
  padding: 18px;
}
.m-card--pad0 { padding: 0; overflow: hidden; }
.m-card:active { }

/* tag */
.m-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--cream); color: var(--ink-soft); border: 1px solid var(--line);
}
.m-tag--green { background: rgba(31,86,49,0.08); color: var(--forest-deep); border-color: rgba(31,86,49,0.15); }
.m-tag--gold { background: rgba(212,162,75,0.16); color: var(--gold-deep); border-color: rgba(168,117,38,0.2); }

/* ============================================================
   Horizontal carousel
   ============================================================ */
.m-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-inline: var(--m-pad);
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.m-carousel::-webkit-scrollbar { display: none; }
.m-carousel > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}
.m-card-slide { width: 80vw; max-width: 310px; }

/* dots */
.m-dots { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.m-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: all 0.2s ease; }
.m-dot[data-active="true"] { background: var(--primary); width: 18px; border-radius: 99px; }

/* ============================================================
   Chips (section jump / filter)
   ============================================================ */
.m-chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding-inline: var(--m-pad); padding-block: 4px;
  scrollbar-width: none;
}
.m-chips::-webkit-scrollbar { display: none; }
.m-chip {
  flex: 0 0 auto;
  padding: 8px 15px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.m-chip[data-active="true"] { background: var(--primary); color: var(--cream-soft); border-color: var(--primary); }

/* ============================================================
   Accordion
   ============================================================ */
.m-acc {
  border: 1px solid var(--surface-line);
  border-radius: var(--m-radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.m-acc + .m-acc { margin-top: 10px; }
.m-acc__btn {
  width: 100%; text-align: left;
  padding: 15px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  -webkit-tap-highlight-color: transparent;
}
.m-acc__btn .q { font-family: var(--font-display); font-size: 15.5px; color: var(--ink); line-height: 1.3; }
.m-acc__plus {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
  background: var(--bg-alt); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.m-acc[data-open="true"] .m-acc__plus { transform: rotate(45deg); background: var(--primary); color: var(--cream-soft); }
.m-acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.28s ease; }
.m-acc[data-open="true"] .m-acc__body { grid-template-rows: 1fr; }
.m-acc__inner { overflow: hidden; }
.m-acc__inner > div { padding: 0 16px 16px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }

/* ============================================================
   Stat rows (condensed)
   ============================================================ */
.m-statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border-radius: var(--m-radius); overflow: hidden; border: 1px solid var(--line-soft); }
.m-statcell { background: var(--surface); padding: 16px 16px; }
.m-statcell .fig { font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--primary); letter-spacing: -0.02em; }
.m-statcell .lbl { margin-top: 7px; font-size: 12px; color: var(--ink-soft); line-height: 1.35; }
.dark-stat .m-statgrid { background: rgba(247,241,227,0.14); border-color: rgba(247,241,227,0.14); }
.dark-stat .m-statcell { background: var(--forest-deep); }
.dark-stat .m-statcell .fig { color: var(--gold-soft); }
.dark-stat .m-statcell .lbl { color: rgba(247,241,227,0.8); }

/* inline stat strip (3 across, condensed) */
.m-statstrip { display: flex; }
.m-statstrip > div { flex: 1; text-align: center; padding: 0 6px; }
.m-statstrip > div + div { border-left: 1px solid var(--line); }
.m-statstrip .fig { font-family: var(--font-display); font-size: 26px; color: var(--primary); line-height: 1; }
.m-statstrip .lbl { margin-top: 6px; font-size: 11px; color: var(--ink-mute); line-height: 1.3; }

/* ============================================================
   List rows (feature bullets, link lists)
   ============================================================ */
.m-feat { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.m-check {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  border-radius: 50%; background: rgba(31,86,49,0.1); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
.m-dotmark { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 7px; }

/* link row (services list, news list) */
.m-linkrow {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--line-soft);
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   Dark + tinted sections
   ============================================================ */
.m-dark { background: var(--forest-deep); color: var(--cream-soft); }
.m-dark h1, .m-dark h2, .m-dark h3, .m-dark h4 { color: var(--cream-soft); }
.m-dark .m-muted { color: rgba(247,241,227,0.82); }
.m-tint { background: var(--bg-alt); }
.m-cream { background: var(--cream); }

/* image frame */
.m-img {
  border-radius: var(--m-radius);
  overflow: hidden;
  background: var(--bg-deep);
  position: relative;
}
.m-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-imgph {
  background:
    repeating-linear-gradient(45deg, rgba(31,86,49,0.05) 0 1px, transparent 1px 12px),
    linear-gradient(135deg, var(--cream) 0%, var(--cream-soft) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-mute); font-family: 'Menlo', monospace; font-size: 11px;
  letter-spacing: 0.03em; text-align: center; padding: 14px;
}

/* hero floating chip overlay */
.m-hero-chip {
  position: absolute;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 15px; box-shadow: var(--shadow);
}

/* ============================================================
   Forms (mobile)
   ============================================================ */
.m-field { display: flex; flex-direction: column; gap: 7px; }
.m-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.m-field input, .m-field textarea, .m-field select {
  font: inherit; font-size: 16px; /* 16px prevents iOS zoom */
  padding: 12px 14px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: var(--m-radius-sm); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%; box-sizing: border-box;
}
.m-field textarea { resize: vertical; min-height: 96px; }
.m-field input:focus, .m-field textarea:focus, .m-field select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,86,49,0.12);
}
.m-field.error input, .m-field.error textarea, .m-field.error select { border-color: #b54639; }
.m-errmsg { font-size: 12px; color: #b54639; font-weight: 600; }

/* segmented option pills */
.m-optpill {
  padding: 10px 15px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper);
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  -webkit-tap-highlight-color: transparent;
}
.m-optpill[data-active="true"] { background: var(--primary); color: var(--cream-soft); border-color: var(--primary); }

/* selectable card option (radio) */
.m-optcard {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px; border-radius: var(--m-radius-sm);
  border: 1.5px solid var(--line); background: var(--paper);
  font-size: 14px; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.m-optcard[data-active="true"] { border-color: var(--primary); background: rgba(31,86,49,0.04); }
.m-optcard .rd { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.m-optcard[data-active="true"] .rd { border-color: var(--primary); }
.m-optcard[data-active="true"] .rd::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }

/* step progress segments */
.m-steps { display: flex; gap: 5px; }
.m-steps .seg { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.m-steps .seg[data-on="true"] { background: var(--primary); }

/* sticky form action bar inside page */
.m-formbar {
  display: flex; gap: 10px; align-items: center;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft);
}

/* summary item */
.m-summ { padding: 12px 13px; background: var(--bg-alt); border-radius: var(--m-radius-sm); border: 1px solid var(--line-soft); }
.m-summ .k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-mute); }
.m-summ .v { margin-top: 4px; font-size: 13.5px; }

/* success check */
.m-success-check {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(31,86,49,0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto;
}

/* reveal - animate transform only (opacity stays 1 so content is never
   stuck hidden if a background tab throttles the transition) */
.m-reveal { transform: translateY(14px); transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); will-change: transform; }
.m-reveal.in { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .m-reveal { transform: none; transition: none; }
  .m-page { animation: none; }
}

/* ============================================================
   Production full-screen fit (mobile only).
   The mobile app renders straight into #root (no device frame), so the
   #root chain must fill the viewport for the app's internal .m-scroll to
   work and the top/tab bars to pin. Scoped to <=768px so the desktop
   layout is completely unaffected.
   ============================================================ */
@media (max-width: 768px) {
  html, body, #root { height: 100%; }
  body { overflow: hidden; }
  .m-app { height: 100dvh; }
}
