/*
 * Rightflo Design System
 * ----------------------
 * Brand colors, typography, components, and layout utilities.
 * Used by: Landing page (rightflo-landing.html), RightFlo.Web.Mvc (portal + internal dashboard)
 *
 * Color palette from brand guide:
 *   Navy:  #0B1D3A  (primary dark, nav, headings)
 *   Blue:  #2563EB  (accent, links, interactive)
 *   Green: #10B981  (success, AI, brand gradient end)
 *   Mint:  #E6F7F3  (light background, AI highlight)
 *   Ice:   #F3F6F9  (section backgrounds)
 *
 * Typography:
 *   Headings: DM Serif Display (serif)
 *   Body:     Inter (sans-serif)
 *
 * Gradient: linear-gradient(135deg, #2563EB, #10B981)
 */

:root {
  --navy: #0B1D3A;
  --blue: #2563EB;
  --green: #10B981;
  --mint: #E6F7F3;
  --ice: #F3F6F9;
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gradient-brand: linear-gradient(135deg, #2563EB 0%, #10B981 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--gray-700);
  line-height: 1.6;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ============ NAV ============ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow 0.3s;
}
nav.scrolled { box-shadow: 0 1px 16px rgba(11,29,58,0.06); }
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 2rem; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 64px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { text-decoration: none; font-size: 0.9rem; font-weight: 500; color: var(--gray-600); transition: color 0.2s; }
.nav-links a:hover { color: var(--navy); }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.5rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; transition: all 0.25s; cursor: pointer; border: none;
}
.btn-primary { background: var(--gradient-brand); color: var(--white); box-shadow: 0 2px 12px rgba(37,99,235,0.25); }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(37,99,235,0.35); transform: translateY(-1px); }
.btn-outline { border: 1.5px solid var(--gray-300); color: var(--navy); background: transparent; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost { background: none; color: var(--blue); padding: 0.5rem 0; }
.btn-ghost:hover { opacity: 0.8; }
.nav-cta { display: flex; gap: 0.75rem; align-items: center; }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle svg { width: 24px; height: 24px; color: var(--navy); }

/* ============ HERO ============ */
.hero {
  padding: 10rem 2rem 6rem;
  position: relative; overflow: hidden;
  background: var(--white);
}
.hero::before {
  content: '';
  position: absolute; top: -200px; right: -200px;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(16,185,129,0.06) 0%, rgba(37,99,235,0.04) 50%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; bottom: -100px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(37,99,235,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
  position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: 50px;
  background: var(--mint); color: var(--green);
  font-size: 0.8rem; font-weight: 600; margin-bottom: 1.5rem;
}
.hero-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 3.5rem; line-height: 1.1; color: var(--navy);
  letter-spacing: -0.03em; margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: normal;
  background: var(--gradient-brand);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 1.15rem; color: var(--gray-500); margin-bottom: 2rem; max-width: 480px; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.hero-visual {
  display: flex; justify-content: center; align-items: center;
}
.hero-visual-card {
  width: 100%; max-width: 520px;
  background: var(--white); border-radius: 16px;
  box-shadow: 0 4px 40px rgba(11,29,58,0.08), 0 0 0 1px rgba(11,29,58,0.04);
  padding: 2rem; position: relative;
}
.hero-visual-card::before {
  content: ''; position: absolute; top: -2px; left: 20%; right: 20%; height: 4px;
  background: var(--gradient-brand); border-radius: 0 0 4px 4px;
}
.hv-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.hv-header h3 { font-size: 0.85rem; color: var(--navy); font-weight: 600; }
.hv-badge { font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 50px; font-weight: 600; }
.hv-badge.urgent { background: #FEF2F2; color: #DC2626; }
.hv-row { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--gray-100); }
.hv-row:last-child { border: none; }
.hv-label { font-size: 0.78rem; color: var(--gray-400); }
.hv-value { font-size: 0.78rem; color: var(--navy); font-weight: 500; }
.hv-ai {
  margin-top: 1.2rem; padding: 0.8rem 1rem; background: var(--mint); border-radius: 10px;
  display: flex; align-items: flex-start; gap: 0.6rem;
}
.hv-ai-icon {
  width: 20px; height: 20px; border-radius: 6px; background: var(--green);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
}
.hv-ai-icon svg { width: 12px; height: 12px; color: white; }
.hv-ai-text { font-size: 0.75rem; color: var(--gray-700); line-height: 1.5; }
.hv-ai-text strong { color: var(--green); }

/* ============ PILLARS ============ */
.pillars {
  padding: 5rem 2rem;
  background: var(--ice);
}
.pillars-inner { max-width: 1200px; margin: 0 auto; }
.pillars-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
}
.pillar {
  text-align: center; padding: 2rem 1.5rem;
  background: var(--white); border-radius: 14px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.pillar:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(11,29,58,0.06); }
.pillar-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.pillar-icon svg { width: 26px; height: 26px; }
.pillar-icon.p1 { background: #EFF6FF; color: var(--blue); }
.pillar-icon.p2 { background: #ECFDF5; color: var(--green); }
.pillar-icon.p3 { background: #FFF7ED; color: #F59E0B; }
.pillar-icon.p4 { background: #F0FDF4; color: #22C55E; }
.pillar h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 0.5rem; }
.pillar p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.6; }

/* ============ SECTION COMMON ============ */
.section { padding: 6rem 2rem; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--green); margin-bottom: 0.75rem;
}
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem; color: var(--navy); letter-spacing: -0.02em;
  margin-bottom: 1rem; line-height: 1.2;
}
.section-subtitle { font-size: 1.05rem; color: var(--gray-500); max-width: 600px; margin-bottom: 3rem; line-height: 1.7; }

/* ============ FEATURES ============ */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}
.feature-card {
  padding: 2rem; border-radius: 14px; background: var(--white);
  border: 1px solid var(--gray-200); transition: all 0.3s;
}
.feature-card:hover { border-color: var(--blue); box-shadow: 0 4px 24px rgba(37,99,235,0.08); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--mint);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1.2rem;
}
.feature-icon svg { width: 22px; height: 22px; color: var(--green); }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.88rem; color: var(--gray-500); line-height: 1.65; }

