/* =============================================
   MediLife Hospital — Stylesheet
   ============================================= */

:root {
  --navy: #0d1f3c;
  --navy-2: #12274a;
  --blue: #1a5fd6;
  --blue-dark: #0f3f8f;
  --blue-light: #eaf3fc;
  --blue-light-2: #dbeafe;
  --text-dark: #16233d;
  --text-gray: #5b6b82;
  --text-gray-light: #8695ab;
  --border: #e6ecf3;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 20px 40px -20px rgba(13, 31, 60, 0.18);
  --shadow-sm: 0 8px 20px -8px rgba(13, 31, 60, 0.15);
  --container: 1200px;
  --ff: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

ul { list-style: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.icon-sm { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.15s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 12px 24px -10px rgba(26, 95, 214, 0.55);
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-outline:hover { background: var(--blue-light); }

.btn-white {
  background: var(--white);
  color: var(--blue-dark);
}
.btn-white:hover { background: var(--blue-light); }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--navy);
  color: #cfe0f5;
  font-size: 0.82rem;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 24px;
}
.topbar-tagline {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #cfe0f5;
}
.topbar-tagline .icon-sm { width: 15px; height: 15px; color: #5b9bf0; }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.topbar-emergency { color: #9fc4f2; font-weight: 500; }
.topbar-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--white);
}
.topbar-phone .icon-sm { width: 15px; height: 15px; color: #5b9bf0; }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 4px 20px -8px rgba(13, 31, 60, 0.15); }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark { width: 40px; height: 40px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 1.25rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.logo-sub { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-gray-light); }

.main-nav { flex: 1; display: flex; justify-content: center; }
.main-nav > ul { display: flex; align-items: center; gap: 30px; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text-dark);
  padding: 8px 0;
  position: relative;
  transition: color 0.15s ease;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li > a.active { color: var(--blue); }
.main-nav > ul > li > a.active::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--blue);
  border-radius: 2px;
}
.chev { width: 10px; height: 10px; transition: transform 0.2s ease; }
.has-dropdown:hover .chev { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 200px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 50;
}
.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown li a {
  display: block;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: background 0.15s ease, color 0.15s ease;
}
.dropdown li a:hover { background: var(--blue-light); color: var(--blue); }

.nav-cta { flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: 64px;
  overflow: hidden;
  background: linear-gradient(180deg, #f2f8fe 0%, #ffffff 62%);
}
.hero-bg-shape {
  position: absolute;
  top: -120px;
  right: -160px;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #dbeafe, #eaf3fc 60%, transparent 72%);
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding-bottom: 60px;
}
.eyebrow {
  color: var(--blue);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-copy h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.hero-copy h1 .text-blue { color: var(--blue); }
.hero-desc {
  margin-top: 20px;
  color: var(--text-gray);
  font-size: 1.05rem;
  max-width: 440px;
}
.hero-actions { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }

.hero-media { position: relative; }
.hero-illustration { width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(13,31,60,0.15)); }
.hero-badge {
  position: absolute;
  left: -10px;
  bottom: 30px;
  background: var(--white);
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
}
.hero-badge-icon {
  width: 38px; height: 38px;
  background: var(--blue-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.hero-badge-icon svg { width: 18px; height: 18px; }
.hero-badge div:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.hero-badge strong { font-size: 0.95rem; color: var(--navy); }
.hero-badge span { font-size: 0.75rem; color: var(--text-gray); }

/* ---------- Feature strip ---------- */
.feature-strip {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 32px 20px;
  transform: translateY(40px);
  margin-bottom: -40px;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0 16px;
  border-right: 1px solid var(--border);
}
.feature-item:last-child { border-right: none; }
.feature-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-item h3 { font-size: 0.95rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.feature-item p { font-size: 0.82rem; color: var(--text-gray); line-height: 1.4; }

/* ---------- Sections ---------- */
.section { padding: 130px 0 100px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.link-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--blue);
  font-size: 0.92rem;
  flex-shrink: 0;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.15s ease; }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Services ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.service-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
  border-color: transparent;
}
.service-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.service-icon svg { width: 26px; height: 26px; }
.service-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.service-card p { font-size: 0.9rem; color: var(--text-gray); margin-bottom: 16px; }
.learn-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--blue);
}
.learn-more svg { width: 15px; height: 15px; transition: transform 0.15s ease; }
.learn-more:hover svg { transform: translateX(4px); }

