/* ==========================================================================
   Carenidaan.ai / CareOS — site stylesheet
   Structure:
     1. Design tokens (palette, semantic colours, type, spacing)
     2. Fonts + fallbacks
     3. Base / reset
     4. Layout helpers
     5. Components (header, emergency bar, buttons, cards, forms, …)
     6. Page sections
     7. The "one moment per page" animations (motion-safe only)
     8. Utilities, print
   ========================================================================== */

/* 1. DESIGN TOKENS ------------------------------------------------------- */
:root {
  /* Brand palette — do not use directly in components; use semantic tokens below. */
  --forest: #1F3D33;
  --teal: #0F766E;
  --sage: #7FA487;
  --cream: #F5F2E9;
  --sand: #EBE6D6;
  --coral: #D9543A; /* accent only: dots, the SOS mark, small highlights */

  /* Semantic tokens (light theme) */
  --bg: var(--cream);
  --surface: #FBFAF6;
  --surface-2: var(--sand);
  --surface-strong: var(--forest);
  --on-strong: var(--cream);
  --text: var(--forest);
  --text-muted: #4A5D54;
  --link: var(--teal);
  --link-hover: #0B5A54;
  --accent: var(--coral);
  --border: #D6CFBA;
  --border-strong: #A9A28C;
  --leaf: var(--sage);
  --leaf-soft: #CFDCCB;
  --leaf-line: #5E8668;
  --btn-bg: var(--forest);
  --btn-text: var(--cream);
  --btn-bg-hover: #16302A;
  --focus: #0F766E;
  --focus-ring: 0 0 0 3px var(--bg), 0 0 0 5px var(--focus);
  --success: #1D6B4A;
  --error: #A8321D;
  --error-bg: #FBEAE5;
  --badge-bg: #E3EBDF;
  --badge-text: #24493C;
  --shadow: 0 1px 2px rgb(31 61 51 / 6%), 0 8px 24px rgb(31 61 51 / 6%);

  /* Type */
  --font-head: "Sora", "Sora Fallback", system-ui, sans-serif;
  --font-body: "DM Sans", "DM Sans Fallback", system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.15rem, 1.05rem + 0.4vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem);
  --step-3: clamp(1.65rem, 1.3rem + 1.6vw, 2.4rem);
  --step-4: clamp(2rem, 1.45rem + 2.6vw, 3.4rem);

  /* Space + shape */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --radius-s: 10px;
  --radius: 18px;
  --radius-l: 28px;
  --container: 72rem;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --header-h: 4rem;
  color-scheme: light;
}

/* Dark theme — applied when the visitor picks it, or by system preference
   when no explicit choice is stored. Keep both blocks in sync. */
[data-theme="dark"] {
  --bg: #111C18;
  --surface: #172620;
  --surface-2: #1E3029;
  --surface-strong: #0B1411;
  --on-strong: #ECE8DC;
  --text: #ECE8DC;
  --text-muted: #B4C1B8;
  --link: #74CFC2;
  --link-hover: #A3E2D8;
  --accent: #EE7B62;
  --border: #2D463C;
  --border-strong: #4C6A5E;
  --leaf: #6F9478;
  --leaf-soft: #263E34;
  --leaf-line: #8DB497;
  --btn-bg: #ECE8DC;
  --btn-text: #13231D;
  --btn-bg-hover: #FFFFFF;
  --focus: #74CFC2;
  --success: #7FD3A7;
  --error: #FF9C86;
  --error-bg: #3A1F19;
  --badge-bg: #23392F;
  --badge-text: #CFE3D3;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111C18; --surface: #172620; --surface-2: #1E3029; --surface-strong: #0B1411;
    --on-strong: #ECE8DC; --text: #ECE8DC; --text-muted: #B4C1B8; --link: #74CFC2;
    --link-hover: #A3E2D8; --accent: #EE7B62; --border: #2D463C; --border-strong: #4C6A5E;
    --leaf: #6F9478; --leaf-soft: #263E34; --leaf-line: #8DB497; --btn-bg: #ECE8DC;
    --btn-text: #13231D; --btn-bg-hover: #FFFFFF; --focus: #74CFC2; --success: #7FD3A7;
    --error: #FF9C86; --error-bg: #3A1F19; --badge-bg: #23392F; --badge-text: #CFE3D3;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

/* 2. FONT FALLBACKS — metric-matched local fonts reduce layout shift while web fonts load. */
@font-face { font-family: "Sora Fallback"; src: local("Arial"); size-adjust: 108%; ascent-override: 92%; descent-override: 26%; line-gap-override: 0%; }
@font-face { font-family: "DM Sans Fallback"; src: local("Arial"); size-adjust: 97%; ascent-override: 98%; descent-override: 30%; line-gap-override: 0%; }
/* Hindi pages: Devanagari glyphs come from Noto Sans Devanagari. */
:lang(hi) { --font-head: "Sora", "Noto Sans Devanagari", "Sora Fallback", system-ui, sans-serif; --font-body: "DM Sans", "Noto Sans Devanagari", "DM Sans Fallback", system-ui, sans-serif; }
:lang(hi) body { line-height: 1.75; }
:lang(hi-Latn) { --font-head: "Sora", "Sora Fallback", system-ui, sans-serif; --font-body: "DM Sans", "DM Sans Fallback", system-ui, sans-serif; }

/* 3. BASE ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 3.5rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: clip; /* guards against horizontal scroll from decorative leaves */
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
svg { display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--space-4); font-weight: 600; text-wrap: balance; }
:lang(hi) :is(h1, h2, h3, h4) { line-height: 1.35; letter-spacing: 0; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25rem; }
li + li { margin-top: var(--space-2); }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }
::selection { background: var(--leaf-soft); color: var(--text); }

