/* =====================================================================
   Shree Gauri Mataji Devasthan Trust — Devotee Registration Form
   ---------------------------------------------------------------------
   All custom CSS lives here. Tailwind (CDN) handles the utility classes;
   this file contains typography, theming, decorative temple styles,
   buttons, loaders and animations.
   ===================================================================== */

/* =========================================
   1. CUSTOM TYPOGRAPHY
========================================= */
body {
  font-family: 'Noto Sans Gujarati', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.font-devotional {
  font-family: 'Noto Serif Gujarati', 'Yatra One', serif;
}

/* =========================================
   2. THEME — LIGHT & DARK BACKGROUND LAYERS
========================================= */
html.dark body {
  background: #140a05 radial-gradient(#3a1b0a 1px, transparent 1px);
  background-size: 24px 24px;
  color: #f7ede2;
}

html:not(.dark) body {
  background: #fbf6ee radial-gradient(#e8dac5 1px, transparent 1px);
  background-size: 24px 24px;
  color: #2e1d15;
}

/* =========================================
   3. DECORATIVE ACCENTS — SACRED BORDER & TEMPLE ARCH
========================================= */
.sacred-border {
  border: 1.5px solid rgba(205, 161, 53, 0.45);
  transition: all 0.3s ease;
}

html.dark .sacred-border {
  border-color: rgba(205, 161, 53, 0.38);
  background: #1a0e08;
}

html:not(.dark) .sacred-border {
  border-color: rgba(205, 161, 53, 0.4);
  background: #ffffff;
}

.temple-arch-frame {
  border-radius: 9999px 9999px 1rem 1rem;
  border: 2.5px solid #d4af37;
  box-shadow: 0 4px 18px rgba(185, 40, 11, 0.18), 0 0 14px rgba(212, 175, 55, 0.45);
}

/* =========================================
   4. SUBMIT BUTTON (exact reference styling)
========================================= */
.btn-submit-exact {
  background: linear-gradient(90deg, #d93800 0%, #eb4e06 50%, #c42600 100%);
  border: 1px solid rgba(255, 140, 60, 0.45);
  box-shadow: 0 8px 24px -4px rgba(217, 56, 0, 0.5), 0 0 20px rgba(235, 78, 6, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-submit-exact:hover:not(:disabled) {
  background: linear-gradient(90deg, #e34005 0%, #f45b12 50%, #cf2d05 100%);
  box-shadow: 0 10px 28px -2px rgba(235, 78, 6, 0.65), 0 0 26px rgba(244, 91, 18, 0.45);
  transform: translateY(-1px);
}

.btn-submit-exact:active:not(:disabled) {
  transform: translateY(1px) scale(0.995);
}

.btn-submit-exact:disabled {
  cursor: not-allowed;
  opacity: 0.92;
  box-shadow: 0 4px 15px rgba(217, 56, 0, 0.3);
}

/* =========================================
   5. INITIAL PAGE LOADER (#page-loader)
   Used ONLY for the initial page load.
   Form submission uses #submit-loader instead.
========================================= */
#page-loader {
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

#page-loader.loader-fade-out {
  opacity: 0;
  pointer-events: none;
}

/* =========================================
   6. SHARED ANIMATIONS
========================================= */
@keyframes divine-spin-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.animate-spin-reverse {
  animation: divine-spin-reverse 12s linear infinite;
}

@keyframes golden-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.08); }
}

.animate-golden-pulse {
  animation: golden-pulse 2.8s ease-in-out infinite;
}

@keyframes flame-glow {
  0%, 100% { transform: translateY(0px) scale(1); filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.8)); }
  50% { transform: translateY(-2px) scale(1.05); filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.95)); }
}

.animate-flame {
  animation: flame-glow 2s ease-in-out infinite;
}

@keyframes scale-in-bounce {
  0% { opacity: 0; transform: scale(0.65); }
  60% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

.animate-scale-bounce {
  animation: scale-in-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* =========================================
   7. SEPARATE SUBMIT LOADER (#submit-loader)
   Dedicated overlay for form submission.
   Display is toggled by script.js via the
   Tailwind `hidden` / `flex` classes, so only
   opacity behaviour is defined here.
========================================= */
#submit-loader {
  opacity: 1;
  transition: opacity 300ms ease;
}

#submit-loader.submit-loader-hide {
  opacity: 0;
  pointer-events: none;
}

/* =========================================
   8. ACCESSIBILITY — REDUCED MOTION
========================================= */
@media (prefers-reduced-motion: reduce) {
  .animate-spin,
  .animate-spin-reverse,
  .animate-golden-pulse,
  .animate-flame,
  .animate-pulse,
  .animate-scale-bounce {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