/* ============ HOW IT WORKS ============ */
.how-it-works { background: var(--navy); color: var(--white); }
.how-it-works .section-label { color: var(--green); }
.how-it-works .section-title { color: var(--white); }
.how-it-works .section-subtitle { color: var(--gray-400); }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.step {
  padding: 2rem; border-radius: 14px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.step-number {
  font-size: 3rem; font-weight: 800; line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 1rem;
}
.step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--white); }
.step p { font-size: 0.88rem; color: var(--gray-400); line-height: 1.65; }

/* ============ AI SECTION ============ */
.ai-section { background: var(--ice); }
.ai-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.ai-features { display: flex; flex-direction: column; gap: 1.5rem; }
.ai-feature {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.25rem; border-radius: 12px; background: var(--white);
  border: 1px solid var(--gray-200); transition: all 0.3s;
}
.ai-feature:hover { border-color: var(--green); box-shadow: 0 2px 16px rgba(16,185,129,0.08); }
.ai-dot {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ai-dot.d1 { background: #EFF6FF; }
.ai-dot.d2 { background: #ECFDF5; }
.ai-dot.d3 { background: #FFF7ED; }
.ai-dot.d4 { background: #F0FDF4; }
.ai-dot svg { width: 18px; height: 18px; }
.ai-feature h4 { font-size: 0.95rem; font-weight: 700; color: var(--navy); margin-bottom: 0.25rem; }
.ai-feature p { font-size: 0.82rem; color: var(--gray-500); line-height: 1.55; }

/* ============ INTEGRATIONS ============ */
.integrations { text-align: center; }
.integrations .section-subtitle { margin-left: auto; margin-right: auto; }
.ehr-grid {
  display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap;
  margin-bottom: 2rem;
}
.ehr-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  padding: 1.5rem 2rem; border-radius: 12px; background: var(--ice);
  min-width: 140px; transition: all 0.3s;
}
.ehr-item:hover { background: var(--mint); }
.ehr-name { font-size: 0.88rem; font-weight: 600; color: var(--navy); }
.ehr-status { font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 50px; }
.ehr-status.live { background: #ECFDF5; color: var(--green); }
.ehr-status.soon { background: #FFF7ED; color: #F59E0B; }
.ehr-fhir { font-size: 0.82rem; color: var(--gray-500); margin-top: 1rem; }

/* ============ CTA ============ */
.cta-section {
  padding: 6rem 2rem;
  background: var(--navy); text-align: center; position: relative; overflow: hidden;
}
.cta-section::before {
  content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, rgba(37,99,235,0.05) 40%, transparent 60%);
  pointer-events: none;
}
.cta-inner { max-width: 600px; margin: 0 auto; position: relative; z-index: 1; }
.cta-section h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem; color: var(--white); margin-bottom: 1rem; letter-spacing: -0.02em;
}
.cta-section p { font-size: 1.05rem; color: var(--gray-400); margin-bottom: 2rem; line-height: 1.7; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ============ FOOTER ============ */
footer {
  padding: 3rem 2rem; background: var(--gray-800);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-brand { display: flex; align-items: center; }
.footer-brand img { height: 48px; width: auto; display: block; border-radius:10px;}
.footer-text { font-size: 0.78rem; color: var(--gray-500); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.8rem; color: var(--gray-400); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate { opacity: 0; }
.animate.visible { animation: fadeUp 0.6s ease forwards; }

/* ============ CONTACT PAGE ============ */
.page-hero {
  padding: 8rem 2rem 3rem;
  background: var(--white);
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
}
.page-hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 2.75rem; line-height: 1.1; color: var(--navy);
  letter-spacing: -0.02em; margin-bottom: 0.75rem;
}
.page-hero p { font-size: 1.05rem; color: var(--gray-500); max-width: 560px; margin: 0 auto; }

.contact-grid {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem;
  max-width: 1000px; margin: 0 auto; padding: 4rem 2rem;
}
.contact-form-card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 14px; padding: 2rem;
  box-shadow: 0 1px 3px rgba(11,29,58,0.04);
}
.contact-info { padding: 0.5rem 0; }
.contact-info h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem; color: var(--navy); margin-bottom: 0.75rem; letter-spacing: -0.02em;
}
.contact-info p { color: var(--gray-500); margin-bottom: 1.25rem; line-height: 1.6; }
.contact-info dl { display: grid; grid-template-columns: 100px 1fr; gap: 0.5rem 1rem; font-size: 0.9rem; }
.contact-info dt { color: var(--gray-500); }
.contact-info dd { color: var(--navy); font-weight: 500; }

.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy);
  margin-bottom: 0.4rem;
}
.form-group label .required { color: #DC2626; }
.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-family: inherit; font-size: 0.92rem;
  color: var(--navy); background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
textarea.form-input { min-height: 120px; resize: vertical; }
.checkbox-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; color: var(--gray-700); cursor: pointer;
}
.checkbox-label input { width: 16px; height: 16px; }

.form-success {
  text-align: center; padding: 2rem 0;
}
.form-success h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem; color: var(--navy); margin-bottom: 0.5rem;
}
.form-success p { color: var(--gray-500); }
.form-error {
  margin-top: 0.75rem;
  color: #B91C1C; font-size: 0.85rem;
}

/* ============ 404 PAGE ============ */
.error-page {
  max-width: 560px; margin: 0 auto;
  padding: 8rem 2rem 4rem; text-align: center;
}
.error-page .error-code {
  font-family: 'DM Serif Display', serif;
  font-size: 5rem; line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}
.error-page h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem; color: var(--navy); margin-bottom: 0.75rem; letter-spacing: -0.02em;
}
.error-page p { color: var(--gray-500); margin-bottom: 2rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero h1 { font-size: 2.5rem; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { margin-top: 2rem; }
  .pillars-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .ai-inner { grid-template-columns: 1fr; }
  .section-title { font-size: 2rem; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; padding: 2rem 1.5rem; gap: 2rem; }
  .page-hero { padding: 6rem 1.5rem 2rem; }
  .page-hero h1 { font-size: 2rem; }
}
@media (max-width: 600px) {
  .pillars-grid { grid-template-columns: 1fr; }
  .hero { padding: 8rem 1.5rem 4rem; }
  .hero h1 { font-size: 2rem; }
  .ehr-grid { gap: 1rem; }
  .ehr-item { min-width: 120px; padding: 1rem; }
}
