/* =========================================================================
   MyElevate Portal — Design System
   Elevate Insured · Direct Health Benefit Program
   Built mobile-first. Tokens → base → layout → components → views → responsive.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */
:root {
  /* Brand */
  --navy: #1B2B4B;
  --navy-700: #223561;
  --navy-600: #2b3f6e;
  --teal: #2ABFBF;
  --teal-600: #22a6a6;
  --teal-light: #E8F8F8;

  /* Surfaces */
  --white: #FFFFFF;
  --bg: #F7F9FB;
  --card: #FFFFFF;

  /* Text */
  --text: #1A1A2E;
  --text-secondary: #5A6478;
  --text-muted: #8A94A6;

  /* Status */
  --green: #27AE60;
  --green-light: #E8F6EE;
  --red: #D2544B;
  --red-light: #FCEEED;

  /* Lines */
  --border: #E4E8EF;

  /* Radii */
  --r-card: 12px;
  --r-control: 6px;
  --r-pill: 20px;

  /* Shadow */
  --shadow: 0 1px 4px rgba(27, 43, 75, 0.08);
  --shadow-md: 0 4px 16px rgba(27, 43, 75, 0.10);
  --shadow-lg: 0 12px 40px rgba(27, 43, 75, 0.20);

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Layout */
  --sidebar-w: 240px;
  --bottom-nav-h: 64px;
  --content-max: 960px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 180ms;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* -------------------------------------------------------------------------
   2. Base / reset
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  color: var(--navy);
  font-weight: 600;
}

/* Icons (Lucide) inherit stroke from currentColor */
[data-lucide] {
  stroke-width: 2;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   3. Reusable primitives
   ------------------------------------------------------------------------- */

/* --- Brand wordmark (logo fallback) --- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.brand__logo {
  height: 32px;
  width: auto;
}
.brand__mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--white);
}
.brand__mark .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--teal);
  flex: none;
  box-shadow: 0 0 0 4px rgba(42, 191, 191, 0.18);
}
.brand__mark span b { font-weight: 700; }
.brand--dark .brand__mark { color: var(--navy); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 11px 18px;
  border-radius: var(--r-control);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary {
  background: var(--navy);
  color: var(--white);
}
.btn--primary:hover { background: var(--navy-700); }

.btn--teal {
  background: var(--teal);
  color: var(--white);
}
.btn--teal:hover { background: var(--teal-600); }

.btn--outline {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border);
}
.btn--outline:hover { border-color: var(--navy); background: #fbfcfd; }

.btn--outline-white {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.btn--outline-white:hover { border-color: var(--white); background: rgba(255, 255, 255, 0.08); }

.btn--ghost {
  background: transparent;
  color: var(--teal-600);
  padding-left: 6px;
  padding-right: 6px;
}
.btn--ghost:hover { color: var(--teal); }

.btn--block { width: 100%; }

.btn:disabled,
.btn[disabled] {
  background: #EDEFF3;
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* --- Badges & pills --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}
.badge--active {
  background: var(--green-light);
  color: #1e8b4d;
}
.badge--active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 500;
  background: var(--teal-light);
  color: var(--teal-600);
}
.pill--note {
  gap: 7px;
  background: var(--teal-light);
  color: var(--teal-600);
  line-height: 1.4;
  align-items: flex-start;
}
.pill--note svg { width: 14px; height: 14px; margin-top: 1px; flex: none; }

/* --- Category label --- */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-600);
}

/* --- Card --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

/* --- Form controls --- */
.field { margin-bottom: var(--s-4); }
.field:last-child { margin-bottom: 0; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
}
.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  background: var(--white);
  font-size: 15px;
  color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder,
.textarea::placeholder { color: var(--text-muted); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42, 191, 191, 0.15);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6478' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
  cursor: pointer;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

