/* ============================================
   SolaireSim - Custom Styles
   State-of-the-art Lead Generation CSS 2026
   ============================================ */

/* Smooth scroll with reduced motion support */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 3px solid #F59E0B;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection color */
::selection {
  background-color: #FDE68A;
  color: #92400E;
}

/* Loader animation */
.loader {
  width: 48px;
  height: 48px;
  border: 4px solid #E5E7EB;
  border-bottom-color: #F59E0B;
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}

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

/* Header shadow on scroll */
.header-scrolled {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Form step transitions */
.form-step {
  animation: fadeSlideIn 0.3s ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Step indicator transition */
.step-indicator {
  transition: all 0.3s ease;
}

.step-indicator.active {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.step-indicator.completed {
  background-color: #10B981;
  color: white;
}

.step-line.active {
  background-color: #F59E0B;
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: #E5E7EB;
  border-radius: 9999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: #F59E0B;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #F59E0B;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

/* FAQ toggle animation */
.faq-toggle svg {
  transition: transform 0.2s ease;
}

.faq-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.faq-content {
  animation: faqOpen 0.2s ease-out;
}

@keyframes faqOpen {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

/* Modal animations */
#quote-modal.visible,
#exit-modal.visible {
  opacity: 1;
}

#quote-modal.visible #modal-content,
#exit-modal.visible > div {
  transform: scale(1);
}

/* Counter animation */
.counter {
  font-variant-numeric: tabular-nums;
}

/* CTA pulse effect */
.cta-button {
  position: relative;
}

.cta-button::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  opacity: 0;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  transition: opacity 0.3s ease;
}

.cta-button:hover::after {
  animation: ctaPulse 1.5s ease-out;
}

@keyframes ctaPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
    opacity: 0;
  }
}

/* Toast notification */
.toast {
  animation: toastIn 0.3s ease-out;
}

.toast.removing {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* Result card entrance */
#result {
  animation: resultReveal 0.5s ease-out;
}

@keyframes resultReveal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Urgency banner close animation */
#urgency-banner.closing {
  animation: slideUp 0.3s ease-in forwards;
}

@keyframes slideUp {
  to {
    transform: translateY(-100%);
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
}

/* Mobile CTA slide up */
#mobile-cta {
  animation: slideFromBottom 0.3s ease-out;
}

@keyframes slideFromBottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Scroll top button */
#scroll-top {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#scroll-top:hover {
  transform: translateY(-2px);
}

/* Projection table rows */
#savings-projection tr {
  transition: background-color 0.15s ease;
}

#savings-projection tr:hover {
  background-color: #F0FDF4;
}

/* WhatsApp floating button pulse */
#whatsapp-float {
  animation: waFloat 2s ease-in-out infinite;
}

@keyframes waFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

#whatsapp-float::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.3);
  animation: waPulse 2s ease-out infinite;
}

@keyframes waPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Print styles */
@media print {
  header, footer, #urgency-banner, #mobile-cta, #scroll-top,
  #exit-modal, #quote-modal, .cta-button, button {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  #result {
    display: block !important;
  }
}
