/* ============================================
   DocFlow — Clinical Calculator App
   Brand: #1F4E79 | #2E75B6 | #00B4D8
   ============================================ */

:root {
  --primary: #1F4E79;
  --primary-dark: #153A5C;
  --secondary: #2E75B6;
  --accent: #00B4D8;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #1A1A2E;
  --subtext: #6B7280;
  --border: #E5E7EB;
  --success: #16A34A;
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============ NAVBAR ============ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  transition: var(--transition);
  background: transparent;
}

.nav.scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  transition: var(--transition);
}

.nav.scrolled .nav-logo {
  color: var(--primary);
}

.nav-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

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

.nav-links a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  transition: var(--transition);
}

.nav.scrolled .nav-links a {
  color: var(--subtext);
}

.nav-links a:hover {
  color: white;
}

.nav.scrolled .nav-links a:hover {
  color: var(--primary);
}

.nav-cta {
  background: white !important;
  color: var(--primary) !important;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 600 !important;
}

.nav.scrolled .nav-cta {
  background: var(--primary) !important;
  color: white !important;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31,78,121,0.2);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: white;
}

.nav.scrolled .mobile-toggle {
  color: var(--primary);
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  border-radius: 2px;
  transition: var(--transition);
}

/* ============ HERO ============ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #1F4E79 0%, #2E75B6 50%, #1F4E79 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(0,180,216,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(46,117,182,0.2) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(0,180,216,0.08) 0%, transparent 50%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  animation: fadeUp 0.8s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-block;
  background: rgba(0,180,216,0.15);
  color: #00B4D8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0,180,216,0.2);
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  color: white;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero h1 span {
  background: linear-gradient(135deg, #00B4D8, #2E75B6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.8);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: white;
  color: var(--primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1.5px solid rgba(255,255,255,0.25);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.hero-visual {
  display: flex;
  justify-content: center;
  animation: fadeUp 0.8s ease-out 0.2s backwards;
}

.hero-visual img {
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.2));
  transition: var(--transition);
}

.hero-visual img:hover {
  transform: translateY(-8px) scale(1.02);
}

/* floating elements */
.floating-elements {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-elements span {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(0,180,216,0.3);
  border-radius: 50%;
  animation: float 6s infinite;
}

.floating-elements span:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.floating-elements span:nth-child(2) { top: 65%; left: 5%; animation-delay: 1s; width: 4px; height: 4px; }
.floating-elements span:nth-child(3) { top: 30%; right: 15%; animation-delay: 2s; }
.floating-elements span:nth-child(4) { top: 75%; right: 10%; animation-delay: 3s; width: 5px; height: 5px; }
.floating-elements span:nth-child(5) { top: 50%; left: 50%; animation-delay: 1.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
  50% { transform: translateY(-20px) scale(1.5); opacity: 0.6; }
}

/* ============ SECTIONS ============ */

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

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-header p {
  font-size: 1.0625rem;
  color: var(--subtext);
  max-width: 600px;
  margin: 0 auto;
}

.section-dark {
  background: linear-gradient(135deg, #1F4E79, #2E75B6);
  padding: 100px 24px;
}

.section-dark .section-header h2 {
  color: white;
}

.section-dark .section-header p {
  color: rgba(255,255,255,0.8);
}

/* ============ FEATURES ============ */

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  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(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(31,78,121,0.08);
  border-color: var(--secondary);
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(31,78,121,0.08), rgba(0,180,216,0.08));
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--subtext);
  line-height: 1.6;
}

/* ============ CALCULATORS ============ */

.calculators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.calc-category {
  margin-bottom: 48px;
}

.calc-category:last-child {
  margin-bottom: 0;
}

.calc-category h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  transition: var(--transition);
}

.calc-card:last-child {
  margin-bottom: 0;
}

.calc-card:hover {
  transform: translateX(4px);
  border-color: var(--secondary);
  box-shadow: 0 4px 12px rgba(31,78,121,0.06);
}

.calc-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: linear-gradient(135deg, rgba(31,78,121,0.06), rgba(0,180,216,0.06));
  flex-shrink: 0;
}

.calc-card h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.calc-card p {
  font-size: 0.8125rem;
  color: var(--subtext);
}

.calc-arrow {
  color: var(--subtext);
  font-size: 1.25rem;
  opacity: 0;
  transition: var(--transition);
}

.calc-card:hover .calc-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.calc-count {
  font-size: 0.8125rem;
  color: var(--subtext);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 100px;
}

.calculators-collapsed {
  display: none;
}
.calculators-collapsed.visible {
  display: contents;
}

/* ============ TRANSPARENCY ============ */

.transparency-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.transparency-text h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
}

.transparency-text p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.7;
}

.transparency-text ul {
  list-style: none;
}

.transparency-text ul li {
  color: rgba(255,255,255,0.85);
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  font-size: 0.9375rem;
}

.transparency-text ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #00B4D8;
  font-weight: 700;
}

.transparency-visual img {
  width: 100%;
  max-width: 320px;
  display: block;
  margin: 0 auto;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.15);
}

/* ============ DOWNLOAD ============ */

.download {
  text-align: center;
}

.download-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  transition: var(--transition);
  text-align: center;
}

.download-card.featured {
  border-color: var(--secondary);
  border-width: 2px;
  position: relative;
}

.download-card.featured::after {
  content: 'Latest';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 16px;
  border-radius: 100px;
}

.download-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(31,78,121,0.1);
}

.download-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.download-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.download-card p {
  font-size: 0.875rem;
  color: var(--subtext);
  margin-bottom: 20px;
}

.download-card .version {
  font-size: 0.75rem;
  color: var(--subtext);
  margin-bottom: 20px;
  opacity: 0.7;
}

.download-card .btn {
  width: 100%;
  justify-content: center;
}

/* ============ FOOTER ============ */

.footer {
  background: var(--text);
  padding: 60px 24px 32px;
  color: rgba(255,255,255,0.7);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.footer-brand h4 {
  color: white;
  font-size: 1.125rem;
  margin-bottom: 8px;
}

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

.footer-col h5 {
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.8125rem;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-visual img {
    max-width: 240px;
  }

  .transparency-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .transparency-text ul li {
    text-align: left;
  }

  .transparency-visual {
    order: -1;
  }

  .transparency-visual img {
    max-width: 240px;
  }

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

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 16px 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    gap: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    color: var(--text) !important;
  }

  .nav-cta {
    background: var(--primary) !important;
    color: white !important;
    text-align: center;
  }

  .mobile-toggle {
    display: block;
  }

  .section {
    padding: 60px 20px;
  }

  .section-header h2 {
    font-size: 1.75rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .calculators-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
