/* Critical CSS for initial page load optimization */

/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #111827 100%);
  min-height: 100vh;
  color: white;
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Loading spinner styles */
.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Critical hero section styles */
.hero-background {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #111827 100%);
  z-index: -30;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  padding: 1rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  margin-bottom: 2rem;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .hero-title {
    font-size: 4.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 6rem;
  }
  
  .hero-subtitle {
    font-size: 1.875rem;
  }
}

/* Form styles for immediate display */
.signup-form {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-button {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  border: none;
  border-radius: 0.375rem;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

/* Prevent layout shift */
.prevent-layout-shift {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Prevent FOUC and layout shift */
#root {
  min-height: 100vh;
}

/* Loading spinner for code splitting */
.loading-spinner {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #111827 100%);
}

.spinner {
  animation: spin 1s linear infinite;
  border-radius: 50%;
  height: 3rem;
  width: 3rem;
  border: 2px solid transparent;
  border-bottom-color: #f43f5e;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hero section critical styles */
.hero-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #111827 100%);
}

/* Navigation critical styles */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Typography critical styles */
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
  margin-bottom: 1.5rem;
  will-change: transform;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  max-width: 32rem;
  margin: 0 auto 2rem;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  will-change: transform;
}

/* Button critical styles */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: white;
  font-weight: 600;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(244, 63, 94, 0.3);
  will-change: transform;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(244, 63, 94, 0.4);
}

/* Form critical styles */
.signup-form {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 28rem;
  margin: 0 auto;
}

/* Input critical styles */
input, select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 16px; /* Prevent iOS zoom */
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #f43f5e;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.2);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .hero-container {
    padding: 1rem;
  }
  
  .signup-form {
    padding: 1.5rem;
    margin: 0 1rem;
  }
  
  /* Prevent layout shifts on mobile */
  body {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
  }
  
  /* Ensure inputs are tap-friendly */
  input, select, textarea {
    min-height: 48px;
    font-size: 16px !important; /* Prevent zoom */
  }
}

/* Prevent layout shift */
.image-placeholder {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-placeholder::after {
  content: '';
  width: 3rem;
  height: 3rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Performance optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Font loading optimization */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Inter Regular'), local('Inter-Regular');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: local('Playfair Display Black'), local('PlayfairDisplay-Black');
} 