/* =====================================================================
   Community Health Champions (Mabalozi wa Afya) pages
   Loaded after wellness-theme.css on /mabalozi-wa-afya only.
   ===================================================================== */
:root {
  --bmi-blue: #0877AE;
  --bmi-green: #72B744;
  --bmi-ink: #0e2f45;
  --bmi-muted: #5b6b78;
  --bmi-line: rgba(8, 119, 174, .16);
  --bmi-card: #ffffff;
  --bmi-soft: #f2f8fc;
}

/* Registration badge (MoH) */
.moh-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .9rem; border-radius: 999px;
  background: rgba(114, 183, 68, .12); color: var(--bmi-ink);
  border: 1px solid rgba(114, 183, 68, .35); font-size: .9rem; font-weight: 500;
}
.moh-badge i { color: var(--bmi-green); font-size: 1.05rem; }
.moh-badge a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Mabalozi wa Afya landing page ---------- */
.champions-page { background: var(--bmi-soft); }
.champions-page h1, .champions-page h2, .champions-page h3 { font-family: Quicksand, sans-serif; }

.ch-hero { padding: 1.5rem 0 3rem; }
.ch-breadcrumb { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.75rem; font-size: .9rem; color: var(--bmi-muted); }
.ch-breadcrumb li + li::before { content: "/"; margin-right: .5rem; opacity: .6; }
.ch-breadcrumb a { color: var(--bmi-muted); text-decoration: none; }
.ch-breadcrumb a:hover { color: var(--bmi-blue); }
.ch-title { font-size: clamp(2.3rem, 6vw, 3.75rem); font-weight: 700; line-height: 1.05; letter-spacing: -.02em; color: var(--bmi-ink); margin: 0 0 1rem; }
.ch-lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); line-height: 1.5; color: #304a57; max-width: 38rem; margin-bottom: 1rem; }
.ch-text { color: var(--bmi-muted); line-height: 1.65; max-width: 38rem; }
.ch-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.ch-visual { position: relative; }
.ch-visual > img { width: 100%; aspect-ratio: 1 / 1; max-height: 460px; object-fit: cover; border-radius: 28px; display: block; }
.ch-app-chip {
  position: absolute; left: -1.25rem; bottom: 1.5rem; max-width: 290px;
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem;
  background: #fff; border-radius: 20px; box-shadow: 0 12px 32px rgba(11, 46, 64, .16);
  text-decoration: none; color: var(--bmi-ink);
}
.ch-app-chip:hover { color: var(--bmi-ink); box-shadow: 0 14px 36px rgba(11, 46, 64, .22); }
.ch-app-chip img { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.ch-app-chip strong { display: block; color: #0B3D33; font-size: .95rem; }
.ch-app-chip small { display: block; color: var(--bmi-muted); font-size: .82rem; line-height: 1.4; }
@media (max-width: 991.98px) { .ch-app-chip { left: .75rem; bottom: .75rem; } }

.ch-steps-wrap { padding-bottom: 3.5rem; }
.ch-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.ch-steps li { background: #fff; border: 1px solid #E1ECF2; border-radius: 20px; padding: 1.15rem; display: flex; gap: .85rem; align-items: center; color: #304a57; }
.ch-steps li span { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #E3F1F8; color: #065A84; font-weight: 700; font-family: Quicksand, sans-serif; }

.ch-packages { background: #fff; padding: 4.5rem 0; scroll-margin-top: 90px; }
.ch-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.ch-section-head h2 { font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 700; color: var(--bmi-ink); margin: 0 0 .5rem; }
.ch-section-head p { color: var(--bmi-muted); max-width: 40rem; margin: 0; }
.ch-pay { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.ch-pay li { padding: .35rem .7rem; border-radius: 8px; background: var(--bmi-soft); font-size: .88rem; font-weight: 500; color: var(--bmi-ink); }

/* Package cards */
.package-card {
  height: 100%; display: flex; flex-direction: column; gap: .9rem;
  background: var(--bmi-card); border: 1.5px solid #DCE7EE; border-radius: 24px; padding: 1.5rem 1.35rem;
}
.package-card .package-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.package-card .package-name { font-size: 1.5rem; font-weight: 700; color: var(--bmi-ink); margin: 0; }
.package-chip { font-size: .8rem; font-weight: 700; padding: .3rem .65rem; border-radius: 999px; white-space: nowrap; background: #EEF4F7; color: #304a57; }
.package-chip.is-1 { background: #E3F1F8; color: #065A84; }
.package-chip.is-2 { background: #FFF4D6; color: #7A4B00; }
.package-chip.is-3 { background: #E3F5EC; color: #0B5D3B; }
.package-card .package-price { font-family: Quicksand, sans-serif; font-size: 1.85rem; font-weight: 700; color: var(--bmi-ink); line-height: 1.1; }
.package-card .package-price small { display: block; font-family: Roboto, sans-serif; font-size: .85rem; font-weight: 400; color: var(--bmi-muted); margin-top: .3rem; }
.package-card .package-summary { color: #304a57; font-size: .95rem; margin: 0; }
.package-tests { border-top: 1px solid #E6EEF2; padding-top: .75rem; flex: 1; }
.package-tests summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  min-height: 44px; font-size: .82rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--bmi-muted);
}
.package-tests summary::-webkit-details-marker { display: none; }
.package-added { margin-left: .25rem; padding: .1rem .45rem; border-radius: 999px; background: #EEF4F7; color: #304a57; letter-spacing: 0; }
.package-tests summary i { transition: transform .15s ease; }
.package-tests[open] summary i { transform: rotate(180deg); }
.package-card ul { list-style: none; padding: 0; margin: .25rem 0 0; font-size: .92rem; color: var(--bmi-ink); }
.package-card li { padding: .28rem 0 .28rem 1.5rem; position: relative; line-height: 1.4; }
.package-card li::before { content: "\2713"; font-weight: 700; position: absolute; left: 0; color: #3E8E2B; }
.package-card .package-note { font-size: .82rem; line-height: 1.5; color: #7A4B00; background: #FFF4D6; padding: .6rem .75rem; border-radius: 12px; margin: 0; }
.package-card .btn-champion { margin-top: auto; }
@media (min-width: 768px) { .package-tests summary { pointer-events: none; } .package-tests summary i { display: none; } }

.ch-benefits { padding: 4.5rem 0; }
.ch-panel { background: #fff; border: 1px solid #E1ECF2; border-radius: 24px; padding: 1.75rem; }
.ch-panel h2 { font-size: 1.5rem; font-weight: 700; color: var(--bmi-ink); margin: 0 0 1rem; }
.ch-panel .benefits-table { border: 0; }
.ch-notes { margin: 0; padding-left: 1.1rem; color: #304a57; line-height: 1.6; }
.ch-notes li + li { margin-top: .4rem; }
.ch-help { background: #0B3D33; color: #fff; border-radius: 24px; padding: 1.5rem 1.75rem; display: flex; flex-direction: column; gap: .3rem; }
.ch-help span { color: #B7E4D6; font-size: .9rem; }
.ch-help a { color: #B7E4D6; }
.ch-help a.ch-help-phone { color: #fff; font-size: 1.25rem; font-weight: 700; text-decoration: none; }

.ch-app { padding: 0 0 5rem; }
.ch-app-card {
  background: #0B3D33; color: #fff; border-radius: 28px; padding: 2.25rem;
  display: flex; gap: 2rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.ch-app-text { flex: 1 1 360px; }
.ch-app-icon { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 1rem; }
.ch-app-card h2 { color: #fff; font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 700; margin: 0 0 .6rem; }
.ch-app-card p { color: #D6EFE7; max-width: 36rem; margin: 0; line-height: 1.6; }
.ch-app-qr { flex-direction: column; align-items: center; gap: .6rem; background: #fff; color: #0B3D33; border-radius: 20px; padding: 1rem 1rem .85rem; font-size: .85rem; font-weight: 600; }
.ch-app-qr svg { width: 156px; height: 156px; }

.ch-sticky-cta {
  position: sticky; bottom: 0; z-index: 990; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px)); background: #fff;
  border-top: 1px solid #DCE7EE; box-shadow: 0 -8px 24px rgba(23, 43, 54, .08);
}
.ch-sticky-cta small { display: block; font-size: .75rem; color: var(--bmi-muted); }
.ch-sticky-cta strong { font-family: Quicksand, sans-serif; font-size: 1.15rem; color: var(--bmi-ink); }

.btn-champion {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--bmi-blue); color: #fff; border: 0; border-radius: 999px;
  padding: .75rem 1.5rem; font-weight: 600; text-decoration: none; min-height: 44px;
  transition: background-color .15s ease;
}
.btn-champion:hover, .btn-champion:focus-visible { background: #065f8b; color: #fff; }
.btn-champion:focus-visible { outline: 3px solid rgba(8, 119, 174, .35); outline-offset: 2px; }
.btn-champion.is-outline { background: transparent; color: var(--bmi-blue); border: 1px solid var(--bmi-blue); }
.btn-champion.is-outline:hover { background: rgba(8, 119, 174, .08); color: var(--bmi-blue); }
.btn-champion.is-light { background: #fff; color: #0B3D33; }
.btn-champion.is-light:hover { background: #EAF7F3; color: #0B3D33; }
.btn-champion.is-outline-light { background: transparent; color: #fff; border: 1px solid #5E8F82; }
.btn-champion.is-outline-light:hover { background: #12544A; color: #fff; }

/* Benefits */
.benefits-table { width: 100%; background: var(--bmi-card); border-radius: 12px; overflow: hidden; border: 1px solid var(--bmi-line); }
.benefits-table th, .benefits-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--bmi-line); color: var(--bmi-ink); font-size: .95rem; }
.benefits-table th { background: var(--bmi-soft); font-weight: 600; }
.benefits-table tr:last-child td { border-bottom: 0; }

.steps-list { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps-list li { counter-increment: step; position: relative; padding: 0 0 1rem 2.75rem; color: var(--bmi-ink); }
.steps-list li::before {
  content: counter(step); position: absolute; left: 0; top: -.1rem; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--bmi-blue); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .9rem;
}

/* Registration form */
.champion-hero { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--bmi-soft); }
@media (min-width: 992px) { .champion-hero { aspect-ratio: 4 / 3; } }
.champion-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.champion-form .form-label { font-weight: 500; color: var(--bmi-ink); font-size: .92rem; margin-bottom: .3rem; }
.champion-form .form-label .req { color: #b42318; }
.champion-form .form-control, .champion-form .form-select { min-height: 46px; border-radius: 10px; }
.champion-form .form-text { color: var(--bmi-muted); }
.champion-form fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.champion-form legend { font-size: 1.05rem; font-weight: 600; color: var(--bmi-ink); margin-bottom: .75rem; }
.champion-form .is-invalid { border-color: #b42318; }
.champion-form .invalid-feedback { display: block; color: #b42318; }
.selected-package {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--bmi-soft); border: 1px solid var(--bmi-line); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.selected-package strong { color: var(--bmi-ink); font-size: 1.1rem; }
.selected-package span { color: var(--bmi-blue); font-weight: 700; }

/* Status / payment page */
.status-card { background: var(--bmi-card); border: 1px solid var(--bmi-line); border-radius: 16px; padding: 1.75rem; box-shadow: 0 8px 24px rgba(14, 47, 69, .06); }
.status-pill { display: inline-block; padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.status-pill.is-pending { background: #fff4e5; color: #8a4b00; }
.status-pill.is-waiting { background: #e8f3fb; color: #065f8b; }
.status-pill.is-active { background: rgba(114, 183, 68, .16); color: #2f5f12; }
.pay-box { background: var(--bmi-soft); border-radius: 12px; padding: 1.25rem; margin: 1rem 0; }
.pay-box dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.pay-box dt { color: var(--bmi-muted); font-weight: 400; }
.pay-box dd { margin: 0; color: var(--bmi-ink); font-weight: 600; word-break: break-word; }
.member-number { font-size: clamp(1.5rem, 5vw, 2.25rem); font-weight: 700; color: var(--bmi-blue); letter-spacing: .02em; }

/* Results */
.result-text { white-space: pre-line; color: var(--bmi-ink); }
.flag-pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.flag-normal { background: rgba(114, 183, 68, .16); color: #2f5f12; }
.flag-low, .flag-high { background: #fde8e7; color: #9b1c13; }
.flag-borderline { background: #fff4e5; color: #8a4b00; }

@media (prefers-reduced-motion: reduce) {
  .btn-champion { transition: none; }
}
@media print {
  #header, #footer, .scroll-top, .no-print { display: none !important; }
  .status-card { box-shadow: none; }
}
