/* ===== CSS Variables ===== */
:root {
  --primary: #1A6B7F;
  --primary-dark: #0D3B47;
  --primary-light: #2a8a9f;
  --accent: #F2E6C9;
  --accent-glow: #FFF8E7;
  --bg: #F7F3EC;
  --card-bg: #FDFBF7;
  --text-primary: #0D3B47;
  --text-secondary: #5A7A82;
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(13,59,71,0.06);
  --shadow-md: 0 8px 30px rgba(13,59,71,0.1);
  --shadow-lg: 0 20px 60px rgba(13,59,71,0.15);
  --shadow-glow: 0 0 40px rgba(26,107,127,0.2);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(247,243,236,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 20px rgba(13,59,71,0.08);
  padding: 10px 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-dark);
}

.nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
  border-radius: 1px;
}

.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid rgba(26,107,127,0.2);
  border-radius: 50px;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
  font-family: inherit;
}

.lang-toggle:hover {
  border-color: var(--primary);
  background: rgba(26,107,127,0.05);
}

.lang-flag { font-size: 1.1rem; }

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(247,243,236,0.95);
  backdrop-filter: blur(20px);
}

.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg) 0%, #e8eff1 50%, var(--bg) 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ecg-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 200px;
  transform: translateY(-50%);
  opacity: 0.5;
}

.ecg-path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: ecgDraw 4s ease-in-out infinite;
}

@keyframes ecgDraw {
  0% { stroke-dashoffset: 2000; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -2000; }
}

.hero-glow {
  position: absolute;
  top: 20%;
  right: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(26,107,127,0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(26,107,127,0.08);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 24px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #4db8cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 500px;
}

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(26,107,127,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(26,107,127,0.4);
}

.btn-primary small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.8;
}

.btn-primary strong { font-size: 1.05rem; }

.btn-large {
  padding: 18px 36px;
  font-size: 1rem;
}

/* Phone Mockup */
.hero-visual {
  display: flex;
  justify-content: center;
  perspective: 1000px;
}

.phone-mockup { position: relative; }

.phone-frame {
  width: 280px;
  height: 580px;
  background: #000;
  border-radius: 40px;
  padding: 12px;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255,255,255,0.1);
  animation: phoneFloat 6s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

@keyframes phoneFloat {
  0%, 100% { transform: translateY(0) rotateY(-5deg); }
  50% { transform: translateY(-12px) rotateY(-5deg); }
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
}

.phone-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(26,107,127,0.15) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  animation: pulseGlow 4s ease-in-out infinite;
}

/* Mockup Content */
.mockup-header { padding: 8px 16px; }
.mockup-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 4px 0;
}

.mockup-icons { display: flex; gap: 4px; align-items: center; }
.signal-bars, .wifi-icon, .battery-icon {
  width: 14px;
  height: 10px;
  background: var(--text-primary);
  border-radius: 2px;
  opacity: 0.5;
}

.mockup-app-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-dark);
}

.mockup-app-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.mockup-content { padding: 0 12px; }

.mockup-patient-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.mockup-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.mockup-name { font-weight: 600; font-size: 0.85rem; }
.mockup-sub { font-size: 0.65rem; color: var(--text-secondary); }

