/* ══════════════════════════════════════════════════════
   CARDIOCORE HOSPITAL — STYLESHEET
   Font: DM Serif Display (headings) + DM Sans (body)
   Aesthetic: Clinical Luxury — precise, trustworthy,
              refined whites & blues with warm accents
══════════════════════════════════════════════════════ */

/* ─── RESET & ROOT ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Core palette */
  --blue-900: #0d2137;
  --blue-800: #1565c0;
  --blue-700: #1976d2;
  --blue-600: #1e88e5;
  --blue-100: #e3f2fd;
  --blue-50:  #f0f7ff;

  /* Neutrals */
  --white:    #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;

  /* Semantic */
  --risk-low:     #2e7d32;
  --risk-low-bg:  #e8f5e9;
  --risk-low-mid: #66bb6a;
  --risk-high:    #c62828;
  --risk-high-bg: #ffebee;
  --risk-high-mid:#ef5350;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Spacing */
  --section-py: 96px;
  --container:  1160px;

  /* Radius */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  24px;
  --r-xl:  36px;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.12);
  --shadow-card:0 8px 32px rgba(13,33,55,.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--white);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }

/* ─── CONTAINER ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── BUTTONS ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue-800);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(21,101,192,.35);
}
.btn-primary:hover {
  background: var(--blue-900);
  box-shadow: 0 6px 28px rgba(21,101,192,.45);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--blue-800);
  border-color: var(--blue-200, #bbdefb);
  border: 2px solid var(--blue-800);
}
.btn-ghost:hover {
  background: var(--blue-50);
  transform: translateY(-2px);
}

/* ─── NAVBAR ───────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 72px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226,232,240,.6);
  transition: box-shadow .3s;
}
.navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--blue-900);
  letter-spacing: -.3px;
}
.logo-icon {
  color: var(--blue-700);
  font-size: 18px;
  animation: spin-slow 8s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all .2s;
}
.nav-link:hover,
.nav-link.active { color: var(--blue-800); background: var(--blue-50); }

.nav-cta-btn {
  padding: 9px 22px;
  border-radius: 50px;
  background: var(--blue-800);
  color: var(--white) !important;
  font-size: 14px;
  font-weight: 600;
  margin-left: 8px;
  transition: all .2s;
}
.nav-cta-btn:hover { background: var(--blue-900); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--blue-900);
  border-radius: 2px;
  transition: all .3s;
}

/* ─── HERO ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 140px 0 80px;
  overflow: hidden;
  background: var(--blue-50);
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(21,101,192,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,101,192,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.hero-blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(21,101,192,.12), transparent 70%);
  top: -100px; right: -100px;
}
.hero-blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(46,125,50,.08), transparent 70%);
  bottom: 0; left: 10%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-800);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
}
.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--risk-low-mid);
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .7; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.1;
  color: var(--blue-900);
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero-title em {
  font-style: italic;
  color: var(--blue-700);
}

.hero-subtitle {
  font-size: 17px;
  color: var(--gray-600);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}
.stat { text-align: left; }
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--blue-900);
  line-height: 1;
}
.stat span {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--gray-200);
}

/* ECG Card */
.hero-visual { position: relative; }

.ecg-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  position: relative;
  z-index: 1;
}
.ecg-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-400);
  margin-bottom: 20px;
}
.ecg-line-wrapper {
  width: 100%;
  height: 80px;
  overflow: hidden;
  margin-bottom: 24px;
  border-radius: var(--r-sm);
  background: var(--gray-50);
}
.ecg-svg {
  width: 200%;
  height: 100%;
  animation: ecg-scroll 2.5s linear infinite;
}
@keyframes ecg-scroll { to { transform: translateX(-50%); } }

.ecg-trace {
  fill: none;
  stroke: var(--blue-700);
  stroke-width: 2;
  stroke-linejoin: round;
}

.ecg-readings {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ecg-reading {
  text-align: center;
  flex: 1;
  background: var(--blue-50);
  border-radius: var(--r-sm);
  padding: 12px 8px;
}
.reading-val {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--blue-900);
  line-height: 1;
  margin-bottom: 4px;
}
.reading-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-400);
}
.status-green { color: var(--risk-low) !important; }

.pulse-anim {
  animation: bpm-pulse 1s ease-in-out infinite;
}
@keyframes bpm-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .5; }
}

.hero-card-float {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  animation: float-bob 3s ease-in-out infinite;
}
.hero-card-float-1 {
  bottom: -20px; left: -30px;
  animation-delay: 0s;
}
.hero-card-float-2 {
  top: -16px; right: -20px;
  animation-delay: 1.5s;
}
@keyframes float-bob {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.scroll-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue-600);
  animation: scroll-bounce 1.4s ease infinite;
}
@keyframes scroll-bounce {
  0%,100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(8px); opacity: .4; }
}

