/* APEX UNICUT — Premium glassmorphism, ambient glow, spring motion */

:root {
  --glass-bg: rgba(26, 21, 38, 0.5);
  --glass-border: rgba(168, 123, 234, 0.15);
  --glass-border-hover: rgba(168, 123, 234, 0.28);
  --glass-blur: 16px;
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 28px rgba(168, 123, 234, 0.12);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --spring-bounce: cubic-bezier(0.34, 1.45, 0.64, 1);
  --spring-soft: cubic-bezier(0.22, 1.2, 0.36, 1);
  --spot-color: rgba(168, 123, 234, 0.22);
  --orb-purple: rgba(168, 85, 247, 0.35);
  --orb-violet: rgba(139, 92, 246, 0.28);
  --orb-magenta: rgba(192, 132, 252, 0.22);
}

[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(168, 85, 247, 0.18);
  --glass-border-hover: rgba(168, 85, 247, 0.32);
  --glass-shadow: 0 4px 24px rgba(20, 16, 24, 0.08);
  --glass-shadow-hover: 0 8px 32px rgba(20, 16, 24, 0.12), 0 0 20px rgba(168, 85, 247, 0.08);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --spot-color: rgba(168, 85, 247, 0.14);
  --orb-purple: rgba(168, 85, 247, 0.12);
  --orb-violet: rgba(139, 92, 246, 0.1);
  --orb-magenta: rgba(192, 132, 252, 0.08);
}

/* ── Glass card base ── */
.glass-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset), var(--glass-shadow);
  transition:
    transform 0.55s var(--spring-bounce),
    border-color 0.4s ease,
    box-shadow 0.45s ease;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-inset), var(--glass-shadow-hover);
  transform: translateY(-4px) scale(1.02);
  will-change: transform;
}

.glass-card.is-featured,
.glass-card.apex-card-featured {
  border-color: rgba(168, 123, 234, 0.35);
  box-shadow: var(--glass-inset), var(--glass-shadow), 0 0 40px rgba(168, 123, 234, 0.1);
}

.glass-card.is-selected {
  border-color: var(--apex-accent, rgba(192, 132, 252, 0.6));
  box-shadow: var(--glass-inset), 0 0 32px rgba(192, 132, 252, 0.2);
}

/* Cursor spotlight layer */
.glass-card-spotlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(
    180px circle at var(--spot-x, 50%) var(--spot-y, 50%),
    var(--spot-color),
    transparent 70%
  );
  transition: opacity 0.45s ease;
}

.glass-card.is-spotlight-active .glass-card-spotlight {
  opacity: 1;
}

.glass-card > *:not(.glass-card-spotlight) {
  position: relative;
  z-index: 1;
}

/* ── Ambient glow orbs ── */
.ambient-glow-wrap {
  position: relative;
  overflow: visible;
}

.ambient-glow-layer {
  position: absolute;
  inset: -80px -40px;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}

.ambient-orb--1 {
  width: 420px;
  height: 420px;
  top: 10%;
  left: -5%;
  background: radial-gradient(circle, var(--orb-purple) 0%, transparent 70%);
  filter: blur(100px);
  animation: ambientFloat1 14s ease-in-out infinite;
}

.ambient-orb--2 {
  width: 360px;
  height: 360px;
  top: 40%;
  right: -8%;
  background: radial-gradient(circle, var(--orb-violet) 0%, transparent 70%);
  filter: blur(90px);
  animation: ambientFloat2 18s ease-in-out infinite;
}

.ambient-orb--3 {
  width: 300px;
  height: 300px;
  bottom: -5%;
  left: 35%;
  background: radial-gradient(circle, var(--orb-magenta) 0%, transparent 70%);
  filter: blur(80px);
  animation: ambientFloat3 16s ease-in-out infinite;
}

@keyframes ambientFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  50% { transform: translate(30px, -20px) scale(1.06); opacity: 1; }
}

@keyframes ambientFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  50% { transform: translate(-25px, 15px) scale(1.05); opacity: 1; }
}

@keyframes ambientFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.75; }
  50% { transform: translate(20px, 25px) scale(1.04); opacity: 0.95; }
}

/* ── Spring entrance ── */
.pricing-entrance {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--spring-soft), transform 0.7s var(--spring-soft);
}

.pricing-entrance.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pricing-entrance:nth-child(1) { transition-delay: 0ms; }
.pricing-entrance-delay-1 { transition-delay: 120ms; }
.pricing-entrance-delay-2 { transition-delay: 240ms; }
.pricing-entrance-delay-3 { transition-delay: 360ms; }

/* Price fade on billing toggle */
.price-is-changing {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .ambient-orb {
    animation: none;
  }

  .glass-card,
  .glass-card:hover,
  .pricing-entrance,
  .price-is-changing {
    transition: none;
    transform: none;
    will-change: auto;
  }

  .glass-card-spotlight {
    display: none;
  }

  .pricing-entrance {
    opacity: 1;
  }

  .pricing-body .apex-reveal,
  .pricing-body .apex-reveal-stagger {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
