/**
 * Critical CSS - Inlined in HTML head for above-the-fold content
 * This prevents Flash of Unstyled Content (FOUC) and improves First Contentful Paint
 */

/* Base styles */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
  padding: 0;
  background-color: #f9fafb;
  color: #111827;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Prevent horizontal scrolling on mobile */
body, html {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header - Above the fold */
header, nav {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

/* Hero section - Above the fold */
.hero {
  padding: 4rem 1rem;
  text-align: center;
}

.hero h1, .hero h2 {
  font-weight: 700;
  color: #111827;
  margin: 0 0 1.5rem 0;
}

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

@media (min-width: 768px) {
  .hero h1 {
    font-size: 3rem;
    line-height: 1;
  }
}

/* Primary CTA button - Above the fold */
.btn-primary {
  display: inline-block;
  background-color: #2563eb;
  color: #ffffff;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s;
  min-height: 44px;
  min-width: 44px;
}

.btn-primary:hover {
  background-color: #1e40af;
}

/* Mobile-first container */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* Loading state */
.loading {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Ensure images don't overflow */
img {
  max-width: 100%;
  height: auto;
}

/* Form inputs - Mobile optimized */
input, select, textarea, button {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  min-height: 44px;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  width: 100%;
}

button {
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

/* Hide elements that should only show on mobile/desktop */
.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }
  
  .desktop-only {
    display: block;
  }
}
