:root {
    --switch-off-color: var(--white);
    --switch-on-color: var(--red);
    --slider-color: var(--apple-green);
    --slider-transition: .4s;
    --switch-width: 76px;
    --switch-height: 28px;
    --slider-width: calc(var(--switch-width) / 2 + 2px);
    --slider-height: calc(var(--switch-height) + 2px);
    --slider-translate: calc(var(--switch-width) - var(--slider-width) + 2px);
}

.switch {
    position: relative;
    display: inline-block;
    width: var(--switch-width);
    height: var(--switch-height);
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--switch-off-color);
    transition: var(--slider-transition);
}

.slider:before {
    position: absolute;
    content: "";
    top: -1px;
    left: -1px;
    height: var(--slider-height);
    width: var(--slider-width);
    background-color: var(--slider-color);
    transition: var(--slider-transition);
}

input:checked + .slider {
    background-color: var(--switch-on-color);
}

input:checked + .slider:before {
    transform: translateX(var(--slider-translate));
}

.slider.round,
.slider.round:before {
    border-radius: 16px;
}