/* =======================================================================
   landing.css — the clinic-facing page (/for-clinics/).

   Reads the --health-* tokens from portal.css, so it follows the portal's
   light and dark themes without a palette of its own. Charts are single-hue
   magnitude bars: one series, sorted, every value printed as text beside its
   bar, so no number depends on colour or on hover.
   ======================================================================= */

.lp-section { padding: 2.25rem 0; }

/* ---- Hero ---- */
.lp-hero {
  padding: 3rem 0 3.25rem;
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, #F2B544 22%, transparent), transparent 42%),
    linear-gradient(180deg, var(--health-surface) 0%, var(--health-primary-light) 100%);
  border-bottom: 1px solid var(--health-border);
}
.lp-hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2.5rem;
  align-items: center;
}
.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--health-primary);
}
.lp-title {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--health-navy);
}
.lp-title em {
  font-style: normal;
  color: var(--health-primary);
  background: linear-gradient(transparent 62%, color-mix(in srgb, #F2B544 70%, transparent) 62%, color-mix(in srgb, #F2B544 70%, transparent) 90%, transparent 90%);
}
.lp-lede {
  max-width: 38rem;
  margin: 0 0 1.4rem;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--health-text-muted);
}
.lp-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.lp-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: var(--health-text-muted);
}
.lp-meta .bi { color: var(--health-success); }
.lp-closing .lp-meta { justify-content: center; }

/* ---- KPI tiles ---- */
.lp-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin: 0; }
.lp-kpi {
  padding: 1rem 1.25rem;
  border: 1px solid var(--health-border);
  border-left: 5px solid var(--health-primary);
  border-radius: 1rem;
  background: var(--health-surface);
  box-shadow: var(--health-shadow-sm);
}
.lp-kpi:nth-child(2) { border-left-color: var(--health-info); }
.lp-kpi:nth-child(3) { border-left-color: #F2B544; }
.lp-kpi dt {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--health-text-muted);
}
.lp-kpi dd {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--health-navy);
}

/* ---- Cards + notes ---- */
.lp-card {
  margin: 0;
  padding: 1.35rem;
  border: 1px solid var(--health-border);
  border-radius: 1.2rem;
  background: var(--health-surface-card);
  box-shadow: var(--health-shadow-card);
}
.lp-card-h {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--health-navy);
}
.lp-card-h .bi { color: var(--health-primary); }
.lp-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--health-text-muted);
}