.checkbox {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  flex: none;
  position: relative;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.checkbox input:checked {
  background: var(--teal);
  border-color: var(--teal);
}
.checkbox input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* --- Section heading with teal accent --- */
.section-head {
  padding-left: 14px;
  border-left: 3px solid var(--teal);
  margin-bottom: var(--s-5);
}
.section-head h2 {
  font-size: 21px;
  font-weight: 600;
}
.section-head p {
  color: var(--text-secondary);
  font-size: 14.5px;
  margin-top: 3px;
}

/* --- Callout boxes --- */
.callout {
  display: flex;
  gap: var(--s-3);
  padding: 14px 16px;
  border-radius: var(--r-control);
  font-size: 13.5px;
  line-height: 1.5;
}
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.callout--teal {
  background: var(--teal-light);
  color: #1c6e6e;
}
.callout--teal svg { color: var(--teal-600); }

/* -------------------------------------------------------------------------
   4. App shell — sidebar / mobile chrome / content
   ------------------------------------------------------------------------- */
.app {
  min-height: 100vh;
}

/* Sidebar (desktop) */
.sidebar { display: none; }

/* Mobile top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--s-4);
  background: var(--navy);
  color: var(--white);
}
.topbar__user {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13.5px;
  font-weight: 500;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

/* Content area */
.main {
  padding: var(--s-5) var(--s-4) calc(var(--bottom-nav-h) + var(--s-8));
  max-width: var(--content-max);
  margin: 0 auto;
}

.view { display: none; animation: viewIn 260ms var(--ease); }
.view.is-active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bottom nav (mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--bottom-nav-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: color var(--dur) var(--ease);
}
.bottom-nav__item svg { width: 21px; height: 21px; }
.bottom-nav__item.is-active { color: var(--teal-600); }
.bottom-nav__item.is-active::after {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--teal);
}

/* -------------------------------------------------------------------------
   5. View: My Benefits
   ------------------------------------------------------------------------- */
.welcome { margin-bottom: var(--s-6); }
.welcome h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.welcome p {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 6px;
}

/* Benefit card grid */
.benefit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}
.benefit-card {
  display: flex;
  flex-direction: column;
  padding: var(--s-5);
}
.benefit-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-3);
}
.benefit-card__name {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.benefit-card__detail {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
}
.benefit-card__sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}
.benefit-card .btn {
  margin-top: var(--s-5);
}

/* Accordion */
.accordion { display: flex; flex-direction: column; gap: var(--s-3); }
.accordion__item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
}
.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 16px 18px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  transition: background var(--dur) var(--ease);
}
.accordion__trigger:hover { background: #fbfcfd; }
.accordion__icon {
  width: 24px;
  height: 24px;
  flex: none;
  position: relative;
  color: var(--teal-600);
}
.accordion__icon::before,
.accordion__icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.accordion__icon::before { /* horizontal */
  top: 11px; left: 5px; width: 14px; height: 2px;
}
.accordion__icon::after { /* vertical */
  top: 5px; left: 11px; width: 2px; height: 14px;
}
.accordion__item.is-open .accordion__icon::after { transform: scaleY(0); opacity: 0; }

.accordion__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms var(--ease);
}
.accordion__panel-inner { padding: 0 18px 18px; }

.coverage-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.coverage-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.coverage-list li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.coverage-list--yes li svg { color: var(--green); }
.coverage-list--no {
  border-left: 3px solid var(--red);
  padding-left: 14px;
  margin-left: 1px;
}
.coverage-list--no li svg { color: var(--red); }

/* Support bar */
.support-bar {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-card);
  background: var(--navy);
  color: var(--white);
}
.support-bar__text h3 {
  color: var(--white);
  font-size: 17px;
  font-weight: 600;
}
.support-bar__text p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13.5px;
  margin-top: 3px;
}
.support-bar__actions {
  display: flex;
  gap: var(--s-3);
}
.support-bar__actions .btn { flex: 1; }

/* -------------------------------------------------------------------------
   6. View: How to Use
   ------------------------------------------------------------------------- */