/* ─── FEATURES STRIP ───────────────────────────────── */
.features-strip {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: 40px 0;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
}
.feature-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  background: var(--blue-50);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-700);
}
.feature-item h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 2px;
}
.feature-item p {
  font-size: 13px;
  color: var(--gray-400);
}

/* ─── SECTION SHARED ───────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-tag {
  display: inline-block;
  background: var(--blue-50);
  color: var(--blue-800);
  border: 1px solid rgba(21,101,192,.2);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-tag-light {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.25);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15;
  color: var(--blue-900);
  margin-bottom: 16px;
}
.section-title em {
  font-style: italic;
  color: var(--blue-700);
}
.section-subtitle {
  font-size: 17px;
  color: var(--gray-600);
  max-width: 560px;
  margin: 0 auto;
}

/* ─── DOCTORS SECTION ──────────────────────────────── */
.doctors-section {
  padding: var(--section-py) 0;
  background: var(--gray-50);
}
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}

.doctor-card {
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  transition: transform .25s, box-shadow .25s;
  position: relative;
}
.doctor-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.doctor-card-featured {
  border-color: var(--blue-700);
  box-shadow: 0 8px 40px rgba(21,101,192,.18);
}

.featured-ribbon {
  position: absolute;
  top: 18px; right: -30px;
  background: var(--blue-800);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 5px 40px;
  transform: rotate(40deg) translateX(-10px);
  white-space: nowrap;
}

.doctor-img-wrap {
  position: relative;
  background: linear-gradient(135deg, var(--blue-50), var(--gray-100));
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doctor-img-placeholder {
  width: 100px; height: 100px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.doctor-badge-chip {
  position: absolute;
  bottom: 14px; left: 14px;
  background: var(--blue-800);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
  letter-spacing: .4px;
}

.doctor-info { padding: 24px; }
.doctor-info h3 {
  font-family: var(--font-display);
  font-size: 21px;
  color: var(--blue-900);
  margin-bottom: 4px;
}
.doctor-specialty {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-700);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}
.doctor-bio {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.65;
  margin-bottom: 16px;
}
.doctor-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.doctor-meta span {
  font-size: 12.5px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ─── ASSESSMENT SECTION ───────────────────────────── */
.assessment-section {
  padding: var(--section-py) 0;
  background: linear-gradient(150deg, var(--blue-900) 0%, #0a1628 100%);
  position: relative;
  overflow: hidden;
}
.assessment-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* ─── APPOINTMENT PAGE EXTRAS ──────────────────────── */
.appointment-section {
  min-height: 100vh;
  padding-top: calc(var(--section-py) + 72px); /* account for fixed navbar */
}

.appt-form-card {
  max-width: 720px;
}

.appt-info-strip {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  padding: 20px 32px;
  background: var(--blue-50);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.appt-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--gray-600);
}
.appt-info-item svg { color: var(--blue-700); flex-shrink: 0; }
.appt-info-item strong { color: var(--gray-800); }

/* Appointment confirmation details block */
.appt-confirm-details {
  background: var(--blue-50);
  border: 1px solid rgba(21,101,192,.15);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin-bottom: 20px;
  font-size: 14.5px;
  color: var(--gray-700, #334155);
  line-height: 1.9;
}
.appt-confirm-details strong {
  color: var(--blue-900);
}

/* ─── FORM CARD ────────────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto;
}
.form-card-header {
  background: var(--blue-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.form-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.form-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-700), var(--blue-600));
  border-radius: 3px;
  transition: width .4s ease;
}
.form-progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}

/* Form body */
#heartRiskForm,
#appointmentForm {
  padding: 36px 32px 32px;
}
.form-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue-800);
  border-left: 3px solid var(--blue-700);
  padding-left: 12px;
  margin: 28px 0 16px;
}
.form-section-label:first-child { margin-top: 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group-full { grid-column: 1 / -1; }

/* Form group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 6px;
}
.label-icon { font-size: 15px; }
.label-hint {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Inputs */
.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.form-group input::placeholder { color: var(--gray-400); }

/* Date input icon colour */
.form-group input[type="date"] { color-scheme: light; }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px rgba(21,101,192,.12);
}
.form-group.has-error input,
.form-group.has-error select {
  border-color: var(--risk-high);
  box-shadow: 0 0 0 3px rgba(198,40,40,.1);
}
.form-group.is-valid input,
.form-group.is-valid select {
  border-color: var(--risk-low);
}

/* Select wrapper (custom arrow) */
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gray-400);
  pointer-events: none;
  transition: border-color .2s;
}
.select-wrapper select {
  padding-right: 36px;
  cursor: pointer;
}
.select-wrapper select:focus + ::after,
.select-wrapper:focus-within::after { border-top-color: var(--blue-700); }

/* Field errors */
.field-error {
  font-size: 12px;
  color: var(--risk-high);
  font-weight: 500;
  display: none;
  margin-top: 2px;
}
.form-group.has-error .field-error { display: block; }

/* Tooltip trigger */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px;
  cursor: help;
  font-style: normal;
  transition: background .2s;
  margin-left: 2px;
}
.tooltip-trigger:hover { background: var(--blue-100); color: var(--blue-800); }

