/* ==========================================================================
   AuditFirst Medical Billing - Main Stylesheet
   Tech Stack: Tailwind CSS via CDN + Custom Styles
   ========================================================================== */

/* Import Tailwind Base, Components, and Utilities */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   CSS Variables - Brand Colors & Theme
   ========================================================================== */
:root {
  /* Primary Healthcare Blue */
  --color-primary: #0052CC;
  --color-primary-dark: #003D99;
  --color-primary-light: #3385D6;
  
  /* Secondary Teal - Medical Trust */
  --color-secondary: #00A896;
  --color-secondary-dark: #008C7A;
  --color-secondary-light: #2DBFAE;
  
  /* Accent Colors */
  --color-accent: #FF6B6B;
  --color-accent-dark: #E85555;
  
  /* Trust & Success Green */
  --color-trust: #06D6A0;
  --color-trust-dark: #05B387;
  --color-success: #06D6A0;
  
  /* Professional Grays & Neutrals */
  --color-gray-50: #F7FAFC;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-600: #4B5563;
  --color-gray-700: #374151;
  --color-gray-900: #1A2332;
  
  /* Alerts */
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0052CC 0%, #00A896 100%);
  --gradient-hero: linear-gradient(135deg, #0052CC 0%, #003D99 50%, #00A896 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #F7FAFC 100%);
  --gradient-accent: linear-gradient(135deg, #FF6B6B 0%, #E85555 100%);
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Poppins', sans-serif;
  
  /* Spacing */
  --section-padding: 6rem 0;
  --container-max: 1280px;
  
  /* Enhanced Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 82, 204, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 82, 204, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 82, 204, 0.15);
  --shadow-xl: 0 20px 25px -5px rgba(0, 82, 204, 0.2);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 82, 204, 0.25);
}

/* ==========================================================================
   Global Resets & Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary);
  color: var(--color-gray-900);
  line-height: 1.6;
  background-color: var(--color-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-gray-900);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
}

p {
  margin-bottom: 1rem;
  color: var(--color-gray-700);
}

a {
  text-decoration: none;
  color: var(--color-primary);
  transition: all 0.3s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: var(--section-padding);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: all 0.3s ease;
}

.header.scrolled {
  box-shadow: var(--shadow-lg);
}

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

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  font-family: var(--font-heading);
}

.logo-icon {
  margin-right: 0.5rem;
  font-size: 2rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-menu li {
  flex-shrink: 0;
  position: relative;
}

.nav-link {
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
  display: inline-block;
  will-change: auto;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  pointer-events: none;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  opacity: 1;
}

.nav-cta {
  background: var(--gradient-primary);
  color: white !important;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 700;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  margin-left: 2rem;
  flex-shrink: 0;
  will-change: transform;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}


.nav-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

.nav-cta:hover::before {
  left: 100%;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--color-gray-700);
  transition: all 0.3s ease;
  border-radius: 2px;
}

@media (max-width: 968px) {
  .menu-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 300px;
    height: calc(100vh - 70px);
    background: white;
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    transition: right 0.3s ease;
    align-items: flex-start;
    gap: 1.5rem;
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-cta {
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 1rem;
  }
  
  .nav-link {
    width: 100%;
    padding: 0.75rem 0;
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  background: var(--gradient-hero);
  color: white;
  padding: 8rem 0 6rem;
  margin-top: 70px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  color: white;
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease;
}

.hero-tagline {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 2rem;
  font-weight: 500;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s ease 0.4s both;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-family: var(--font-primary);
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2xl);
}

.btn-secondary {
  background: white;
  color: var(--color-primary);
  border: 2px solid white;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}

.btn-secondary:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-2xl);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.btn-outline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.btn-outline:hover {
  color: white;
  border-color: var(--color-secondary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.btn-outline:hover::before {
  opacity: 1;
}

/* Special style for outline buttons on hero/dark backgrounds */
.hero .btn-outline,
.btn-outline.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 2px solid white;
  backdrop-filter: blur(10px);
}

.hero .btn-outline:hover,
.btn-outline.btn-secondary:hover {
  background: white;
  color: var(--color-primary);
  border-color: white;
}

.btn-group {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s both;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--gradient-card);
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--color-gray-200);
  border-top: 4px solid transparent;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.card:hover {
  box-shadow: var(--shadow-2xl);
  transform: translateY(-8px);
  border-top-color: var(--color-accent);
}

.card:hover::before {
  opacity: 0.03;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-icon {
  font-size: 3rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  display: inline-block;
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
  color: var(--color-secondary);
}

.card-title {
  font-size: 1.5rem;
  color: var(--color-gray-900);
  margin-bottom: 1rem;
}

.card-description {
  color: var(--color-gray-600);
  line-height: 1.7;
}

/* ==========================================================================
   Services Grid
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

/* Contact Page Grid - 2 columns on desktop, 1 on mobile */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 2rem;
}

@media (max-width: 968px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* About Page Grid - 2 columns on desktop, 1 on mobile */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 2rem;
}

@media (max-width: 968px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* ==========================================================================
   Stats Section
   ========================================================================== */
.stats {
  background: linear-gradient(180deg, #ffffff 0%, var(--color-gray-50) 100%);
  padding: 5rem 0;
  position: relative;
}

.stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  opacity: 0.2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  text-align: center;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 1rem;
  color: var(--color-gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-gray-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--color-gray-300);
  border-radius: 0.5rem;
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-disclaimer {
  background: #FEF3C7;
  border-left: 4px solid var(--color-warning);
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

.form-disclaimer p {
  color: #92400E;
  font-size: 0.875rem;
  margin: 0;
  font-weight: 500;
}

/* ==========================================================================
   Trust Badges
   ========================================================================== */
.trust-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  padding: 2rem 0;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-700);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 82, 204, 0.1);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.trust-badge:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.trust-badge-icon {
  font-size: 2rem;
  color: var(--color-trust);
  transition: transform 0.3s ease;
}

.trust-badge:hover .trust-badge-icon {
  transform: scale(1.1);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--color-gray-900);
  color: white;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 968px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-column h4 {
  color: white;
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--color-gray-300);
  transition: color 0.3s ease;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  color: var(--color-gray-400);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section-subtitle {
  color: var(--color-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.125rem;
  color: var(--color-gray-600);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease both;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-trust { color: var(--color-trust); }
.bg-gray-light { background: var(--color-gray-50); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ==========================================================================
   Responsive Utilities
   ========================================================================== */
@media (max-width: 968px) {
  .section-title {
    font-size: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 6rem 0 4rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero-tagline {
    font-size: 1.25rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
  
  .btn-group {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .trust-badges {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .trust-badge {
    justify-content: center;
  }
  
  /* Mobile form improvements */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }
  
  .form-disclaimer {
    padding: 0.875rem;
    font-size: 0.8125rem;
  }
  
  /* Improve mobile container spacing */
  .container {
    padding: 0 1rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 1rem;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
