body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

input {
    visibility: hidden;
}

.label {
    height: 50px;
    width: 100px;
    border-radius: 100px;
    background-color: black;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.circle{
    height: 40px;
    width: 40px;
    border-radius: 50%;
    left: 5px;
    position: relative;
    background-color: white;
    animation: toggleOff 0.3s linear forwards;
}

.input:checked + .label {
    background-color: white;
}

.input:checked + .label .circle {
    animation: toggleOn 0.3s linear forwards;
    background-color: white;
}

img {
    width: 24px;
    height: 24px;
    margin-top: 8px;
    margin-left: 7px;
}

@keyframes toggleOn {
    0% {
        transform: translateX(0);
        background-color: white;
    }
    100% {
        transform: translateX(50px);
        background-color: black;
    } 
}

@keyframes toggleOff {
    0% {
        transform: translateX(50px);
    }
    100% {
        transform: translateX(0);
    }  
}