/* ---------- About ---------- */
.about { background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%); }
.about-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: center;
}
.about-media { position: relative; }
.about-illustration { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.about-stat-float {
  position: absolute;
  right: -16px;
  bottom: -20px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
  max-width: 220px;
}
.about-copy h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; color: var(--navy); letter-spacing: -0.02em; margin-bottom: 20px; }
.about-copy > p { color: var(--text-gray); font-size: 1rem; max-width: 500px; margin-bottom: 36px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .icon-sm { width: 22px; height: 22px; margin-bottom: 4px; }
.stat strong { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.stat span { font-size: 0.8rem; color: var(--text-gray); }

/* ---------- Testimonials ---------- */
.testimonials { background: var(--blue-light); }
.carousel { display: flex; align-items: center; gap: 20px; }
.carousel-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  gap: 24px;
}
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
}
.stars { color: #f5a623; letter-spacing: 2px; font-size: 0.95rem; margin-bottom: 14px; }
.testimonial-card p { color: var(--text-dark); font-size: 0.95rem; line-height: 1.6; margin-bottom: 22px; min-height: 76px; }
.testimonial-person { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; }
.testimonial-person span { font-weight: 700; font-size: 0.9rem; color: var(--navy); }

.carousel-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--navy);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.carousel-btn:hover { background: var(--blue); color: var(--white); transform: scale(1.05); }
.carousel-btn svg { width: 20px; height: 20px; }

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.carousel-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #c3d6ef;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, width 0.2s ease;
}
.carousel-dots button.active { background: var(--blue); width: 22px; border-radius: 4px; }

/* ---------- CTA banner ---------- */
.cta-banner { background: linear-gradient(120deg, var(--blue) 0%, var(--blue-dark) 100%); padding: 48px 0; }
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-copy { display: flex; align-items: center; gap: 18px; }
.cta-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cta-icon svg { width: 26px; height: 26px; }
.cta-copy h3 { color: var(--white); font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.cta-copy p { color: #d3e4fb; font-size: 0.92rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #b9c9e0; padding: 70px 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr 1.3fr;
  gap: 40px;
  padding-bottom: 50px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand .logo-name { color: var(--white); }
.footer-brand .logo-sub { color: #7f93b3; }
.footer-brand p { margin: 16px 0 20px; font-size: 0.88rem; color: #93a6c3; max-width: 260px; }
.social-row { display: flex; gap: 10px; }
.social-row a {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  color: #b9c9e0;
  transition: background 0.15s ease, color 0.15s ease;
}
.social-row a svg { width: 16px; height: 16px; }
.social-row a:hover { background: var(--blue); color: var(--white); }

.footer-col h4 { color: var(--white); font-size: 0.95rem; font-weight: 700; margin-bottom: 18px; }
.footer-col ul li { margin-bottom: 11px; }
.footer-col ul li a { font-size: 0.88rem; color: #93a6c3; transition: color 0.15s ease; }
.footer-col ul li a:hover { color: var(--white); }
.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.85rem;
  color: #93a6c3;
}
.contact-list .icon-sm { color: #5b9bf0; margin-top: 2px; }

.newsletter p { font-size: 0.85rem; color: #93a6c3; margin-bottom: 16px; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  font-size: 0.85rem;
  font-family: var(--ff);
}
.newsletter-form input::placeholder { color: #7f93b3; }
.newsletter-form input:focus { outline: none; border-color: var(--blue); }
.newsletter-form .btn { padding: 11px 20px; font-size: 0.85rem; box-shadow: none; }
.newsletter-msg { margin-top: 10px; font-size: 0.82rem; color: #6fd39a; min-height: 1em; }

.footer-bottom { padding: 22px 0; }
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: #7f93b3;
}
.footer-bottom-inner a { color: #93a6c3; }
.footer-bottom-inner a:hover { color: var(--white); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.15s ease;
  z-index: 90;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--blue-dark); }
.back-to-top svg { width: 20px; height: 20px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 1080px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 420px; margin: 0 auto; }
  .hero-copy { text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .feature-strip { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
  .feature-item { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
  .feature-item:nth-child(2n) { border-right: none; }
  .about-inner { grid-template-columns: 1fr; }
  .about-media { max-width: 460px; margin: 0 auto; }
}

@media (max-width: 860px) {
  .topbar-tagline { display: none; }
  .main-nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(320px, 82vw);
    background: var(--white);
    box-shadow: -10px 0 40px rgba(13,31,60,0.15);
    padding: 100px 28px 40px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
    justify-content: flex-start;
    overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav > ul { flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; }
  .main-nav > ul > li { width: 100%; }
  .main-nav > ul > li > a { width: 100%; padding: 12px 0; justify-content: space-between; }
  .dropdown {
    position: static;
    transform: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    display: none;
    width: 100%;
    padding: 0 0 0 14px;
    min-width: 0;
  }
  .has-dropdown.open .dropdown { display: block; }
  .has-dropdown.open .chev { transform: rotate(180deg); }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .section { padding: 90px 0 70px; }
  .service-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-inner { flex-direction: column; text-align: center; }
  .cta-copy { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .feature-strip { grid-template-columns: 1fr; }
  .about-stat-float { position: static; margin-top: 16px; max-width: none; }
}
