/* ═══════════════════════════════════════════════════════════════
   Ambient background shared by /login and /register
   ═══════════════════════════════════════════════════════════════ */

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

.ambient-bloom {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(101deg, transparent 6%, rgba(255, 92, 58, 0.16) 11%, transparent 17%),
    linear-gradient(82deg, transparent 40%, rgba(255, 110, 66, 0.11) 45%, transparent 50%),
    linear-gradient(104deg, transparent 70%, rgba(255, 84, 50, 0.15) 76%, transparent 83%),
    radial-gradient(ellipse 55% 45% at 50% 50%, rgba(255, 45, 30, 0.26), rgba(200, 24, 16, 0.1) 45%, transparent 72%);
  animation: ambientBloom 9s ease-in-out infinite alternate;
}

@keyframes ambientBloom {
  from { opacity: 0.72; }
  to   { opacity: 1; }
}

.ambient-embers {
  position: absolute;
  inset: 0;
  display: block;
}

.ambient-embers i {
  position: absolute;
  bottom: -6vh;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ff8a5c;
  box-shadow: 0 0 6px 1px rgba(255, 110, 60, 0.75);
  opacity: 0;
  animation-name: ambientEmber;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

@keyframes ambientEmber {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6); }
  12%  { opacity: 1; }
  75%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate3d(var(--drift, 20px), -78vh, 0) scale(1); }
}

.ambient-embers i:nth-child(1)  { left: 4%;  --drift: 26px;  animation-duration: 15s; animation-delay: 0s; }
.ambient-embers i:nth-child(2)  { left: 11%; --drift: -18px; animation-duration: 19s; animation-delay: 3.4s; width: 2px; height: 2px; }
.ambient-embers i:nth-child(3)  { left: 18%; --drift: 34px;  animation-duration: 13s; animation-delay: 7.1s; }
.ambient-embers i:nth-child(4)  { left: 24%; --drift: -28px; animation-duration: 21s; animation-delay: 1.6s; width: 4px; height: 4px; }
.ambient-embers i:nth-child(5)  { left: 31%; --drift: 16px;  animation-duration: 17s; animation-delay: 9.3s; }
.ambient-embers i:nth-child(6)  { left: 37%; --drift: -36px; animation-duration: 14s; animation-delay: 5.2s; width: 2px; height: 2px; }
.ambient-embers i:nth-child(7)  { left: 43%; --drift: 22px;  animation-duration: 20s; animation-delay: 11.8s; }
.ambient-embers i:nth-child(8)  { left: 49%; --drift: -14px; animation-duration: 16s; animation-delay: 2.7s; }
.ambient-embers i:nth-child(9)  { left: 55%; --drift: 30px;  animation-duration: 22s; animation-delay: 8.4s; width: 4px; height: 4px; }
.ambient-embers i:nth-child(10) { left: 61%; --drift: -24px; animation-duration: 12s; animation-delay: 13.5s; width: 2px; height: 2px; }
.ambient-embers i:nth-child(11) { left: 67%; --drift: 18px;  animation-duration: 18s; animation-delay: 4.1s; }
.ambient-embers i:nth-child(12) { left: 72%; --drift: -32px; animation-duration: 15s; animation-delay: 10.6s; }
.ambient-embers i:nth-child(13) { left: 78%; --drift: 28px;  animation-duration: 23s; animation-delay: 6.3s; width: 4px; height: 4px; }
.ambient-embers i:nth-child(14) { left: 84%; --drift: -20px; animation-duration: 13s; animation-delay: 12.2s; width: 2px; height: 2px; }
.ambient-embers i:nth-child(15) { left: 89%; --drift: 24px;  animation-duration: 19s; animation-delay: 0.8s; }
.ambient-embers i:nth-child(16) { left: 94%; --drift: -26px; animation-duration: 16s; animation-delay: 14.7s; }
.ambient-embers i:nth-child(17) { left: 8%;  --drift: 38px;  animation-duration: 24s; animation-delay: 16.4s; width: 2px; height: 2px; }
.ambient-embers i:nth-child(18) { left: 64%; --drift: -12px; animation-duration: 21s; animation-delay: 18.1s; }

.ambient-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.45) 76%, rgba(0, 0, 0, 0.82) 100%);
}

@media (max-width: 640px) {
  .ambient-embers i:nth-child(n + 11) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-bloom {
    animation: none;
  }

  .ambient-embers {
    display: none;
  }
}
