body {
  margin: 0;
  display: flex;
  justify-content: center;
  height: 100vh;
  align-items: center;
  transition: 1.4s;
}

.input {
  visibility: hidden;
}

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

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

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

.input:checked + .label .circle {
  animation: toggleOn 0.5s linear forwards;
}

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

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