/* ---- Bar charts ---- */
.lp-chart-title {
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--health-text-muted);
}
.lp-bars { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.lp-bar-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 8rem) 1fr minmax(4.5rem, auto);
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.lp-bar-label { font-weight: 700; color: var(--health-text); }
.lp-bar-track {
  height: 0.7rem;
  border-radius: 999px;
  background: var(--health-surface-alt);
  overflow: hidden;
}
.lp-bar-fill {
  display: block;
  width: var(--w);
  height: 100%;
  /* Rounded at the data end, square at the baseline. */
  border-radius: 0 999px 999px 0;
  background: var(--health-primary);
}
.lp-bar-fill-alt { background: var(--health-info); }
.lp-bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--health-text);
}
.lp-bar-value small { margin-left: 0.25rem; font-weight: 600; color: var(--health-text-muted); }
@media (prefers-reduced-motion: no-preference) {
  .lp-bar-fill { animation: lp-grow 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes lp-grow { from { width: 0; } }
}

/* ---- Visit flow ---- */
.lp-flow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: lp;
}
.lp-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 0.85rem;
  border: 1px solid var(--health-border);
  border-radius: 1rem;
  background: var(--health-surface-card);
  font-size: 0.85rem;
  line-height: 1.35;
  counter-increment: lp;
}
.lp-step::before {
  content: counter(lp);
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--health-text-light);
}
/* The connecting arrow sits in the gap between steps. */
.lp-step:not(:last-child)::after {
  content: "\F138"; /* bi-chevron-right */
  font-family: "bootstrap-icons";
  position: absolute;
  top: 50%;
  right: -0.75rem;
  z-index: 1;
  width: 0.75rem;
  transform: translateY(-50%);
  text-align: center;
  font-size: 0.7rem;
  color: var(--health-text-light);
}
.lp-step b { color: var(--health-navy); font-size: 0.92rem; }
.lp-step > span:last-child { color: var(--health-text-muted); }
.lp-step-ic {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  margin-bottom: 0.25rem;
  border-radius: 0.7rem;
  background: var(--health-primary-light);
  color: var(--health-primary);
  font-size: 1.1rem;
}
.lp-step-end { border-color: var(--health-primary); background: var(--health-primary-light); }
.lp-step-end .lp-step-ic { background: var(--health-primary); color: #fff; }

/* ---- Dose builder demo ---- */
.lp-rx-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.lp-rx-qty {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--health-surface-alt);
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
}
.lp-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.lp-slot {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--health-border);
  border-radius: 0.9rem;
  color: var(--health-text-muted);
}
.lp-slot span { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; line-height: 1; }
.lp-slot small { font-size: 0.75rem; font-weight: 700; }
.lp-slot.on {
  border-color: var(--health-primary);
  background: var(--health-primary-light);
  color: var(--health-primary);
}
.lp-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.lp-chip {
  padding: 0.3rem 0.8rem;
  border: 1.5px solid var(--health-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--health-text-muted);
}
.lp-chip.on { border-color: var(--health-primary); background: var(--health-primary); color: #fff; }

/* ---- Lifecycle ---- */
.lp-life { margin-top: 1.25rem; }
.lp-states { display: flex; align-items: center; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.lp-state {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  padding: 1rem 1.1rem;
  border: 2px solid var(--health-border);
  border-radius: 1rem;
  background: var(--health-surface-alt);
  font-size: 0.85rem;
  color: var(--health-text-muted);
}
.lp-state b { font-size: 1rem; color: var(--health-navy); }
.lp-state .bi { font-size: 1.2rem; color: var(--health-primary); }
.lp-state-issued {
  border-color: var(--health-primary);
  background: var(--health-primary-light);
}
.lp-state-sm { padding: 0.75rem 1rem; }
.lp-arrow { color: var(--health-text-light); font-size: 1.2rem; }
.lp-branch { display: grid; gap: 0.6rem; flex: 1.3; }

/* ---- Lists ---- */
.lp-list { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.lp-list li {
  position: relative;
  padding-left: 1.8rem;
  font-weight: 600;
  color: var(--health-text);
}
.lp-list li::before {
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-family: "bootstrap-icons";
  font-size: 1.1rem;
}
.lp-list-yes li::before { content: "\F26A"; color: var(--health-success); } /* bi-check-circle-fill */
.lp-list-no li::before { content: "\F623"; color: var(--health-error); }    /* bi-x-circle-fill */

/* ---- Closing band ---- */
.lp-closing {
  margin: 1.5rem 0 2rem;
  padding: 2.5rem 1.5rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, var(--health-primary-light), color-mix(in srgb, #F2B544 18%, var(--health-surface)));
  border: 1px solid var(--health-border);
  text-align: center;
}
.lp-closing h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
  color: var(--health-navy);
}
.lp-closing p { margin: 0 auto 1.25rem; max-width: 36rem; color: var(--health-text-muted); }
.lp-closing .lp-meta { margin-top: 1.1rem; margin-bottom: 0; }

/* ---- Small screens ---- */
@media (max-width: 991.98px) {
  .lp-hero-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .lp-kpis { grid-template-columns: repeat(3, 1fr); }
  .lp-flow { grid-template-columns: repeat(2, 1fr); }
  .lp-step:not(:last-child)::after { display: none; }
  .lp-step-end { grid-column: 1 / -1; }
  .lp-states { flex-direction: column; align-items: stretch; }
  .lp-arrow { transform: rotate(90deg); text-align: center; }
}
@media (max-width: 575.98px) {
  .lp-kpis { grid-template-columns: 1fr; }
  .lp-bar-row { grid-template-columns: 1fr auto; gap: 0.3rem 0.75rem; }
  .lp-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .lp-flow { grid-template-columns: 1fr; }
}

/* ---- Six KPI tiles, each its own colour ---- */
.lp-kpi { --k: var(--health-primary); border-left-color: var(--k); padding: 0.8rem 1rem; background: linear-gradient(160deg, color-mix(in srgb, var(--k) 14%, var(--health-surface)), var(--health-surface)); }
.lp-kpi[data-k="1"] { --k: #2FA89F; } .lp-kpi[data-k="2"] { --k: #2F7BA6; } .lp-kpi[data-k="3"] { --k: #D6457A; }
.lp-kpi[data-k="4"] { --k: #7B5EA7; } .lp-kpi[data-k="5"] { --k: #E0A800; } .lp-kpi[data-k="6"] { --k: #E8543A; }
.lp-kpi:nth-child(n) { border-left-color: var(--k); }
.lp-kpi dd { font-size: 1.7rem; color: color-mix(in srgb, var(--k) 70%, var(--health-navy)); }

/* ---- Insight callouts ---- */
.lp-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.9rem; margin: 1rem 0 0.4rem; }
.lp-insight {
  --tone: var(--health-primary);
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.95rem 1.1rem;
  border-radius: 1.2rem;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, var(--health-border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 16%, var(--health-surface)), color-mix(in srgb, var(--tone) 4%, var(--health-surface)));
}
.lp-insight[data-tone="rose"] { --tone: #E0426B; } .lp-insight[data-tone="amber"] { --tone: #E0A800; } .lp-insight[data-tone="teal"] { --tone: #2FA89F; }
.lp-insight-ic {
  display: grid; place-items: center; flex: none; width: 3rem; height: 3rem; border-radius: 1rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tone) 65%, #fff), var(--tone));
  color: #fff; font-size: 1.4rem; box-shadow: 0 10px 16px -10px var(--tone);
}
.lp-insight[data-tone="amber"] .lp-insight-ic { color: #2a1a00; }
.lp-insight b { display: block; font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--health-navy); }
.lp-insight p { margin: 0.2rem 0 0; font-size: 0.82rem; line-height: 1.35; color: var(--health-text-muted); }

/* ---- Speciality bars: coloured by speciality ---- */
.lp-spec-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.lp-spec-row {
  --tone: var(--health-primary);
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 8.5rem) 1fr 1.8rem;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
}
.lp-spec-row .pub-spec-icon { flex: none; width: 1.9rem; height: 1.9rem; margin: 0; display: grid; place-items: center; border-radius: 0.55rem; font-size: 1rem; background: color-mix(in srgb, var(--tone) 16%, var(--health-surface)); filter: none; }
.lp-spec-row .pub-spec-icon:hover { transform: none; }
.lp-spec-name { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; color: var(--health-text); }
.lp-spec-track { height: 0.7rem; border-radius: 999px; background: var(--health-surface-alt); overflow: hidden; }
.lp-spec-fill {
  display: block; width: var(--w); height: 100%; border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 70%, #fff), var(--tone));
  box-shadow: 0 0 12px -2px var(--tone);
}
.lp-bars-wide { grid-template-columns: 1fr; }
.lp-bar-fill-sun { background: linear-gradient(90deg, #F2B544, #E8543A); }
@media (prefers-reduced-motion: no-preference) { .lp-spec-fill { animation: lp-grow 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; } }

/* ---- Sessions per weekday: stacked columns ---- */
.lp-cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; align-items: end; height: 12.5rem; }
.lp-col { display: grid; grid-template-rows: auto 1fr auto; gap: 0.3rem; height: 100%; text-align: center; }
.lp-col-num { font-size: 0.78rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--health-text); }
.lp-col-bar { align-self: end; display: flex; flex-direction: column; height: var(--h); min-height: 2px; overflow: hidden; border-radius: 0.55rem 0.55rem 0.2rem 0.2rem; gap: 2px; }
.lp-col-morning { background: linear-gradient(180deg, #F7C75A, #E8A21A); border-radius: 0.45rem 0.45rem 0 0; }
.lp-col-later { background: linear-gradient(180deg, #2FA89F, #0F7A87); }
.lp-col-day { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--health-text-muted); }
.lp-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 0.9rem 0 0; padding: 0; list-style: none; font-size: 0.76rem; font-weight: 600; color: var(--health-text-muted); }
.lp-swatch { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.4rem; border-radius: 0.25rem; vertical-align: -0.1rem; }
.lp-swatch-morning { background: #F2B544; } .lp-swatch-later { background: #1B9A94; }

/* ---- Ring gauges ---- */
.lp-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lp-gauge { --tone: var(--health-primary); display: grid; justify-items: center; gap: 0.6rem; padding: 1rem 0.8rem; text-align: center; }
.lp-gauge[data-tone="teal"] { --tone: #2FA89F; } .lp-gauge[data-tone="amber"] { --tone: #E8A21A; }
.lp-ring {
  display: grid; place-items: center; width: 6rem; height: 6rem; border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--health-surface-card) 72%, transparent 74%),
    conic-gradient(var(--tone) calc(var(--pct) * 1%), var(--health-surface-alt) 0);
  box-shadow: 0 10px 18px -12px var(--tone);
}
.lp-ring span { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--health-text); }
.lp-gauge figcaption { font-size: 0.74rem; font-weight: 700; line-height: 1.3; color: var(--health-text-muted); }

@media (max-width: 991.98px) { .lp-spec-bars { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) {
  .lp-kpis { grid-template-columns: 1fr 1fr; }
  .lp-spec-row { grid-template-columns: 1.9rem minmax(0, 7rem) 1fr 1.6rem; }
  .lp-cols { height: 10.5rem; gap: 0.3rem; }
}
.lp-kpis { grid-template-columns: 1fr 1fr; }

/* Buttons on this page match the rest of the site: the same compact size as the
   search card and the portal (2.4rem, small label, rounded rectangle), not the
   large hero size they started with. */
.lp-cta .pub-btn, .lp-closing .pub-btn {
  height: 2.4rem;
  min-height: 2.4rem;
  padding: 0 1.1rem;
  border-radius: 0.8rem;
  font-size: 0.86rem;
  font-weight: 700;
}
.lp-cta { gap: 0.55rem; }
.lp-hero .pub-btn { box-shadow: none; }

/* ---- Patient analytics ---- */
.lp-insight[data-tone="blue"] { --tone: #2F7BA6; } .lp-insight[data-tone="green"] { --tone: #3E9B5A; }
.lp-stack { display: flex; height: 2.3rem; gap: 3px; overflow: hidden; border-radius: 0.9rem; background: var(--health-surface-alt); }
.lp-stack-seg { min-width: 4px; }
.lp-seg-male, .lp-swatch-male { background: linear-gradient(180deg, #4C9BD0, #2F7BA6); }
.lp-seg-female, .lp-swatch-female { background: linear-gradient(180deg, #EE6C98, #D6457A); }
.lp-seg-other, .lp-swatch-other { background: linear-gradient(180deg, #A98BD6, #7B5EA7); }
.lp-legend-big { display: grid; gap: 0.5rem; margin-top: 1rem; font-size: 0.85rem; }
.lp-legend-big li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; color: var(--health-text); font-weight: 700; }
.lp-legend-big li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.lp-cols-5 { grid-template-columns: repeat(5, 1fr); }
.lp-cols-12 { grid-template-columns: repeat(12, 1fr); gap: 0.3rem; }
.lp-cols-12 .lp-col-num { font-size: 0.66rem; }
.lp-cols-12 .lp-col-day { font-size: 0.62rem; letter-spacing: 0; }
.lp-col-solid-violet { background: linear-gradient(180deg, #A98BD6, #7B5EA7); }
.lp-col-solid-gold { background: linear-gradient(180deg, #F7C75A, #E8A21A); }
.lp-bar-fill-violet { background: linear-gradient(90deg, #A98BD6, #7B5EA7); }
@media (max-width: 575.98px) { .lp-cols-12 .lp-col-num { display: none; } }
