body {
  margin: 0;
}

#loader-bg {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  block-size: 100%;
  gap: 1rem 0;
  inline-size: 100%;
}

.loader {
  position: relative;
  inline-size: 60px;
}

.circle {
  position: absolute;
  border: 5px solid #0e3e69;
  border-radius: 50%;
  animation: circles 3s infinite linear;
}

/* Different sizes for each circle */
.inner-circle {
  block-size: 40px;
  inline-size: 40px;
  inset-block-start: 30px;
  inset-inline-start: 30px;
  transform: rotate(45deg);
}

.center-circle-1 {
  block-size: 60px;
  inline-size: 60px;
  inset-block-start: 20px;
  inset-inline-start: 20px;
  transform: rotate(45deg);
}

.center-circle-2 {
  block-size: 80px;
  inline-size: 80px;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  transform: rotate(45deg);
}

.outer-circle {
  block-size: 100px;
  inline-size: 100px;
  transform: rotate(45deg);
}

/* Animation with independent clipping */
@keyframes circles {
  0% {
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0);
  }

  10% {
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0);
  }

  20% {
    clip-path: polygon(50% 50%, 100% 0, 100% 0, 100% 100%, 0 100%, 0 0);
  }

  30% {
    clip-path: polygon(50% 50%, 100% 100%, 100% 100%, 100% 100%, 0 100%, 0 0);
  }

  40% {
    clip-path: polygon(50% 50%, 0 100%, 0 100%, 0 100%, 0 100%, 0 0);
  }

  50% {
    clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0);
  }

  60% {
    clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0);
  }

  70% {
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0);
  }

  80% {
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%);
  }

  90% {
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%);
  }

  100% {
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0);
  }
}
