/* Kabera smoke background: a slate-to-amber base with soft coloured clouds and white
   wisps drifting slowly, plus film grain. Shared by the sign-in pages (index.php,
   no_access.php) and the lock screen (js/lock_screen.js).
   Only .k-fog and .fog-* classes, no element styles, so any page can load it.

   Markup:
   <div class="k-fog" aria-hidden="true">
     <span class="fog-blob fog-1"></span><span class="fog-blob fog-2"></span>
     <span class="fog-blob fog-3"></span><span class="fog-blob fog-4"></span>
     <span class="fog-smoke fog-s1"></span><span class="fog-smoke fog-s2"></span>
     <span class="fog-grain"></span>
   </div>
   Put the page content above it (position: relative; z-index: 1). */

.k-fog {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 0% 0%, #2b3350 0%, transparent 55%),
    radial-gradient(90% 80% at 100% 100%, #4a2e12 0%, transparent 60%),
    linear-gradient(160deg, #151a29 0%, #1c2133 45%, #2a2016 100%);
}
/* Coloured clouds: soft-edged gradients that drift and breathe */
.fog-blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}
.fog-1 {
  width: 70vmax; height: 70vmax; left: -22vmax; top: -30vmax;
  background: radial-gradient(circle at 50% 50%, rgba(249, 174, 12, 0.55), rgba(249, 174, 12, 0.18) 40%, transparent 68%);
  animation: fog-drift-1 34s ease-in-out infinite alternate;
}
.fog-2 {
  width: 60vmax; height: 60vmax; right: -20vmax; top: -8vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 106, 61, 0.42), rgba(255, 106, 61, 0.12) 42%, transparent 68%);
  animation: fog-drift-2 41s ease-in-out infinite alternate;
}
.fog-3 {
  width: 75vmax; height: 75vmax; left: -15vmax; bottom: -42vmax;
  background: radial-gradient(circle at 50% 50%, rgba(96, 130, 190, 0.5), rgba(96, 130, 190, 0.14) 42%, transparent 68%);
  animation: fog-drift-3 47s ease-in-out infinite alternate;
}
.fog-4 {
  width: 55vmax; height: 55vmax; right: -12vmax; bottom: -25vmax;
  background: radial-gradient(circle at 50% 50%, rgba(205, 198, 232, 0.32), rgba(205, 198, 232, 0.08) 45%, transparent 68%);
  animation: fog-drift-4 38s ease-in-out infinite alternate;
}
/* White smoke: wide, uneven wisps sliding across */
.fog-smoke {
  position: absolute;
  inset: -25%;
  will-change: transform;
}
.fog-s1 {
  background:
    radial-gradient(ellipse 32% 14% at 18% 62%, rgba(255, 255, 255, 0.13), transparent 70%),
    radial-gradient(ellipse 26% 11% at 44% 70%, rgba(255, 255, 255, 0.09), transparent 70%),
    radial-gradient(ellipse 30% 12% at 72% 38%, rgba(255, 255, 255, 0.11), transparent 70%),
    radial-gradient(ellipse 22% 9% at 88% 58%, rgba(255, 255, 255, 0.08), transparent 70%);
  animation: fog-slide 70s ease-in-out infinite alternate;
}
.fog-s2 {
  background:
    radial-gradient(ellipse 36% 13% at 30% 30%, rgba(255, 236, 200, 0.10), transparent 70%),
    radial-gradient(ellipse 28% 10% at 62% 80%, rgba(255, 255, 255, 0.09), transparent 70%),
    radial-gradient(ellipse 24% 10% at 82% 24%, rgba(255, 236, 200, 0.08), transparent 70%);
  animation: fog-slide-back 95s ease-in-out infinite alternate;
}
/* Film grain so the smoke reads as texture, not flat gradients */
.fog-grain {
  position: absolute;
  inset: 0;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

@keyframes fog-drift-1 { to { transform: translate3d(18vw, 12vh, 0) scale(1.18) rotate(18deg); } }
@keyframes fog-drift-2 { to { transform: translate3d(-16vw, 18vh, 0) scale(0.88) rotate(-14deg); } }
@keyframes fog-drift-3 { to { transform: translate3d(22vw, -14vh, 0) scale(1.12) rotate(10deg); } }
@keyframes fog-drift-4 { to { transform: translate3d(-20vw, -10vh, 0) scale(1.22) rotate(-20deg); } }
@keyframes fog-slide { from { transform: translate3d(-9%, 2%, 0) scale(1.05); } to { transform: translate3d(9%, -3%, 0) scale(1.15); } }
@keyframes fog-slide-back { from { transform: translate3d(8%, -2%, 0) scale(1.1); } to { transform: translate3d(-10%, 3%, 0) scale(1.02); } }

@media (prefers-reduced-motion: reduce) {
  .fog-blob, .fog-smoke { animation: none !important; }
}
