/* ── Eternal loader ────────────────────────────────────────────
   The one loading animation for every eternal.uz service. The same file
   lives in root, plans, home, authentication and private-ai; a test
   (plans/tests/test_loader_copies.py) fails if any copy drifts. Edit the
   root copy, then copy it over the others. */
#loader {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(1vh);
  background-color: #333;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: all;
  transition:
    opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
    backdrop-filter 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

#loader.fading {
  opacity: 0;
  backdrop-filter: blur(0px);
  pointer-events: none;
}

#loader.gone {
  display: none;
}

/* ── Base style for all sections inside loader ──────────────── */
#loader section {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 6px solid #a78247;
  overflow: hidden;
}
#loader section:before,
#loader section:after {
  content: "";
  display: block;
  position: absolute;
}

/* ── Trademark label ─────────────────────────────────────────── */
#loader .trademark {
  font-family: "Poppins", sans-serif;
  font-size: 20px;
  color: #a78247;
  position: relative;
  top: 100%;
  text-align: center;
}

/* ── Wrapper — no border, overflow visible ───────────────────── */
/* specificity 110 beats #loader section at 101 */
#loader .wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1200px;
  height: 400px;
  border: 0 !important;
  transform: translate(-50%, -50%);
  overflow: visible !important;
}

/* ── Planet icon — 180×180px ─────────────────────────────────── */
#loader .wrapper .icon {
  position: relative;
  display: inline-block;
  width: 180px;
  height: 180px;
  margin: 20px 20px;
  border: 0 !important;
  overflow: visible !important;
  top: calc(50% - 20px);
  left: calc(50% - 20px);
  transform: translate(-50%, -50%);
}

#loader .wrapper .icon .planetoid,
#loader .wrapper .icon .planet {
  border-radius: 50%;
  background: #303030;
}

/* The moon's orbit is a transform, so it keeps moving while the page
   behind the loader is busy — on the kingdom pages the pictures are drawn
   during exactly this time, and animating top/left (layout, on the main
   thread) froze the moon at every stall. The path is the old one: 15%→80%
   down and 90%→5% across a 180px icon is (−153px, +117px). The pass behind
   the planet is a second animation, so the first stays on the compositor. */
#loader .wrapper .icon.icon2 .planetoid {
  top: 15%;
  left: 90%;
  width: 10%;
  height: 10%;
  overflow: visible !important;
  animation: icon2planetoid 5s linear 0s infinite, icon2planetoidPass 5s linear 0s infinite;
}
#loader .wrapper .icon.icon2 .planetoid:after {
  top: -35%;
  left: -35%;
  width: 1%;
  height: 1%;
  border: 3px solid #a78247;
  border-radius: 50%;
}
#loader .wrapper .icon.icon2 .planet {
  top: 20%;
  left: 17%;
  width: 63%;
  height: 63%;
}
#loader .wrapper .icon.icon2 .planet:after {
  top: 10%;
  left: 10%;
  width: 70%;
  height: 70%;
  border: 5px solid #a78247;
  border-radius: 50%;
  border-color: #a78247 transparent transparent transparent;
  transform: rotate(-50deg);
}
#loader .wrapper .icon.icon2 .ring-planet {
  top: 40%;
  left: 10%;
  width: 77.5%;
  height: 25%;
  border-radius: 50%;
  border-color: transparent #a78247 #a78247 #a78247;
  transform: rotate(-17deg);
  animation: icon2ring 5s linear 0s alternate infinite;
}

@keyframes icon2planetoid {
  0%   { transform: translate(0, 0) rotate(0deg); }
  49%  { transform: translate(-153px, 117px) rotate(720deg); }
  50%  { transform: translate(-153px, 117px) rotate(720deg); }
  99%  { transform: translate(0, 0) rotate(1440deg); }
  100% { transform: translate(0, 0) rotate(1440deg); }
}
@keyframes icon2planetoidPass {
  0%, 49.99% { z-index: 0; }
  50%, 99.99% { z-index: 1; }
  100% { z-index: 0; }
}
@keyframes icon2ring {
  0%   { transform: rotate(-10deg); }
  100% { transform: rotate(-30deg); }
}