/* Visible keyboard focus everywhere */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
:where(input, select, textarea):focus-visible { box-shadow: var(--focus-ring); }

/* 4. LAYOUT -------------------------------------------------------------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.narrow { max-width: 44rem; }
.section { padding-block: var(--space-8); position: relative; }
.section--tint { background: var(--surface-2); }
.section--strong { background: var(--surface-strong); color: var(--on-strong); }
.section--strong a { color: var(--on-strong); }
.grid { display: grid; gap: var(--space-5); }
@media (min-width: 40em) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62em) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 40em) and (max-width: 61.99em) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.split { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 56em) { .split { grid-template-columns: 1.05fr 1fr; } .split--top { align-items: start; } }
.stack > * + * { margin-top: var(--space-4); }
.eyebrow { font-family: var(--font-head); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); margin-bottom: var(--space-3); display: inline-flex; align-items: center; gap: .5rem; }
:lang(hi) .eyebrow { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
.eyebrow::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); }
.lead { font-size: var(--step-1); color: var(--text-muted); max-width: 40rem; }
.muted { color: var(--text-muted); }
.section-head { max-width: 46rem; margin-bottom: var(--space-6); }

/* Skip link */
.skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: 100; background: var(--btn-bg); color: var(--btn-text); padding: var(--space-3) var(--space-4); border-radius: var(--radius-s); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: var(--space-3); color: var(--btn-text); }

/* 5. COMPONENTS ---------------------------------------------------------- */

/* 5a. Sticky header block = emergency bar + main nav */
.site-top { position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 12px rgb(31 61 51 / 6%); }
.emergency-bar { background: var(--surface-strong); color: var(--on-strong); font-size: .84rem; }
.emergency-bar .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 2.25rem; padding-block: .2rem; }
.emergency-bar p { margin: 0; display: flex; align-items: center; gap: .5rem; }
.emergency-bar .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--coral); flex: none; box-shadow: 0 0 0 3px rgb(217 84 58 / 25%); }
.emergency-call { display: inline-flex; align-items: center; gap: .38rem; color: var(--on-strong); font-weight: 700; text-decoration: none; padding: .22rem .75rem; border: 1px solid rgb(245 242 233 / 40%); border-radius: 999px; white-space: nowrap; min-height: 1.85rem; font-size: .82rem; transition: background-color .15s ease, border-color .15s ease; }
.emergency-call:hover { background: rgb(245 242 233 / 14%); border-color: rgb(245 242 233 / 75%); color: var(--on-strong); }
.emergency-call svg { width: .92rem; height: .92rem; }

