body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  transition: all 0.4s ease-in-out;
  background-color: white;
  color: black;
  transition: background-color 0.4s ease-in-out, color 0.4s ease-in-out;
}

body.dark-mode {
  background-color: black;
  color: white;
}

.input {
  visibility: hidden;
}

.label {
  position: absolute;
  width: 80px;
  height: 35px;
  background-color: lightgray;
  border-radius: 20px;
  cursor: pointer;
}

.circle {
  width: 30px;
  background-color: white;
  height: 30px;
  border-radius: 50%;
  top: 2.5px;
  position: absolute;
  left: 2.5px;
  animation: toggleOff 0.4s linear forwards;
}

.input:checked + .label {
  background-color: white;
}

.input:checked + .label .circle {
  animation: toggleOn 0.4s linear forwards;
  background-color: black;
}

@keyframes toggleOn {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(45px);
  }
}

@keyframes toggleOff {
  0% {
    transform: translateX(45px);
  }
  100% {
    transform: translateX(0);
  }
}
