/* Coursecado Smart Preloader - alignment-safe fullscreen overlay */
#csp-preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1000px 600px at 50% 40%, rgba(56,189,248,0.08), rgba(15,23,42,0.96)),
              #0f172a;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity .45s ease, visibility .45s ease;
  opacity: 1;
  visibility: visible;
}

/* Hide animation */
#csp-preloader.csp-hide {
  opacity: 0;
  visibility: hidden;
}

/* Logo + animation */
.csp-logo-wrap {
  position: relative;
  width: 84px;
  height: 84px;
}

/* Pulsing orb */
.csp-orb {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: linear-gradient(145deg, #38bdf8, #3b82f6);
  animation: csp-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(56,189,248,0.45), inset 0 0 20px rgba(255,255,255,0.15);
}

/* Spinning ring */
.csp-ring {
  position: absolute;
  inset: -10px;
  border-radius: 9999px;
  border: 3px solid rgba(226,232,240,0.15);
  border-top-color: #38bdf8;
  border-right-color: rgba(226,232,240,0.35);
  animation: csp-spin 1.2s linear infinite;
  mix-blend-mode: screen;
}

.csp-text {
  margin-top: 16px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: .3px;
  color: #e2e8f0;
  opacity: .9;
  text-align: center;
}

/* Reduced Motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
  .csp-orb, .csp-ring { animation: none !important; }
}

/* Keyframes */
@keyframes csp-spin { to { transform: rotate(360deg); } }
@keyframes csp-pulse {
  0%, 100% { transform: scale(1);   opacity: .85; }
  50%      { transform: scale(1.12); opacity: 1; }
}

/* Prevent scroll-jump without locking layout */
html.csp-lock, body.csp-lock {
  overflow: hidden;
}