.site-header { background: rgb(245 242 233 / 92%); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
[data-theme="dark"] .site-header { background: rgb(17 28 24 / 92%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-header { background: rgb(17 28 24 / 92%); } }
.site-header .container { width: min(100% - 2 * var(--gutter), 82rem); display: flex; align-items: center; gap: var(--space-3); min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.brand svg { width: 2.3rem; height: auto; }
.wordmark { font-family: var(--font-head); font-weight: 600; font-size: 1.22rem; letter-spacing: -0.025em; line-height: 1; white-space: nowrap; }
.wordmark .w-nidaan { color: var(--link); }
.wordmark .w-ai { color: var(--text-muted); font-weight: 500; }
/* The coral dot on the "i" in nidaan: dotless ı + a positioned dot */
.idot { position: relative; display: inline-block; }
.idot::after { content: ""; position: absolute; left: 50%; top: 0.02em; width: 0.21em; height: 0.21em; border-radius: 50%; background: var(--coral); transform: translateX(-50%); }

.nav { margin-left: auto; display: flex; align-items: center; gap: .4rem; min-width: 0; }
.nav-list { display: none; list-style: none; margin: 0; padding: 0; gap: .15rem; align-items: center; }
.nav-list li + li { margin: 0; }
.nav-list a { display: block; padding: .42rem .62rem; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .9rem; white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.nav-list a:hover { background: var(--surface-2); color: var(--text); }
.nav-list a[aria-current="page"] { background: var(--badge-bg); color: var(--badge-text); font-weight: 600; }
@media (min-width: 75em) { .nav-list { display: flex; } .menu-toggle { display: none !important; } }
.nav-cta { display: none; white-space: nowrap; flex: none; }
@media (min-width: 36em) { .nav-cta { display: inline-flex; } }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 2.75rem; min-height: 2.75rem; padding: 0 .6rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: .95rem; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* Language switcher (disclosure menu of real links, so it works without JS too) */
.lang { position: relative; }
.lang summary { list-style: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang-menu { position: absolute; right: 0; top: calc(100% + .4rem); width: min(90vw, 23rem); max-height: min(65vh, 23rem); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); box-shadow: var(--shadow); padding: .4rem; margin: 0; list-style: none; z-index: 60; display: grid; grid-template-columns: 1fr; gap: .15rem; }
@media (min-width: 30em) { .lang-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
[dir="rtl"] .lang-menu { right: auto; left: 0; }
.lang-menu li + li { margin: 0; }
.lang-menu a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .48rem .65rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; }
.lang-menu a:hover { background: var(--surface-2); }
.lang-menu a[aria-current="true"] { background: var(--badge-bg); color: var(--badge-text); font-weight: 600; }
.lang-menu a[aria-current="true"]::after { content: "✓"; color: var(--link); }
.lang--up .lang-menu { top: auto; bottom: calc(100% + .4rem); left: 0; right: auto; }
[dir="rtl"] .lang--up .lang-menu { left: auto; right: 0; }
.lang-code { font-weight: 600; font-size: .85rem; }

/* Mobile menu */
.mobile-nav { border-top: 1px solid var(--border); background: var(--bg); max-height: calc(100vh - 7rem); overflow-y: auto; }
.mobile-nav ul { list-style: none; margin: 0; padding: var(--space-3) 0 var(--space-5); }
.mobile-nav li + li { margin: 0; }
.mobile-nav a { display: block; padding: .8rem .25rem; color: var(--text); text-decoration: none; font-weight: 500; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
.mobile-nav a[aria-current="page"] { color: var(--link); }
.mobile-nav .btn { margin-top: var(--space-4); width: 100%; border-bottom: 0; }
@media (min-width: 75em) { .mobile-nav { display: none !important; } }

/* 5b. Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.9rem; padding: .7rem 1.3rem; border-radius: 999px; border: 1.5px solid transparent; font-family: var(--font-body); font-size: 1rem; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease; text-align: center; }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--btn-text); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-light { background: var(--cream); color: var(--forest); }
.btn-light:hover { background: #fff; color: var(--forest); }
.btn-small { min-height: 2.5rem; padding: .45rem 1rem; font-size: .95rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.btn svg { width: 1.1rem; height: 1.1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* 5c. Badges — honest status labels */
.badge { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 999px; background: var(--badge-bg); color: var(--badge-text); font-size: .85rem; font-weight: 600; line-height: 1.3; }
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; opacity: .55; }
.badge--soon::before { background: var(--accent); opacity: 1; }
.badge--outline { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-muted); }
.badge--illustration { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.badge--illustration::before { display: none; }

/* 5d. Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.25rem, 1rem + 1vw, 1.65rem); position: relative; box-shadow: 0 1px 2px rgb(31 61 51 / 4%); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.card h3 { margin-bottom: var(--space-2); }
.card p:last-child { margin-bottom: 0; }
.card-icon { width: 2.85rem; height: 2.85rem; border-radius: 14px; background: var(--badge-bg); color: var(--badge-text); display: grid; place-items: center; margin-bottom: var(--space-4); border: 1px solid rgb(15 118 110 / 12%); }
.card-icon svg { width: 1.4rem; height: 1.4rem; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.card--link { text-decoration: none; color: var(--text); display: block; }
.card--link:hover { border-color: var(--link); color: var(--text); box-shadow: var(--shadow); transform: translateY(-2px); }
.card--link .more { color: var(--link); font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; }
.module-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.placeholder-tile { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: var(--space-5); text-align: center; color: var(--text-muted); font-family: var(--font-head); font-weight: 500; }

/* Callouts — used for safety notes */
.callout { border-radius: var(--radius); padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--link); }
.callout--alert { border-left-color: var(--accent); }
.callout p:last-child { margin-bottom: 0; }
.callout h2, .callout h3 { font-size: var(--step-1); margin-bottom: var(--space-2); }

/* Check list */
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 2rem; }
.checks li::before { content: ""; position: absolute; left: 0; top: .2em; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--badge-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230F766E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E") center/80% no-repeat; }
.crosses li::before { background: var(--error-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23A8321D' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l7 7M13.5 6.5l-7 7'/%3E%3C/svg%3E") center/80% no-repeat; }

/* 5e. Page header (inner pages) */
.page-hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) clamp(2rem, 1rem + 3vw, 3.5rem); position: relative; overflow: hidden; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { max-width: 20ch; }
.page-hero .lead { margin-bottom: 0; }
.page-hero-art { position: absolute; right: -2rem; top: 50%; transform: translateY(-50%); width: min(42vw, 22rem); color: var(--leaf); opacity: .9; pointer-events: none; z-index: 0; }
@media (max-width: 47.99em) { .page-hero-art { width: 11rem; right: -3.5rem; top: 1rem; transform: none; opacity: .45; } }
.breadcrumbs { font-size: var(--step--1); margin-bottom: var(--space-4); color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }

/* 5f. Forms */
.form { display: grid; gap: var(--space-4); }
.form-row { display: grid; gap: var(--space-4); }
@media (min-width: 40em) { .form-row--2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: .35rem; }
.field label, .field legend { font-weight: 700; font-size: .98rem; }
.field .hint { font-size: var(--step--1); color: var(--text-muted); margin: 0; }
.field .opt { font-weight: 400; color: var(--text-muted); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="url"], .field input[type="search"], .field select, .field textarea {
  width: 100%; min-height: 2.9rem; padding: .65rem .85rem; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-s);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237FA487' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 1.1rem; padding-right: 2.4rem; }
.field input[type="file"] { font: inherit; font-size: .95rem; padding: .6rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-s); background: var(--surface); width: 100%; color: var(--text); }
.field input[type="file"]::file-selector-button { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: .45rem .9rem; margin-right: .75rem; background: var(--btn-bg); color: var(--btn-text); cursor: pointer; }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: var(--step--1); font-weight: 600; margin: 0; }
.field-error:empty { display: none; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .98rem; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; accent-color: var(--teal); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); margin-top: .35rem; }
.choice { display: flex; gap: .6rem; align-items: center; padding: .6rem .8rem; border: 1.5px solid var(--border); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; font-weight: 500; }
.choice:has(input:checked) { border-color: var(--link); background: var(--badge-bg); }
.choice input { accent-color: var(--teal); width: 1.1rem; height: 1.1rem; flex: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.error-summary { border: 2px solid var(--error); background: var(--error-bg); border-radius: var(--radius-s); padding: var(--space-4); }
.error-summary h2 { font-size: 1.05rem; margin-bottom: .4rem; color: var(--error); }
.error-summary ul { margin: 0; }
.error-summary a { color: var(--error); font-weight: 600; }
.form-status { font-weight: 600; }
.form-status--error { color: var(--error); }
.form-success { text-align: left; }
.form-success h2, .form-success h3 { display: flex; gap: .6rem; align-items: center; }
.form-success .tick { width: 2rem; height: 2rem; border-radius: 50%; background: var(--badge-bg); color: var(--success); display: grid; place-items: center; flex: none; }
.form-success .tick svg { width: 1.1rem; height: 1.1rem; }
.demo-note { font-size: var(--step--1); border: 1px dashed var(--border-strong); border-radius: var(--radius-s); padding: .5rem .75rem; color: var(--text-muted); }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: clamp(1.25rem, .8rem + 2vw, 2.25rem); }

/* 5g. Footer */
.site-footer { background: var(--surface-strong); color: var(--on-strong); padding-block: var(--space-8) var(--space-6); margin-top: 0; }
.site-footer a { color: var(--on-strong); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--on-strong); }
.footer-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 62em) { .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr) 1.6fr; } .footer-brand { grid-column: auto; } .footer-news { grid-column: auto !important; } }
.footer-news { grid-column: 1 / -1; }
.site-footer h2 { font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; color: #C9D8C4; margin-bottom: var(--space-3); }
:lang(hi) .site-footer h2 { letter-spacing: 0; text-transform: none; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: .55rem; }
.site-footer .brand { color: var(--on-strong); }
.site-footer .wordmark .w-nidaan { color: #9BD3C8; }
.site-footer .wordmark .w-ai { color: #C9D8C4; }
.footer-small { color: #C9D8C4; font-size: var(--step--1); }
.socials { display: flex; gap: .5rem; margin-top: var(--space-4); }
.socials a { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 1px solid rgb(245 242 233 / 30%); border-radius: 50%; }
.socials a:hover { background: rgb(245 242 233 / 10%); }
.socials svg { width: 1.1rem; height: 1.1rem; }
.footer-news .field label { color: var(--on-strong); }
.footer-news .news-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.footer-news input[type="email"] { flex: 1 1 12rem; background: rgb(245 242 233 / 8%); color: var(--on-strong); border-color: rgb(245 242 233 / 40%); }
.footer-news input::placeholder { color: #AFC0B5; }
.footer-news .field-error { color: #FFB4A3; }
.footer-news .demo-note { color: #C9D8C4; border-color: rgb(245 242 233 / 30%); }
.footer-bottom { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid rgb(245 242 233 / 18%); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: center; }
.footer-bottom p { margin: 0; }
.site-footer .icon-btn { color: var(--on-strong); border-color: rgb(245 242 233 / 30%); }
.site-footer .icon-btn:hover { background: rgb(245 242 233 / 10%); }
.site-footer .lang-menu { background: var(--surface); }
.site-footer .lang-menu a { color: var(--text); }
.site-footer :focus-visible { box-shadow: 0 0 0 3px var(--surface-strong), 0 0 0 5px #9BD3C8; }

/* 5h. Cookie notice & Launch Promo Popup */
.cookie { position: fixed; z-index: 70; left: var(--space-3); right: var(--space-3); bottom: var(--space-3); max-width: 30rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-5); }
@media (min-width: 40em) { .cookie { left: auto; right: var(--space-5); bottom: var(--space-5); } }
.cookie h2 { font-size: 1.05rem; margin-bottom: .4rem; }
.cookie p { font-size: .95rem; color: var(--text-muted); }

.promo-backdrop { position: fixed; inset: 0; z-index: 80; background: rgb(17 28 24 / 58%); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; padding: var(--space-4); }
.promo-card { position: relative; width: min(100%, 44rem); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-l); box-shadow: 0 24px 60px rgb(17 28 24 / 28%); overflow: hidden; display: grid; grid-template-columns: 1fr; }
@media (min-width: 42em) { .promo-card { grid-template-columns: .95fr 1.15fr; } }
.promo-media { background: var(--cream); min-height: 11rem; }
.promo-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-body { padding: clamp(1.35rem, 1rem + 1.5vw, 2.2rem); display: flex; flex-direction: column; justify-content: center; gap: .75rem; }
.promo-body h2 { font-size: var(--step-2); margin: 0; }
.promo-body p { margin: 0; }
.promo-close { position: absolute; top: .65rem; right: .65rem; z-index: 2; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.promo-close:hover { background: var(--surface-2); }
.promo-close svg { width: 1.1rem; height: 1.1rem; }

/* 6. PAGE SECTIONS ------------------------------------------------------- */

/* 6a. Home hero */
.hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5.5rem) var(--space-8); position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4rem); max-width: 15ch; }
.hero .lead { margin-bottom: var(--space-5); }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--space-5); }
.hero-art { position: relative; max-width: 36rem; margin-inline: auto; width: 100%; }
.hero-visual { border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--border); background: var(--cream); box-shadow: var(--shadow); }
.hero-visual img { display: block; width: 100%; height: auto; }
.hero-pulse-bar { display: flex; align-items: center; gap: .75rem; margin-top: var(--space-4); padding: .6rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.hero-pulse-bar svg { width: 7rem; height: auto; flex: none; }
.hero-pulse-bar .pulse { stroke: var(--link); }
.hero-pulse-bar .pulse-dot { fill: var(--accent); }
.hero-pulse-bar span { font-size: var(--step--1); color: var(--text-muted); font-weight: 500; }
.hero-art .heart-stroke { stroke: var(--text); }
.hero-art .pulse { stroke: var(--link); }
.hero-art .pulse-dot { fill: var(--accent); }
.hero-art .leaf-fill { fill: var(--leaf-soft); }
.hero-art .leaf-line { stroke: var(--leaf-line); }
.hero-note { margin-top: var(--space-5); font-size: var(--step--1); color: var(--text-muted); display: flex; gap: .5rem; align-items: flex-start; max-width: 36rem; }
.hero-note svg { width: 1.1rem; height: 1.1rem; flex: none; margin-top: .2rem; color: var(--link); }

/* 6b. Interactive "How CareOS works" */
.how { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 56em) { .how { grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: var(--space-7); } }
.how-tabs { display: grid; gap: .5rem; list-style: none; padding: 0; margin: 0 0 var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 36em) { .how-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.how-tab { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-s); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: 3.6rem; }
.how-tab:hover { border-color: var(--border-strong); }
.how-tab[aria-selected="true"] { border-color: var(--link); background: var(--badge-bg); }
.how-tab .n { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.how-tab .l { font-family: var(--font-head); font-weight: 600; font-size: .98rem; line-height: 1.25; }
.how-progress { display: flex; gap: .35rem; margin-bottom: var(--space-5); }
.how-progress span { height: 4px; flex: 1; border-radius: 4px; background: var(--border); }
.how-progress span.on { background: var(--link); }
.how-panel h3 { font-size: var(--step-2); }
.how-panel[hidden] { display: none; }
.how-controls { display: flex; gap: .5rem; margin-top: var(--space-5); align-items: center; flex-wrap: wrap; }
.how-controls .count { margin-left: auto; color: var(--text-muted); font-size: var(--step--1); }
.no-js .how-panel[hidden] { display: block; }

/* Phone mockup (illustration only) */
.phone-wrap { display: grid; justify-items: center; gap: .75rem; }
.phone { width: min(100%, 17.5rem); aspect-ratio: 9 / 18.5; border-radius: 2.4rem; background: #13231D; padding: .65rem; box-shadow: var(--shadow); position: relative; }
[data-theme="dark"] .phone { background: #050A08; outline: 1px solid var(--border); }
.phone::before { content: ""; position: absolute; top: 1.05rem; left: 50%; transform: translateX(-50%); width: 4.5rem; height: 1rem; border-radius: 1rem; background: #13231D; z-index: 2; }
[data-theme="dark"] .phone::before { background: #050A08; }
.screen { position: absolute; inset: .65rem; border-radius: 1.85rem; background: #F7F4EC; color: #1F3D33; overflow: hidden; padding: 2.6rem 1rem 1rem; font-size: .8rem; line-height: 1.4; display: flex; flex-direction: column; gap: .6rem; }
.screen[hidden] { display: none; }
.screen .s-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-family: var(--font-head); font-size: .85rem; }
.screen .s-muted { color: #4A5D54; }
.screen .s-card { background: #fff; border: 1px solid #E2DCC9; border-radius: .9rem; padding: .65rem .75rem; }
.screen .s-row { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.screen .s-pill { display: inline-block; padding: .15rem .5rem; border-radius: 999px; background: #E3EBDF; color: #24493C; font-weight: 600; font-size: .7rem; }
.screen .s-flag { background: #FBEAE5; border: 1px solid #E8B4A6; color: #8A2A18; border-radius: .9rem; padding: .6rem .75rem; font-weight: 600; }
.screen .s-sos { margin: .5rem auto; width: 8.5rem; height: 8.5rem; border-radius: 50%; display: grid; place-items: center; background: #D9543A; color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; box-shadow: 0 0 0 .7rem #F6DDD5, 0 0 0 1.4rem #FBEEEA; }
.screen .s-btn { display: block; text-align: center; padding: .55rem; border-radius: 999px; background: #1F3D33; color: #F5F2E9; font-weight: 700; }
.screen .s-btn--ghost { background: transparent; border: 1px solid #A9A28C; color: #1F3D33; }
.screen .s-map { height: 8.5rem; border-radius: .9rem; background: #E6EDE1; position: relative; overflow: hidden; }
.screen .s-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen .s-q { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .4rem; }
.screen .s-q span { text-align: center; padding: .35rem; border-radius: .6rem; border: 1px solid #CFC8B2; }
.screen .s-q span.sel { background: #1F3D33; color: #F5F2E9; border-color: #1F3D33; }

/* 6c. Module grid (What CareOS does) */
.module-card .badge { flex: none; }

/* 6d. Steps / timeline */
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: var(--space-4); }
.steps li { counter-increment: s; position: relative; padding-left: 3.25rem; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; background: var(--badge-bg); color: var(--badge-text); font-family: var(--font-head); font-weight: 700; }
.steps h3 { margin-bottom: .25rem; }

/* 6e. FAQ */
.faq-tools { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); }
.faq-search { position: relative; }
.faq-search svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); width: 1.15rem; height: 1.15rem; color: var(--text-muted); pointer-events: none; }
.faq-search input { padding-left: 2.6rem !important; }
.faq-group + .faq-group { margin-top: var(--space-6); }
.faq-group h2 { font-size: var(--step-2); }
.acc { border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); }
.acc + .acc { margin-top: .6rem; }
.acc summary { cursor: pointer; padding: 1rem 3rem 1rem 1.1rem; font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; list-style: none; position: relative; border-radius: var(--radius-s); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: ""; position: absolute; right: 1.1rem; top: 50%; width: .65rem; height: .65rem; border-right: 2px solid var(--link); border-bottom: 2px solid var(--link); transform: translateY(-70%) rotate(45deg); }
.acc[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.acc .acc-body { padding: 0 1.1rem 1.1rem; color: var(--text); }
.acc .acc-body p:last-child { margin-bottom: 0; }
mark { background: var(--leaf-soft); color: inherit; border-radius: 3px; padding: 0 .1em; }

/* 6f. Careers */
.careers-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-5); }
.careers-bar .section-head { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--space-5); }
.chip { min-height: 2.6rem; padding: .45rem 1rem; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; transition: background-color .15s ease, border-color .15s ease; }
.chip:hover { background: var(--surface-2); border-color: var(--link); }
.chip[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.role-list { display: grid; gap: .9rem; list-style: none; padding: 0; margin: 0; }
.role-list li + li { margin: 0; }
.role-card { display: grid; gap: .75rem 1.5rem; grid-template-columns: 1fr; padding: clamp(1.25rem, 1rem + 1vw, 1.65rem); }
@media (min-width: 48em) { .role-card { grid-template-columns: 1fr auto; align-items: center; } }
.role-card h3 { margin: 0; font-size: var(--step-1); }
.role-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.role-team-pill { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--badge-bg); color: var(--badge-text); }
.role-team-pill--custom { background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text); }
.role-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--text-muted); font-size: .95rem; margin: 0; padding: 0; list-style: none; }
.role-meta li + li { margin: 0; }
.role-meta li { display: inline-flex; gap: .35rem; align-items: center; }
.role-meta svg { width: 1rem; height: 1rem; }
.add-role-box { margin-bottom: var(--space-6); border: 1.5px solid var(--border); border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.add-role-box summary { list-style: none; cursor: pointer; padding: 1.1rem 1.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.add-role-box summary::-webkit-details-marker { display: none; }
.add-role-box summary:hover { background: var(--surface-2); }
.add-role-body { padding: 0 1.4rem 1.5rem; border-top: 1px solid var(--border); }
.custom-role-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.custom-role-detail { margin-top: var(--space-5); border: 1.5px solid var(--link); border-radius: var(--radius-l); background: var(--surface); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); box-shadow: var(--shadow); }
.prose { max-width: 44rem; }
.prose h2 { font-size: var(--step-2); margin-top: var(--space-7); }
.prose h3 { margin-top: var(--space-6); }
.prose > :first-child { margin-top: 0; }

/* 6g. Booking */
.cal-box { min-height: 34rem; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); padding: var(--space-5); display: grid; align-content: center; justify-items: center; text-align: center; gap: var(--space-4); overflow: hidden; }
.cal-box.is-loaded { display: block; padding: 0; text-align: left; }
.cal-box .tz { font-weight: 700; }
#cal-inline { width: 100%; min-height: 34rem; }

/* 6h. Blog, Medical News & Articles */
.post-card time, .post-meta { color: var(--text-muted); font-size: var(--step--1); }
.post-card h3 { font-size: var(--step-1); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem; font-size: .85rem; color: var(--text-muted); }
.cat-pill { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; background: var(--badge-bg); color: var(--badge-text); }
.cat-pill--news { background: var(--error-bg); color: var(--error); }
.admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px dashed var(--border); }
.admin-gate { margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); max-width: 28rem; }

/* 6i. Leaves (decorative) */
.leaf-deco { position: absolute; pointer-events: none; color: var(--leaf); z-index: 0; }
.leaf-deco .leaf-fill { fill: var(--leaf-soft); }
.leaf-deco .leaf-line { stroke: var(--leaf-line); }
.page-hero-art .leaf-fill { fill: var(--leaf-soft); }
.page-hero-art .leaf-line { stroke: var(--leaf-line); }

/* CTA band */
.cta-band { border-radius: var(--radius-l); background: var(--surface-strong); color: var(--on-strong); padding: clamp(1.75rem, 1rem + 3vw, 3.5rem); display: grid; gap: var(--space-5); position: relative; overflow: hidden; }
@media (min-width: 56em) { .cta-band { grid-template-columns: 1.4fr auto; align-items: center; } }
.cta-band h2 { margin-bottom: .5rem; }
.cta-band p { color: #D5E0D6; margin: 0; }
.cta-band .btn-secondary { color: var(--on-strong); border-color: rgb(245 242 233 / 50%); }
.cta-band .btn-secondary:hover { background: rgb(245 242 233 / 10%); color: var(--on-strong); }
.cta-band :focus-visible { box-shadow: 0 0 0 3px var(--surface-strong), 0 0 0 5px #9BD3C8; }

/* Definition list for role facts / contact facts */
.facts { display: grid; gap: var(--space-3); margin: 0; }
.facts div { display: grid; gap: .1rem; }
.facts dt { font-size: var(--step--1); color: var(--text-muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* 7. ONE MOMENT PER PAGE ------------------------------------------------- */
/* Home: the pulse line draws once through the heart, then the coral dot lands.
   Inner pages: the hero leaf's veins draw once. Nothing else animates by default. */
@media (prefers-reduced-motion: no-preference) {
  .moment-pulse .pulse { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s cubic-bezier(.6, .05, .3, 1) .35s forwards; }
  .moment-pulse .pulse-dot { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .45s ease-out 2.05s forwards; }
  .moment-leaf .leaf-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s ease-out .25s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 8. UTILITIES ----------------------------------------------------------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); } .mt-7 { margin-top: var(--space-7); }
.center { text-align: center; }
.fine { font-size: var(--step--1); color: var(--text-muted); }
[hidden] { display: none !important; }

@media print {
  .site-top, .site-footer, .cookie, .page-hero-art, .leaf-deco { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Logo pulse colour follows the theme */
.logo-pulse { stroke: var(--link); }
.site-footer .logo-pulse { stroke: #9BD3C8; }
