body
{

    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;

    
}

input[type="checkbox"]
{

    -webkit-appearance: none;
    visibility: hidden;
    display: none;

}

.check
{
    position: relative;
    display: block;
    width: 40px;
    height: 20px;
    background: grey;
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
    transition: step-end 0.5s;
}

input[type="checkbox"]:checked ~ .check
{
    background: darkgrey;
    box-shadow: 0 0 0 1200px rgb(58, 57, 57);

}

.check:before
{
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    background:rgb(46, 46, 46);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: 0.5s;

}

input[type="checkbox"]:checked ~ .check:before
{
    transform: translateX(-50px);
}

.check:after
{
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    background: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: 0.5s;
    transform: translateX(50px);

}

input[type="checkbox"]:checked ~ .check:after
{
    transform: translateX(0px);
}