body {
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: darkseagreen;
}

.toggle,
.toggle, .switch {
    position: absolute;
    font-size: 30px; 
    width: 10em;
    height: 5em;
}

.toggle {
    margin: 0;
    visibility: hidden;
}

.toggle ~ .switch {
    cursor: pointer;
    background: linear-gradient(silver, whitesmoke);
    border-radius: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle ~ .switch .inner {
    width: 8em;
    height: 3.5em;
    background: linear-gradient(dimgray, silver);
    border-radius: 2em;
    box-shadow: inset 0 0 1.5em hsla(0, 0%, 0%, 0.5);
    display: flex;
    justify-content: center;
}

.toggle ~ .switch .inner .disc {
    width: 3.5em;
    height: 3.5em;
    background: linear-gradient(to top, silver, whitesmoke);
    border-radius: 50%;
    box-shadow: 0 0.4em 0.6em hsla(0, 0%, 0%, 0.2);
    position: relative;
    left: -2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
}

.toggle ~ .switch .inner .disc::before {
    content: 'OFF';
    position: absolute;
    width: 80%;
    height: 80%;
    background: linear-gradient(silver, whitesmoke);
    border-radius: 50%;
    text-align: center;
    line-height: calc(3.5em * 0.8);
    font-family: sans-serif;
    color: gray;
}

.toggle:checked ~ .switch .inner {
    background: linear-gradient(green, limegreen);
}

.toggle:checked ~ .switch .inner .disc {
    transform: translateX(5em);
}

.toggle:checked ~ .switch .inner .disc::before {
    content: 'ON';
    color: limegreen;
}
