:root {
  --bootstrap-loader-bg: #fbfcfd;
  --bootstrap-loader-face-1: #0f172a;
  --bootstrap-loader-face-2: rgba(15, 23, 42, 0.85);
  --bootstrap-loader-face-3: rgba(15, 23, 42, 0.7);
  --bootstrap-loader-face-4: rgba(15, 23, 42, 0.15);
}

body {
  margin: 0;
}

#bootstrap-loader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bootstrap-loader-bg);
  z-index: 2147483647;
}

#bootstrap-loader-message {
  position: absolute;
  top: calc(50% + 80px);
  left: 50%;
  transform: translateX(-50%);
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--bootstrap-loader-face-1);
  opacity: 0.8;
  letter-spacing: 0.2px;
  text-align: center;
  width: min(520px, calc(100vw - 32px));
  user-select: none;
}

#bootstrap-loader .boxes {
  --size: 32px;
  --duration: 800ms;
  height: calc(var(--size) * 2);
  width: calc(var(--size) * 3);
  position: relative;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  margin-top: calc(var(--size) * 1.5 * -1);
  transform: rotateX(60deg) rotateZ(45deg) rotateY(0deg) translateZ(0px);
}

#bootstrap-loader .boxes .box {
  width: var(--size);
  height: var(--size);
  top: 0;
  left: 0;
  position: absolute;
  transform-style: preserve-3d;
}

#bootstrap-loader .boxes .box:nth-child(1) {
  transform: translate(100%, 0);
  animation: bootstrap-box1 var(--duration) linear infinite;
}

#bootstrap-loader .boxes .box:nth-child(2) {
  transform: translate(0, 100%);
  animation: bootstrap-box2 var(--duration) linear infinite;
}

#bootstrap-loader .boxes .box:nth-child(3) {
  transform: translate(100%, 100%);
  animation: bootstrap-box3 var(--duration) linear infinite;
}

#bootstrap-loader .boxes .box:nth-child(4) {
  transform: translate(200%, 0);
  animation: bootstrap-box4 var(--duration) linear infinite;
}

#bootstrap-loader .boxes .box > div {
  --background: var(--bootstrap-loader-face-1);
  --top: auto;
  --right: auto;
  --bottom: auto;
  --left: auto;
  --translateZ: calc(var(--size) / 2);
  --rotateY: 0deg;
  --rotateX: 0deg;
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--background);
  top: var(--top);
  right: var(--right);
  bottom: var(--bottom);
  left: var(--left);
  transform: rotateY(var(--rotateY)) rotateX(var(--rotateX)) translateZ(var(--translateZ));
}

#bootstrap-loader .boxes .box > div:nth-child(1) {
  --top: 0;
  --left: 0;
}

#bootstrap-loader .boxes .box > div:nth-child(2) {
  --background: var(--bootstrap-loader-face-2);
  --right: 0;
  --rotateY: 90deg;
}

#bootstrap-loader .boxes .box > div:nth-child(3) {
  --background: var(--bootstrap-loader-face-3);
  --rotateX: -90deg;
}

#bootstrap-loader .boxes .box > div:nth-child(4) {
  --background: var(--bootstrap-loader-face-4);
  --top: 0;
  --left: 0;
  --translateZ: calc(var(--size) * 3 * -1);
}

@keyframes bootstrap-box1 {
  0%,
  50% {
    transform: translate(100%, 0);
  }

  100% {
    transform: translate(200%, 0);
  }
}

@keyframes bootstrap-box2 {
  0% {
    transform: translate(0, 100%);
  }

  50% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(100%, 0);
  }
}

@keyframes bootstrap-box3 {
  0%,
  50% {
    transform: translate(100%, 100%);
  }

  100% {
    transform: translate(0, 100%);
  }
}

@keyframes bootstrap-box4 {
  0% {
    transform: translate(200%, 0);
  }

  50% {
    transform: translate(200%, 100%);
  }

  100% {
    transform: translate(100%, 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  #bootstrap-loader .boxes .box {
    animation: none !important;
  }
}
