/* ============================================
   SEASONAL LOGIN DECORATIONS
   Gentle floating/rotating artwork behind the
   auth card. Pure CSS; honors reduced-motion.
   ============================================ */

.login-bg-seasonal {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.seasonal-deco {
  position: absolute;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: var(--op, 0.7);
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.06));
  animation: seasonal-float var(--dur, 24s) ease-in-out var(--del, 0s) infinite;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes seasonal-float {
  0%, 100% {
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-50%, -50%) translate(14px, -18px) rotate(calc(var(--rot, 6deg) * 0.6));
  }
  50% {
    transform: translate(-50%, -50%) translate(-12px, 14px) rotate(calc(var(--rot, 6deg) * -0.5));
  }
  75% {
    transform: translate(-50%, -50%) translate(10px, 8px) rotate(calc(var(--rot, 6deg) * 0.4));
  }
}

/* Gentle falling drift for small seasonal accents (leaves, snow, confetti) */
.seasonal-deco--fall {
  animation-name: seasonal-fall;
  animation-timing-function: linear;
}

@keyframes seasonal-fall {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-1vw, -32vh) rotate(calc(var(--rot, 14deg) * -0.8));
  }
  15% {
    opacity: var(--op, 0.55);
  }
  50% {
    opacity: var(--op, 0.55);
    transform: translate(-50%, -50%) translate(1.6vw, 0vh) rotate(calc(var(--rot, 14deg) * 0.7));
  }
  85% {
    opacity: var(--op, 0.55);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-0.8vw, 32vh) rotate(calc(var(--rot, 14deg) * -0.4));
  }
}

/* Single continuous flyby: the decoration is anchored at its catalog x/y
   (the trajectory midpoint) and the keyframes carry it from off-screen
   lower-left to off-screen upper-right, so it never rests over the card
   and never appears twice. */
.seasonal-deco--flyby {
  animation-name: seasonal-flyby;
  animation-timing-function: linear;
}

@keyframes seasonal-flyby {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-62vw, 46vh);
  }
  6% {
    opacity: var(--op, 0.8);
  }
  50% {
    transform: translate(-50%, -50%) translate(0vw, -3vh);
  }
  94% {
    opacity: var(--op, 0.8);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(62vw, -52vh);
  }
}

/* Color-cycling twinkling effect for Christmas wreath light overlays:
   pulses brightness/opacity and shifts bulb hues on an independent rhythm
   while staying locked to the parent wreath's float trajectory. */
.seasonal-deco--fx-lights {
  animation:
    seasonal-float var(--dur, 24s) ease-in-out var(--del, 0s) infinite,
    seasonal-lightcycle 5.5s ease-in-out calc(var(--del, 0s) * 0.37) infinite;
}

@keyframes seasonal-lightcycle {
  0%, 100% {
    opacity: var(--op, 0.9);
    filter: hue-rotate(0deg) brightness(1.12);
  }
  25% {
    opacity: calc(var(--op, 0.9) * 0.45);
    filter: hue-rotate(90deg) brightness(0.95);
  }
  50% {
    opacity: var(--op, 0.9);
    filter: hue-rotate(180deg) brightness(1.2);
  }
  75% {
    opacity: calc(var(--op, 0.9) * 0.5);
    filter: hue-rotate(270deg) brightness(1);
  }
}

/* Keep decorations small on narrow screens and fully clear of the card */
@media (max-width: 900px) {
  .seasonal-deco {
    max-width: min(200px, 31vw);
    opacity: calc(var(--op, 0.7) * 0.84);
  }
  .seasonal-deco--fall {
    max-width: min(58px, 12vw);
  }
  .seasonal-deco--flyby {
    max-width: min(240px, 36vw);
  }
}

@media (max-width: 700px) {
  /* the auth card fills nearly the whole viewport - hide the flyby rather
     than let it sweep across the form */
  .seasonal-deco--flyby {
    display: none;
  }
}

@media (max-width: 600px) {
  .seasonal-deco {
    max-width: min(155px, 38vw);
    opacity: calc(var(--op, 0.7) * 0.74);
  }
  .seasonal-deco--fall {
    max-width: min(46px, 12vw);
  }
  /* tuck decorations toward the edges so they never crowd the card */
  .login-bg-seasonal .seasonal-deco:nth-child(odd) {
    margin-left: -4vw;
  }
}

/* Static decorations when the user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .seasonal-deco,
  .seasonal-deco--fx-lights {
    animation: none;
  }
  /* the flyby has no meaningful static rest position - omit it entirely */
  .seasonal-deco--flyby {
    display: none;
  }
}
