body{
    margin:0;
    display: flex;
    justify-content: center;
    height: 100vh;
    align-items: center;
    transition: .8s;

}
.input{
    visibility: hidden;
}







.label{
    position: relative;
    width: 80px;
    height: 40px;
    background-color: lightgray;
    border-radius: 20px;
    cursor: pointer;


}
.circle{
    width: 34px;
    background-color: rgb(240, 234, 234);
    height: 34px;
    border-radius: 50%;
    top: 3px;
    position:absolute;
    left: 3px;
    animation: toggleOff 0.4s linear forwards;
}

 /* .circle {
  position: absolute;
  top: 430px;
  left:950px;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  background-color: rgb(238, 233, 233);
  border-radius: 50%;
} */

.input:checked + .label{
    background-color: rgb(241, 237, 236);
}

input:checked + .label .circle{
    animation: toggleOn 0.4s linear forwards;
    background-color: rgb(10, 9, 9);
}

@keyframes toggleOn {
    0%{
        transform: translatex(0);
    }
    100%{
        transform: translatex(40px);
    }
}


@keyframes toggleOff {
    0%{
        transform: translatex(40px);
    }
    100%{
        transform: translatex(0);
    }
}