/* ============================================================
   MedChart — Free Medical Records App for Doctors
   Cloudflare Pages | styles.css
   ============================================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap');

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  color: #334155;
  background: #ffffff;
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

a { color: #1e3a5f; text-decoration: none; transition: color 0.2s; }
a:hover { color: #f59e0b; }

img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- Grid Pattern --- */
.grid-bg {
  position: relative;
}
.grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30,58,95,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,58,95,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}
.grid-bg > * { position: relative; z-index: 1; }

/* --- Navigation --- */
nav {
  background: #ffffff;
  border-bottom: 2px solid #1e3a5f;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: #1e3a5f;
  letter-spacing: -0.03em;
}
.logo span { color: #f59e0b; }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-links a:hover { color: #f59e0b; }
.nav-cta {
  font-family: 'Inter', sans-serif;
  background: #1e3a5f;
  color: #ffffff !important;
  padding: 10px 24px;
  border: 2px solid #1e3a5f;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  transition: all 0.2s;
}
.nav-cta:hover {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #ffffff !important;
}
.mobile-toggle {
  display: none;
  background: none;
  border: 2px solid #1e3a5f;
  padding: 8px;
  cursor: pointer;
  color: #1e3a5f;
  font-size: 1.25rem;
}

/* --- Hero --- */
.hero {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 100px 24px 80px;
  position: relative;
}
.hero .container { display: flex; align-items: center; gap: 60px; }
.hero-content { flex: 1; }
.hero-visual { flex: 1; display: flex; justify-content: center; align-items: center; }
.hero h1 {
  font-size: 3rem;
  margin-bottom: 24px;
  color: #0f172a;
}
.hero .accent { color: #f59e0b; }
.hero p {
  font-size: 1.2rem;
  color: #334155;
  margin-bottom: 32px;
  max-width: 540px;
}
.hero-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1e3a5f;
  border: 2px solid #1e3a5f;
  padding: 6px 14px;
  margin-bottom: 20px;
}
.monogram-large {
  width: 280px;
  height: 280px;
  border: 3px solid #1e3a5f;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.monogram-large::after {
  content: '';
  position: absolute;
  top: 12px; left: 12px; right: -12px; bottom: -12px;
  border: 2px solid #f59e0b;
  z-index: 0;
}
.monogram-large svg { width: 160px; height: 160px; position: relative; z-index: 1; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 36px;
  cursor: pointer;
  border: 2px solid #1e3a5f;
  transition: all 0.2s;
}
.btn-primary {
  background: #1e3a5f;
  color: #ffffff !important;
}
.btn-primary:hover {
  background: #f59e0b;
  border-color: #f59e0b;
}
.btn-secondary {
  background: transparent;
  color: #1e3a5f !important;
}
.btn-secondary:hover {
  background: #1e3a5f;
  color: #ffffff !important;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* --- Sections --- */
.section {
  padding: 90px 24px;
}
.section-alt {
  background: #f1f5f9;
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.section-header p {
  font-size: 1.125rem;
  max-width: 680px;
  margin: 0 auto;
  color: #334155;
}

/* --- Trust Bar --- */
.trust-bar {
  border-top: 2px solid #e2e8f0;
  border-bottom: 2px solid #e2e8f0;
  padding: 32px 24px;
  background: #ffffff;
}
.trust-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.trust-item {
  text-align: center;
  flex: 1;
  min-width: 160px;
}
.trust-item .num {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: #1e3a5f;
  display: block;
}
.trust-item .label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 600;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}
.feature-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  padding: 40px 32px;
  transition: border-color 0.3s;
}
.feature-card:hover { border-color: #1e3a5f; }
.feature-card .icon { margin-bottom: 20px; }
.feature-card .icon svg { width: 48px; height: 48px; }
.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.feature-card p {
  color: #334155;
  font-size: 1rem;
  line-height: 1.7;
}

/* --- Alternating Features (slide-in) --- */
.alt-feature {
  display: flex;
  align-items: center;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto 80px;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.alt-feature.visible { opacity: 1; }
.alt-feature.slide-left { transform: translateX(-60px); }
.alt-feature.slide-left.visible { transform: translateX(0); }
.alt-feature.slide-right { transform: translateX(60px); }
.alt-feature.slide-right.visible { transform: translateX(0); }
.alt-feature:last-child { margin-bottom: 0; }
.alt-feature.reverse { flex-direction: row-reverse; }
.alt-feature-text { flex: 1; }
.alt-feature-visual { flex: 1; display: flex; justify-content: center; }
.alt-feature h3 {
  font-size: 1.75rem;
  margin-bottom: 16px;
}
.alt-feature p {
  color: #334155;
  margin-bottom: 16px;
  font-size: 1.0625rem;
}
.alt-feature .feature-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f59e0b;
  border: 2px solid #f59e0b;
  padding: 4px 12px;
  margin-bottom: 12px;
}

/* --- Visual placeholder for alt features --- */
.visual-box {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4/3;
  border: 2px solid #1e3a5f;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  position: relative;
}
.visual-box::after {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: -8px; bottom: -8px;
  border: 2px solid #e2e8f0;
  z-index: 0;
}
.visual-box svg { width: 80px; height: 80px; position: relative; z-index: 1; color: #1e3a5f; }

/* --- Portfolio / Gallery --- */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.filter-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 24px;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover {
  border-color: #1e3a5f;
  background: #1e3a5f;
  color: #ffffff;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.gallery-item {
  border: 2px solid #e2e8f0;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.3s;
  position: relative;
}
.gallery-item:hover { border-color: #1e3a5f; }
.gallery-item .thumb {
  aspect-ratio: 16/11;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 40px;
}
.gallery-item .thumb svg { width: 100%; height: 100%; max-width: 160px; max-height: 120px; }
.gallery-item .caption {
  padding: 20px 24px;
  border-top: 2px solid #e2e8f0;
}
.gallery-item .caption h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.gallery-item .caption p {
  font-size: 0.9rem;
  color: #64748b;
}
.gallery-item .caption .tag {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f59e0b;
  border: 1px solid #f59e0b;
  padding: 2px 8px;
  margin-top: 8px;
}

/* --- Portfolio page hero --- */
.page-hero {
  padding: 80px 24px 60px;
  border-bottom: 2px solid #e2e8f0;
  background: #ffffff;
}
.page-hero h1 {
  font-size: 2.75rem;
  margin-bottom: 12px;
}
.page-hero p {
  font-size: 1.125rem;
  max-width: 600px;
  color: #334155;
}

/* --- Contact / Waitlist --- */
.contact-wrap {
  display: flex;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.contact-form { flex: 1.3; }
.contact-info { flex: 1; }
.contact-info h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.contact-info p {
  margin-bottom: 24px;
}
.contact-detail {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.contact-detail svg { width: 24px; height: 24px; flex-shrink: 0; margin-top: 4px; }
.contact-detail .detail-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.contact-detail .detail-value {
  color: #334155;
}

.form-group { margin-bottom: 24px; }
.form-group label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: #0f172a;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #1e3a5f;
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231e3a5f' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }

.form-status {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  margin-top: 12px;
  padding: 12px 16px;
  border: 2px solid transparent;
}
.form-status.success { border-color: #10b981; color: #065f46; background: #ecfdf5; }
.form-status.error { border-color: #ef4444; color: #991b1b; background: #fef2f2; }

/* --- FAQ --- */
.faq-list { max-width: 860px; margin: 0 auto; }
.faq-item {
  border: 2px solid #e2e8f0;
  margin-bottom: 16px;
  background: #ffffff;
}
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
  gap: 16px;
}
.faq-question:hover { color: #1e3a5f; }
.faq-question .faq-icon {
  font-size: 1.5rem;
  color: #1e3a5f;
  flex-shrink: 0;
  transition: transform 0.3s;
}
.faq-item.open .faq-question .faq-icon { transform: rotate(45deg); }
.faq-answer {
  padding: 0 28px 24px;
  display: none;
  color: #334155;
  line-height: 1.8;
}
.faq-item.open .faq-answer { display: block; }

/* --- Footer --- */
footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 60px 24px 32px;
  border-top: 3px solid #1e3a5f;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand { flex: 1; min-width: 240px; }
.footer-brand .logo { color: #ffffff; }
.footer-brand p { margin-top: 12px; font-size: 0.95rem; }
.footer-links { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 8px;
  font-family: 'Source Serif 4', serif;
}
.footer-col a:hover { color: #f59e0b; }
.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid #1e3a5f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
}
.footer-bottom a { color: #f59e0b; }
.footer-bottom a:hover { text-decoration: underline; }

/* --- Services Page Features Hero --- */
.services-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}
.services-intro-text h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}
.services-intro-text p {
  color: #334155;
  margin-bottom: 16px;
}
.services-intro-visual { display: flex; justify-content: center; }
.services-intro-visual .visual-box { max-width: 380px; }
.services-intro-visual .visual-box svg { width: 100px; height: 100px; }

/* --- Services extra --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 60px auto 0;
}
.stat-card {
  border: 2px solid #e2e8f0;
  background: #ffffff;
  padding: 32px 24px;
  text-align: center;
}
.stat-card .num {
  font-family: 'Inter', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #1e3a5f;
  display: block;
}
.stat-card .label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 600;
  margin-top: 4px;
}

.check-list { margin-top: 16px; }
.check-list li {
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  color: #334155;
}
.check-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 14px;
  width: 14px; height: 14px;
  border: 2px solid #f59e0b;
}

/* --- FAQ Page structured --- */
.faq-intro {
  max-width: 860px;
  margin: 0 auto 48px;
  text-align: center;
}
.faq-intro h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

/* --- Breadcrumbs (structured data display) --- */
.breadcrumb {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 16px 24px 0;
  max-width: 1200px;
  margin: 0 auto;
}
.breadcrumb a { color: #1e3a5f; }
.breadcrumb span { color: #94a3b8; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .services-intro { grid-template-columns: 1fr; }
  .alt-feature, .alt-feature.reverse { flex-direction: column; }
  .alt-feature-text { order: 2; }
  .alt-feature-visual { order: 1; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: #ffffff; border-bottom: 2px solid #1e3a5f; padding: 24px; gap: 16px; }
  .mobile-toggle { display: block; }
  .hero .container { flex-direction: column; }
  .hero h1 { font-size: 2rem; }
  .section-header h2 { font-size: 1.75rem; }
  .gallery { grid-template-columns: 1fr; }
  .contact-wrap { flex-direction: column; }
  .trust-grid { flex-direction: column; gap: 16px; }
  .stats-row { grid-template-columns: 1fr; }
  .monogram-large { width: 200px; height: 200px; }
  .monogram-large svg { width: 110px; height: 110px; }
  .footer-inner { flex-direction: column; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .page-hero h1 { font-size: 2rem; }
}
