
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: grid;
    height: 100vh;
    place-items: center;
    background: #2b2b2b;
}

.checkbox {
    height : 160px;
    width: 320px;
    border-radius: 160px;
    background: #222;
    appearance: none;
    box-shadow: inset 0 8px 60px rgba(0, 0, 0, 0.2),
                inset 0 8px 8px rgba(0, 0, 0, 0.2),
                inset 0 -4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    outline: none;
    cursor: pointer;
    transition: 0.5s;
            
}

.checkbox::before{
    height: 160px;
    width: 160px;
    position: absolute;
    top: 0;
    left: 0;
    content : "";
    background: linear-gradient(to bottom , #444, #222);
    border-radius: 160px;
    transform: scale(0.9);
    transition: 0.5s;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5)
                inset 4px 4px rgba(255,255,255,0.2),
                inset -4px 4px rgba(255,255,255,0.2);
}

.checkbox:checked{
    background: #fff;
    box-shadow: inset 0 2px 60px rgba(0, 0, 0, 0.1)
                inset 0 2px 8px rgba(0,0,0,0.1),
                inset 0 -4px 4px rgba(0,0,0,0.5);
}

.checkbox:checked::before{
    left: 160px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1),
                inset 4px 4px rgba(255,255,255,0.2),
                inset -4px 4px rgba(255,255,255,0.2);
    background: linear-gradient(to bottom ,#eaeaea,#f9f9f9 );
    
}
.checkbox::after{
    content: "";
    position: absolute;
    height: 100vh;
    width: 100vw;
    background: #2b2b2b;
    top: 80px;
    left: 160px;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: 0.5s;
}

.checkbox:checked::after{
    background: #fff;
}