.howto-block {
  padding: var(--s-5);
  margin-bottom: var(--s-4);
  border-left: 4px solid var(--accent, var(--teal));
}
.howto-block h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: var(--s-4);
}
.howto-block[data-accent="primary"]   { --accent: #4C6F9C; }
.howto-block[data-accent="telehealth"]{ --accent: var(--teal); }
.howto-block[data-accent="rx"]        { --accent: #7C5CBF; }
.howto-block[data-accent="health"]    { --accent: var(--green); }

.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  counter-increment: step;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.steps li::before {
  content: counter(step);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal-600);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.protip {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-5);
  padding: 14px 16px;
  border-radius: var(--r-control);
  background: var(--teal-light);
  color: #1c6e6e;
  font-size: 13.5px;
  line-height: 1.5;
}
.protip svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--teal-600); }
.protip b { color: #175c5c; font-weight: 600; }

/* -------------------------------------------------------------------------
   7. View: Add Family
   ------------------------------------------------------------------------- */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: var(--s-6);
}
.stepper__step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.stepper__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--white);
  transition: all var(--dur) var(--ease);
}
.stepper__num svg { width: 13px; height: 13px; }
.stepper__label { display: none; }
.stepper__line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  border-radius: 2px;
}
.stepper__step.is-active .stepper__num { border-color: var(--teal); color: var(--teal-600); }
.stepper__step.is-active { color: var(--navy); }
.stepper__step.is-done .stepper__num { background: var(--teal); border-color: var(--teal); color: var(--white); }
.stepper__step.is-done { color: var(--navy); }

.substep { display: none; }
.substep.is-active { display: block; animation: viewIn 240ms var(--ease); }

.select-card {
  position: relative;
  display: flex;
  gap: var(--s-4);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
  border: 1.5px solid var(--border);
  border-radius: var(--r-card);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.select-card:hover { border-color: #cfd6e2; }
.select-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42, 191, 191, 0.14);
}
.select-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--teal-light);
  color: var(--teal-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.select-card__icon svg { width: 22px; height: 22px; }
.select-card__body { flex: 1; }
.select-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
}
.select-card__title { font-size: 16px; font-weight: 600; color: var(--navy); }
.select-card__price { font-size: 15px; font-weight: 600; color: var(--navy); white-space: nowrap; }
.select-card__incl { color: var(--text-secondary); font-size: 13.5px; margin: 5px 0 10px; }
.select-card__check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  display: none;
  align-items: center;
  justify-content: center;
}
.select-card__check svg { width: 13px; height: 13px; }
.select-card.is-selected .select-card__check { display: inline-flex; }
.select-card.is-selected .select-card__icon { background: var(--teal); color: var(--white); }

.running-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: var(--r-card);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: var(--s-5);
}
.running-total__label { color: var(--text-secondary); font-size: 14px; }
.running-total__value { font-size: 20px; font-weight: 700; color: var(--navy); }
.running-total__value small { font-size: 13px; font-weight: 500; color: var(--text-muted); }

/* Review + confirm summary */
.summary-card { padding: var(--s-5); margin-bottom: var(--s-5); }
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.summary-row:first-child { padding-top: 0; }
.summary-row__label { color: var(--text-secondary); }
.summary-row__value { font-weight: 600; color: var(--navy); }
.summary-row--total {
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 2px solid var(--navy);
}
.summary-row--total .summary-row__label { color: var(--navy); font-weight: 600; }
.summary-row--total .summary-row__value { font-size: 18px; }

.disclosure {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: var(--s-4);
}

.btn-row {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.btn-row .btn--primary,
.btn-row .btn--teal { flex: 1; }

/* Payment tabs */
.tabs {
  display: flex;
  gap: var(--s-2);
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  margin-bottom: var(--s-5);
}
.tab {
  flex: 1;
  padding: 9px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tab.is-active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.pay-note {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--s-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pay-note svg { width: 13px; height: 13px; }

/* Confirmed */
.confirm {
  text-align: center;
  padding: var(--s-6) var(--s-4);
}
.confirm__check {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--s-5);
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop 380ms var(--ease);
}
.confirm__check svg { width: 38px; height: 38px; stroke-width: 2.4; }
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
.confirm h2 { font-size: 23px; font-weight: 700; letter-spacing: -0.01em; }
.confirm p {
  color: var(--text-secondary);
  font-size: 14.5px;
  max-width: 440px;
  margin: 10px auto 0;
  line-height: 1.55;
}
.confirm__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-6);
}

