/* Critical styles to prevent flash of unstyled content */
html {
  visibility: hidden;
  opacity: 0;
}

html.fonts-loaded {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/* Loading screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* Ensure WhatsApp button is always visible */
.whatsapp-floating-container {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
}

.whatsapp-floating-btn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 64px !important;
  height: 64px !important;
  background: #25d366 !important;
  border-radius: 50% !important;
  border: none !important;
  cursor: pointer !important;
}

/* Emergency test button - always visible */
.test-whatsapp-btn {
  position: fixed !important;
  bottom: 100px !important;
  right: 24px !important;
  z-index: 99999 !important;
  width: 64px !important;
  height: 64px !important;
  background: #ff4444 !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: white !important;
  font-size: 24px !important;
  border: none !important;
}

.loading-screen.hide {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Critical layout styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f8fafc;
  padding-top: 120px;
}

.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: #1e3a8a;
  padding: 2.5rem 1.5rem;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 768px) {
  body {
    padding-top: 90px;
  }

  .header {
    padding: 1.8rem 2rem;
  }
}