.mockup-vitals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mockup-vital-card {
  padding: 10px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.vital-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.vital-bp .vital-icon-wrapper { background: rgba(239,68,68,0.1); color: var(--error); }
.vital-pulse .vital-icon-wrapper { background: rgba(26,107,127,0.1); color: var(--primary); }
.vital-spo2 .vital-icon-wrapper { background: rgba(34,197,94,0.1); color: var(--success); }
.vital-glucose .vital-icon-wrapper { background: rgba(245,158,11,0.1); color: var(--warning); }

.vital-label { font-size: 0.6rem; color: var(--text-secondary); font-weight: 500; }
.vital-value { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.vital-value span { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.vital-unit { font-size: 0.55rem; color: var(--text-secondary); }

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollBounce 2s ease-in-out infinite;
}

.mouse {
  width: 24px;
  height: 38px;
  border: 2px solid rgba(26,107,127,0.3);
  border-radius: 12px;
  position: relative;
}

.wheel {
  width: 4px;
  height: 8px;
  background: var(--primary);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

@keyframes scrollWheel {
  0% { opacity: 1; top: 8px; }
  100% { opacity: 0; top: 20px; }
}

/* ===== Sections Common ===== */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(26,107,127,0.08);
  color: var(--primary);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ===== Features ===== */
.features {
  padding: 100px 0;
  background: white;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 36px 28px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,107,127,0.06);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(26,107,127,0.12);
}

.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(26,107,127,0.08), rgba(26,107,127,0.15));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--primary);
}

.feature-icon svg { width: 26px; height: 26px; }

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

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

/* ===== How It Works ===== */
.how-it-works {
  padding: 100px 0;
  background: var(--bg);
}

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

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(26,107,127,0.25);
}

.step-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  margin-top: 4px;
}

.step-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.step-connector {
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg, var(--primary), rgba(26,107,127,0.1));
  margin-left: 27px;
  border-radius: 1px;
}

/* ===== Stats ===== */
.stats-section {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  text-align: center;
}

.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(242,230,201,0.7);
  font-weight: 500;
}

/* ===== CTA ===== */
.cta-section {
  padding: 100px 0;
  background: white;
}

.cta-card {
  text-align: center;
  padding: 80px 40px;
  background: linear-gradient(135deg, var(--bg) 0%, #e8eff1 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,107,127,0.08);
}

.cta-card h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.cta-card p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 36px;
}

.cta-card .btn-appstore { display: inline-flex; }

/* ===== Footer ===== */
.footer {
  padding: 60px 0 30px;
  background: var(--primary-dark);
  color: rgba(242,230,201,0.8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(242,230,201,0.1);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.footer-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-links h4 {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ===== Animations ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll[data-animation="fade-left"] {
  transform: translateX(40px);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-subtitle { margin: 0 auto 36px; }
  .hero-cta { justify-content: center; }
  .hero-visual { order: -1; }
  .phone-frame { width: 240px; height: 500px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero { padding: 100px 0 60px; min-height: auto; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card { padding: 28px 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .cta-card { padding: 50px 24px; }
  .scroll-indicator { display: none; }
}

@media (max-width: 480px) {
  .phone-frame { width: 220px; height: 460px; }
  .hero-title { font-size: 2rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* ===== Legal / Support Page Styles ===== */
.page-header {
  padding: 120px 0 50px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  text-align: center;
  color: var(--accent);
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 1rem;
  opacity: 0.7;
}

.page-content {
  padding: 60px 0 100px;
  background: white;
}

.page-content .container {
  max-width: 800px;
}

.page-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.page-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.page-content p,
.page-content li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 12px;
}

.page-content ul {
  list-style: none;
  padding-left: 0;
}

.page-content ul li {
  position: relative;
  padding-left: 20px;
}

.page-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.page-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-content a:hover { color: var(--primary-dark); }

.page-content .last-updated {
  font-size: 0.85rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-bottom: 30px;
}

/* Support page specific */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.support-card {
  padding: 32px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,107,127,0.06);
  text-align: center;
  transition: var(--transition);
}

.support-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.support-card-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(26,107,127,0.08), rgba(26,107,127,0.15));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.support-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.support-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.faq-item {
  padding: 24px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid rgba(26,107,127,0.06);
  cursor: pointer;
  transition: var(--transition);
}

.faq-item:hover { border-color: rgba(26,107,127,0.15); }

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.faq-arrow {
  transition: var(--transition);
  color: var(--primary);
  font-size: 1.2rem;
}

.faq-item.open .faq-arrow { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  margin-top: 12px;
}

.faq-answer p { margin-bottom: 0; }