.tooltip-bubble {
  position: fixed;
  background: var(--blue-900);
  color: var(--white);
  font-size: 12px;
  font-weight: 400;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  max-width: 240px;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transition: opacity .15s;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
}
.tooltip-bubble.visible { opacity: 1; }

/* Submit area */
.form-submit-area {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.btn-submit {
  padding: 16px 48px;
  font-size: 16px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: var(--white);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(21,101,192,.4);
  transition: all .25s;
  font-family: var(--font-body);
  font-weight: 600;
  min-width: 260px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(21,101,192,.5);
}
.btn-submit:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}
.submit-note {
  font-size: 12.5px;
  color: var(--gray-400);
  font-weight: 500;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── MODAL ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,33,55,.65);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-card {
  background: var(--white);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,.3);
  transform: scale(.92) translateY(20px);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  transition: all .2s;
  z-index: 1;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-800); }

/* Modal header (coloured top) */
.modal-header {
  padding: 40px 40px 28px;
  text-align: center;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.modal-header.low-risk {
  background: linear-gradient(135deg, var(--risk-low-bg), #f1f8f1);
  border-bottom: 1px solid rgba(46,125,50,.15);
}
.modal-header.high-risk {
  background: linear-gradient(135deg, var(--risk-high-bg), #fff5f5);
  border-bottom: 1px solid rgba(198,40,40,.15);
}
.modal-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: icon-pop .4s cubic-bezier(.34,1.56,.64,1) .15s both;
}
@keyframes icon-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--blue-900);
  margin-bottom: 6px;
}
.modal-header p { font-size: 14px; color: var(--gray-600); }

/* Modal body */
.modal-body { padding: 28px 40px 36px; }

/* Gauge */
.risk-gauge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.risk-gauge {
  position: relative;
  width: 200px;
}
.gauge-svg { width: 100%; }

.gauge-bg {
  fill: none;
  stroke: var(--gray-100);
  stroke-width: 14;
}
.gauge-fill {
  fill: none;
  stroke: var(--blue-700);
  stroke-width: 14;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1),
              stroke .3s ease;
}
.gauge-fill.low  { stroke: var(--risk-low-mid); }
.gauge-fill.high { stroke: var(--risk-high-mid); }

.gauge-value {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  padding-bottom: 8px;
}
.gauge-value span {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--blue-900);
  display: block;
  line-height: 1;
}
.gauge-value small {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Risk label */
.risk-label-wrap { text-align: center; margin-bottom: 20px; }
.risk-label {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  margin-bottom: 10px;
}
.risk-label.low  { background: var(--risk-low-bg);  color: var(--risk-low); }
.risk-label.high { background: var(--risk-high-bg); color: var(--risk-high); }
.risk-description { font-size: 14px; color: var(--gray-600); line-height: 1.6; }

/* Risk factors */
.risk-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: center;
}
.risk-factor-chip {
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 50px;
  background: var(--blue-50);
  color: var(--blue-800);
  border: 1px solid rgba(21,101,192,.15);
}

/* Disclaimer */
.modal-disclaimer {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--blue-700);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.disclaimer-icon { font-size: 20px; flex-shrink: 0; }
.modal-disclaimer p {
  font-size: 12.5px;
  color: var(--gray-600);
  line-height: 1.6;
}
.modal-disclaimer strong { color: var(--gray-800); }

/* Modal actions */
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── FOOTER ───────────────────────────────────────── */
.footer {
  background: var(--blue-900);
  color: rgba(255,255,255,.7);
  padding: 56px 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand p {
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.7;
  max-width: 300px;
}
.footer-links h4,
.footer-contact h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white);
  margin-bottom: 16px;
}
.footer-links ul { list-style: none; }
.footer-links li + li { margin-top: 10px; }
.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,.6);
  transition: color .2s;
}
.footer-links a:hover { color: var(--white); }
.footer-contact p { font-size: 14px; margin-bottom: 8px; }
.footer-bottom {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: rgba(255,255,255,.4);
}

/* ─── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-inner { gap: 40px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .doctors-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --section-py: 64px; }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-subtitle { margin: 0 auto 36px; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { display: none; }

  .doctors-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group-full { grid-column: 1; }
  #heartRiskForm,
  #appointmentForm { padding: 28px 20px 24px; }
  .form-card-header { padding: 16px 20px; }
  .modal-header { padding: 32px 24px 20px; }
  .modal-body { padding: 20px 24px 28px; }
  .appt-info-strip { padding: 16px 20px; flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    gap: 4px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-cta-btn { margin-left: 0; width: 100%; text-align: center; justify-content: center; }

  .features-grid { grid-template-columns: 1fr; gap: 16px; }

  .hero-stats { flex-direction: column; gap: 16px; }
  .stat-divider { width: 40px; height: 1px; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }

  .btn-submit { width: 100%; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; justify-content: center; }
}
