/* Auth Orb — WebGL orb backdrop wrapped around the login / register card.
 * Loaded only on the auth pages. Pairs with static/js/orb.js. */

/* Warm radial stage so the orb reads against the milk workspace. */
body.login-page.has-orb {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 38%, hsl(28 60% 97%) 0%, hsl(28 52% 95%) 42%, hsl(24 46% 92%) 100%);
}

.auth-orb {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Nudge the orb center up so it aligns with the card, not the full-page midpoint.
     Footer ~90px on 800px viewport ≈ 11%, so card center sits ~44% from top. */
  transform: translateY(-6%);
  /* CSS fallback shown until WebGL paints (or if it fails entirely). */
  background:
    radial-gradient(closest-side at 50% 50%,
      hsl(16 100% 56% / .26) 0%,
      hsl(22 100% 56% / .16) 38%,
      hsl(28 100% 60% / .06) 60%,
      transparent 72%);
}

.auth-orb canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .6s var(--ease-out-expo, ease);
}

/* Once WebGL is live, drop the CSS placeholder glow and fade the canvas in. */
.auth-orb.is-ready {
  background: none;
}
.auth-orb.is-ready canvas {
  opacity: 1;
}

/* WebGL unavailable: keep the static radial glow visible. */
.auth-orb.is-static {
  background:
    radial-gradient(closest-side at 50% 50%,
      hsl(16 100% 56% / .3) 0%,
      hsl(22 100% 56% / .18) 40%,
      hsl(28 100% 60% / .07) 62%,
      transparent 74%);
}

/* Lift the form above the orb and let the glow wrap its edges. */
body.login-page.has-orb .auth-shell {
  position: relative;
  z-index: 1;
}

body.login-page.has-orb .login-box {
  position: relative;
  background: hsl(30 100% 99% / .82);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-color: hsl(28 60% 88% / .9);
  box-shadow:
    0 0 0 1px hsl(0 0% 100% / .55) inset,
    0 28px 70px -28px hsl(16 90% 28% / .42),
    0 10px 32px -16px hsl(16 100% 50% / .3);
}

/* Soft orange halo radiating from behind the card — the "orb around the form". */
body.login-page.has-orb .login-box::before {
  content: "";
  position: absolute;
  inset: -34px;
  z-index: -1;
  border-radius: calc(var(--radius) + 26px);
  background:
    radial-gradient(80% 80% at 50% 0%, hsl(22 100% 58% / .28), transparent 70%),
    radial-gradient(90% 90% at 50% 100%, hsl(14 100% 52% / .22), transparent 72%);
  filter: blur(26px);
  opacity: .9;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .auth-orb canvas { transition: none; opacity: 1; }
}

@media (max-width: 560px) {
  body.login-page.has-orb .login-box {
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
  }
  body.login-page.has-orb .login-box::before {
    inset: -20px;
    filter: blur(20px);
  }
}
