:root {
  /* Brand Colors - Blue & White Theme */
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --secondary: #0c4a6e;
  --accent: #38bdf8;
  
  /* Neutral Colors */
  --bg-main: #ffffff;
  --bg-soft: #f8fafc;
  --bg-blue: #f0f9ff;
  --surface: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-white: #ffffff;
  --border: #e2e8f0;
  --border-blue: #bae6fd;
  
  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  /* Layout Constants */
  --container-max: 1280px;
  --header-height: 80px;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Base Styles */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3, h4 {
  color: var(--secondary);
  line-height: 1.2;
  margin-top: 0;
  font-weight: 800;
}

p { margin-bottom: 1.5rem; }

/* Utility Classes */
.eyebrow {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: var(--text-white);
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(2, 132, 199, 0.4);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.75rem 1.875rem;
  border-radius: 9999px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-outline:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}

.nav-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.025em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-cta {
  background-color: var(--primary);
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-cta:hover {
  background-color: var(--primary-dark);
}

/* Hero Section */
.hero {
  padding: 6rem 0;
  background: radial-gradient(circle at top right, var(--bg-blue), transparent);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  color: var(--secondary);
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 2.5rem;
}

.hero-visual {
  position: relative;
}

.hero-visual img {
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 20px 30px rgba(2, 132, 199, 0.15));
}

/* Features/Workflow Section */
.section {
  padding: 6rem 0;
}

.section-alt {
  background-color: var(--bg-blue);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section-header h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.flow-card {
  background-color: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.3s;
}

.flow-card:hover {
  transform: translateY(-10px);
  border-color: var(--border-blue);
  box-shadow: var(--shadow-lg);
}

.flow-icon {
  width: 4rem;
  height: 4rem;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 1rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1.5rem;
}

.flow-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.flow-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* WebGIS Preview Section */
.map-preview-card {
  background-color: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 320px;
}

#map-preview {
  height: 540px;
  width: 100%;
  background-color: var(--bg-soft);
}

.map-sidebar {
  padding: 2rem;
  background-color: var(--bg-soft);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.legend-group h4 {
  font-size: 0.875rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.legend-list {
  display: grid;
  gap: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-boundary { border: 2px dashed var(--primary); background: rgba(2, 132, 199, 0.1); }
.dot-berat { background-color: var(--danger); }
.dot-sedang { background-color: var(--warning); }
.dot-ringan { background-color: var(--success); }

/* Rujukan Section (Bantuan Page) */
.rujukan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.rujukan-card {
  background-color: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.rujukan-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.rujukan-type {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  padding: 4rem 0;
  background-color: var(--secondary);
  color: #fff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-info p { margin: 0; font-weight: 600; }

.footer-nav {
  display: flex;
  gap: 2rem;
}

.footer-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #fff;
}

/* Responsive Header & Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle svg {
  width: 1.75rem;
  height: 1.75rem;
}

.mobile-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: 0;
  background-color: #fff;
  z-index: 999;
  overflow: hidden;
  transition: height 0.3s ease-in-out;
  border-bottom: 1px solid var(--border);
}

.mobile-overlay.is-active {
  height: calc(100vh - var(--header-height));
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 1.5rem;
}

.mobile-link {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-soft);
}

.mobile-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.mobile-cta {
  background-color: var(--primary);
  color: #fff;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 800;
  margin-top: 1rem;
}

/* Responsiveness Fixes */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-visual {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }

  .map-preview-card {
    grid-template-columns: 1fr;
  }
  
  .map-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  .section { padding: 4rem 0; }
  
  .hero { padding: 4rem 0; }
  
  .hero-title { font-size: 2rem; }

  .workflow-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .flow-card { padding: 1.5rem; }

  /* Screening Form Mobile */
  .qa-item {
    padding: 1.25rem;
  }
  
  .qa-item div[style*="gap: 3rem"] {
    gap: 1.5rem !important;
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-nav {
    justify-content: center;
  }
}
