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

:root {
  --primary: #1a56db;
  --primary-dark: #1240a8;
  --primary-light: #e8f0fe;
  --accent: #0ea5e9;
  --dark: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

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

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-brand img {
  height: 64px;
  width: auto;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1.5rem;
  flex: 1;
  flex-wrap: wrap;
}

.nav-item {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-item:hover, .nav-item.active-nav {
  color: var(--primary);
  background: var(--primary-light);
}

.btn-launch {
  white-space: nowrap;
  padding: 0.55rem 1.2rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}
.btn-launch:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ===== NAV DROPDOWN ===== */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  cursor: pointer;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  z-index: 200;
  padding: 0.5rem 0;
}
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
}
.nav-dropdown-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #1a56db 100%);
  color: var(--white);
  padding: 5rem 1.5rem 4rem;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.hero-headline {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  color: var(--white);
}

.hero-sub {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.btn-primary-lg {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.15s;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary-lg:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,86,219,0.35);
}

.btn-outline-lg {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-outline-lg:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
}

.hero-note {
  font-size: 0.83rem;
  color: #94a3b8;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-img {
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0.92;
}

/* ===== STATS BAR ===== */
.stats-bar {
  background: var(--primary);
  padding: 1.5rem 1.5rem;
}

.stats-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
}

.stat-label {
  font-size: 0.82rem;
  color: #bfdbfe;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== SECTIONS ===== */
.section {
  padding: 5rem 1.5rem;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.emr-section { background: var(--bg); }
.services-section { background: var(--white); }

/* ===== FEATURES GRID ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #bfdbfe;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== HOW IT WORKS ===== */
.how-it-works {
  background: linear-gradient(135deg, #1a56db 0%, #0ea5e9 100%);
  border-radius: 20px;
  padding: 3.5rem 2.5rem;
  color: var(--white);
  text-align: center;
}

.section-subheading {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 2.5rem;
}

.steps-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.step-card {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  max-width: 280px;
  flex: 1;
  min-width: 200px;
}

.step-number {
  width: 44px;
  height: 44px;
  background: var(--white);
  color: var(--primary);
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.step-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.step-card p {
  font-size: 0.87rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
}

.step-arrow {
  font-size: 2rem;
  color: rgba(255,255,255,0.5);
  align-self: center;
  padding: 0 0.5rem;
}

/* ===== BENEFITS ===== */
.benefits-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.benefit-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.benefit-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.benefit-item strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.35rem;
}

.benefit-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== INTERFACES GRID ===== */
.interfaces-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  margin-bottom: 1.5rem;
}

.interfaces-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.interface-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.interface-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.interface-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.15s;
}

.interface-card:hover a { color: var(--primary); }
.interface-card a.clicked { color: var(--primary); }

.iface-icon {
  font-size: 1.6rem;
}

/* Template detail area */
#template-area {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 0;
}

#template-area:empty { display: none; }

#template-area h2 {
  color: var(--primary-dark);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

#template-area p, #template-area li {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.7;
}

#template-area ol, #template-area ul {
  margin-left: 1.25rem;
}

#template-area li {
  margin-bottom: 0.4rem;
}

#template-area strong {
  color: var(--dark);
}

/* ===== CTA BANNER ===== */
.cta-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  padding: 5rem 1.5rem;
  text-align: center;
}

.cta-inner {
  max-width: 700px;
  margin: 0 auto;
}

.cta-inner h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.cta-inner p {
  font-size: 1.05rem;
  color: #94a3b8;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-white-lg {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: var(--white);
  color: var(--primary);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-white-lg:hover {
  background: #f0f4ff;
  transform: translateY(-2px);
}

.btn-outline-white-lg {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-outline-white-lg:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.08);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark);
  color: #94a3b8;
  padding: 3.5rem 1.5rem 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #1e293b;
}

.footer-brand img {
  margin-bottom: 0.75rem;
  filter: brightness(1.2);
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links strong {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.footer-links a {
  font-size: 0.88rem;
  color: #94a3b8;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--white); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-contact strong {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-contact-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.footer-contact-row a {
  color: #94a3b8;
  transition: color 0.15s;
}
.footer-contact-row a:hover { color: var(--white); }

.footer-social {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.25rem;
}

.footer-social a {
  opacity: 0.7;
  transition: opacity 0.15s, transform 0.15s;
}
.footer-social a:hover { opacity: 1; transform: translateY(-2px); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.83rem;
  color: #475569;
}

/* ===== TEMPLATE PAGE STYLES (about, clients, contact loaded via fetch) ===== */
.content-container { display: flex; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }

.about-text2 { flex: 2; padding: 1.5rem; }
.about-text2 h2 { color: var(--primary-dark); font-size: 1.6rem; font-weight: 800; margin-bottom: 1rem; }
.about-text2 li { color: var(--text); padding: 0.4rem 0; line-height: 1.7; font-size: 0.95rem; }
.about-container { flex: 1; min-width: 200px; }
.about-container img { width: 100%; border-radius: var(--radius); }

.index-text2 h2 { color: var(--primary-dark); font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.index-text2 p { color: var(--text); line-height: 1.7; margin-bottom: 0.75rem; }

.clients-image img, .clients-image2 img { width: 100%; border-radius: var(--radius); }
.clients-text h2, .clients-text2 h2 { color: var(--primary-dark); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; }
.clients-text li, .clients-text2 li { color: var(--text); padding: 0.5rem 0; line-height: 1.6; font-size: 0.92rem; }
.clients-h1 p { color: var(--text); line-height: 1.7; padding: 0.5rem 1.5rem; }
.contact-link { color: var(--primary); text-decoration: underline; }

.template-text2 { padding: 1.5rem 0; }
.template-text2 h2 { color: var(--primary-dark); font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }

.lab-content { width: 100%; }
.lab-content ol { margin-left: 1.25rem; }
.lab-content li { color: var(--text); padding: 0.35rem 0; line-height: 1.65; font-size: 0.92rem; }
.lab-content strong { color: var(--dark); }

.homepage { text-align: center; margin-top: 2.5rem; }
.homepage a { color: var(--primary); font-weight: 600; font-size: 1rem; text-decoration: underline; }

/* ===== SERVICE PAGES ===== */
.service-page { padding: 2rem 0; }
.service-page h1 { color: var(--primary-dark); font-size: 2rem; font-weight: 800; margin-bottom: 0.75rem; }
.service-page .service-tag { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 0.78rem; font-weight: 700; padding: 0.25rem 0.8rem; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.service-page .service-intro { font-size: 1.05rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 2rem; max-width: 760px; }
.service-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }
.service-point { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.25rem; }
.service-point strong { display: block; color: var(--dark); font-size: 0.95rem; margin-bottom: 0.3rem; }
.service-point p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }
.service-cta-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.service-cta-row a.btn-primary-lg { font-size: 0.95rem; padding: 0.75rem 1.75rem; }
.service-cta-row .back-link { color: var(--text-muted); font-size: 0.88rem; text-decoration: underline; cursor: pointer; }
.service-cta-row .back-link:hover { color: var(--primary); }
@media (max-width: 600px) { .service-points { grid-template-columns: 1fr; } }

@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .interfaces-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-image { display: none; }
  .hero-headline { font-size: 2rem; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .interfaces-grid { grid-template-columns: repeat(2, 1fr); }
  .benefits-row { grid-template-columns: 1fr; }
  .steps-row { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); padding: 0.25rem 0; }
  .navbar-links { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .cta-inner h2 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .interfaces-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-inner { grid-template-columns: 1fr 1fr; }
}