/* -------------------------------------------------------------------------
   8. View: Optional Coverage
   ------------------------------------------------------------------------- */
.optional-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.product-card {
  display: flex;
  flex-direction: column;
  padding: var(--s-5);
}
.product-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}
.product-card__name { font-size: 18px; font-weight: 600; color: var(--navy); letter-spacing: -0.01em; }
.product-card__desc { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.product-card__highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: var(--s-4) 0 var(--s-5);
}
.product-card__highlights li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.product-card__highlights svg { width: 16px; height: 16px; color: var(--teal-600); flex: none; margin-top: 1px; }
.product-card .btn { margin-top: auto; }

.disclaimer {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
  padding: var(--s-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  margin-bottom: var(--s-6);
}

/* -------------------------------------------------------------------------
   9. Modals
   ------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}
.overlay.is-open { display: flex; animation: fade 200ms var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  animation: modalIn 240ms var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 18px var(--s-5);
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: 16px; font-weight: 600; color: var(--navy); }
.modal__close {
  width: 30px;
  height: 30px;
  border-radius: var(--r-control);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.modal__close:hover { background: var(--bg); color: var(--text); }
.modal__close svg { width: 18px; height: 18px; }
.modal__body { padding: var(--s-5); }
.modal__foot {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5) var(--s-5);
}
.modal__foot .btn { flex: 1; }

/* Live chat modal */
.chat { max-width: 400px; display: flex; flex-direction: column; height: 520px; max-height: calc(100vh - 32px); }
.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--s-5);
  background: var(--navy);
  color: var(--white);
  border-radius: var(--r-card) var(--r-card) 0 0;
}
.chat__ident { display: flex; align-items: center; gap: 10px; }
.chat__ident-title { font-size: 14.5px; font-weight: 600; }
.chat__status { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: rgba(255,255,255,0.7); }
.chat__status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(39,174,96,0.25);
}
.chat__close { color: rgba(255,255,255,0.75); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-control); }
.chat__close:hover { background: rgba(255,255,255,0.12); color: var(--white); }
.chat__close svg { width: 18px; height: 18px; }
.chat__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-5);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.chat__msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
}
.chat__msg--agent {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chat__msg--user {
  background: var(--navy);
  color: var(--white);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat__meta { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.chat__compose {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--border);
  background: var(--white);
  border-radius: 0 0 var(--r-card) var(--r-card);
}
.chat__compose .input { border-radius: var(--r-pill); }
.chat__send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.chat__send:hover { background: var(--teal-600); }
.chat__send:active { transform: scale(0.94); }
.chat__send svg { width: 18px; height: 18px; }

/* Rx card modal */
.rx-modal { max-width: 380px; background: transparent; box-shadow: none; overflow: visible; }
.rx-card {
  aspect-ratio: 85.6 / 54;
  background: var(--navy);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.rx-card::after { /* subtle sheen, no gradient on flat surfaces elsewhere — decorative only */
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(42, 191, 191, 0.14);
}
.rx-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.rx-card__label { font-size: 11.5px; font-weight: 500; letter-spacing: 0.02em; color: rgba(255,255,255,0.85); }
.rx-card__brand { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.rx-card__brand .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--teal); }
.rx-card__member { position: relative; z-index: 1; margin-top: auto; }
.rx-card__member-name { font-size: 18px; font-weight: 600; letter-spacing: 0.01em; }
.rx-card__id { font-size: 12.5px; color: var(--teal); font-weight: 500; margin-top: 2px; }
.rx-card__fields {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.rx-card__field-k { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.rx-card__field-v { font-size: 12.5px; font-weight: 500; }
.rx-card__foot { font-size: 10.5px; color: rgba(255,255,255,0.6); margin-top: 12px; position: relative; z-index: 1; }
.rx-actions { display: flex; gap: var(--s-3); margin-top: var(--s-5); }
.rx-actions .btn { flex: 1; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-h) + 16px);
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  background: var(--navy);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--r-control);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  max-width: calc(100% - 32px);
}
.toast svg { width: 17px; height: 17px; color: var(--teal); flex: none; }
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================================
   10. Login screen
   ========================================================================= */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}
.login__aside { display: none; }
.login__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-6) var(--s-4);
  min-height: 100vh;
}
.login__mobile-brand { margin-bottom: var(--s-6); }
.login__mobile-brand .brand__mark { color: var(--navy); }
.login__mobile-brand .brand__mark .dot { box-shadow: 0 0 0 4px rgba(42,191,191,0.14); }

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  padding: var(--s-8) var(--s-6);
}
.login-card__title { font-size: 28px; font-weight: 600; color: var(--navy); letter-spacing: -0.02em; }
.login-card__sub { color: var(--text-secondary); font-size: 14.5px; margin: 4px 0 var(--s-6); }
.login-card form { margin-bottom: var(--s-5); }
.login-card .btn { margin-top: var(--s-2); }

.login-help {
  border-top: 1px solid var(--border);
  padding-top: var(--s-5);
}
.login-help__label { font-size: 13px; color: var(--text-secondary); margin-bottom: var(--s-3); font-weight: 500; }
.login-help__actions { display: flex; gap: var(--s-3); }
.login-help__actions .btn { flex: 1; }

.login-foot {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: var(--s-6);
  max-width: 400px;
  line-height: 1.5;
}

/* Aside value props */
.login__aside-inner { max-width: 380px; }
.login__tagline {
  font-size: 26px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  margin: var(--s-8) 0 var(--s-6);
  line-height: 1.2;
}
.value-props { list-style: none; display: flex; flex-direction: column; gap: var(--s-5); }
.value-props li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14.5px;
  line-height: 1.45;
}
.value-props li svg { width: 18px; height: 18px; color: var(--teal); flex: none; margin-top: 2px; }

/* =========================================================================
   11. Responsive — tablet & desktop
   ========================================================================= */

/* Two-column benefit + optional grids on wider phones/tablets */
@media (min-width: 620px) {
  .benefit-grid { grid-template-columns: 1fr 1fr; }
  .optional-grid { grid-template-columns: 1fr 1fr; }
  .support-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .support-bar__actions { flex: none; }
  .support-bar__actions .btn { flex: none; }
  .stepper__label { display: inline; }
}

/* Desktop: sidebar layout */
@media (min-width: 900px) {
  .topbar { display: none; }
  .bottom-nav { display: none; }

  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--navy);
    color: var(--white);
    padding: var(--s-6) 0;
  }
  .sidebar__brand { padding: 0 var(--s-5) var(--s-8); }
  .sidebar__nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s-3); }
  .sidebar__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--r-control);
    color: rgba(255, 255, 255, 0.62);
    font-size: 14.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
  }
  .sidebar__item svg { width: 19px; height: 19px; }
  .sidebar__item:hover { color: var(--white); background: rgba(255, 255, 255, 0.05); }
  .sidebar__item.is-active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.07);
    border-left-color: var(--teal);
  }
  .sidebar__item.is-active svg { color: var(--teal); }

  .sidebar__user {
    margin: 0 var(--s-5);
    padding-top: var(--s-5);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .sidebar__user-name { font-size: 14.5px; font-weight: 600; color: var(--white); }
  .sidebar__user-title { font-size: 12.5px; color: rgba(255, 255, 255, 0.6); margin-top: 1px; }
  .sidebar__user-emp { font-size: 12px; color: rgba(255, 255, 255, 0.45); margin: 6px 0 10px; }

  .main {
    padding: var(--s-10) var(--s-8);
    max-width: var(--content-max);
  }

  .welcome h1 { font-size: 28px; }

  /* Modals get a bit more breathing room */
  .support-bar { padding: var(--s-6); }
}

/* Login desktop split */
@media (min-width: 860px) {
  .login { grid-template-columns: 1fr 1fr; }
  .login__aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--navy);
    padding: var(--s-16) var(--s-12);
  }
  .login__mobile-brand { display: none; }
  .login__aside .brand__mark { color: var(--white); font-size: 20px; }
}

/* Larger desktop content cap */
@media (min-width: 1280px) {
  .main { padding: var(--s-12) var(--s-16); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
