.checkbox-dark {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    user-select: none;
    height: 2rem;
    border-radius: 2rem;
    border: 1px solid #888;
    overflow: hidden;
    line-height: 2rem;
    font-size: 0.7rem;
}
.checkbox-dark .checkbox-dark-switch {
    display: inline-block;
    height: 100%;
    min-width: 2rem;
    box-sizing: border-box;
    position: relative;
    background: #525151;
    transition: background-color 0.3s cubic-bezier(0, 1, 0.5, 1);
}
.checkbox-dark .checkbox-dark-switch:before {
    content: attr(data-label-on);
    display: inline-block;
    box-sizing: border-box;
    position: absolute;
    width: 50%;
    height: 100%;
    top: 0;
    left: 50%;
    text-align: center;
    vertical-align: middle;
    color: #fff;
}
.checkbox-dark .checkbox-dark-switch:after {
    content: attr(data-label-off);
    display: inline-block;
    box-sizing: border-box;
    position: absolute;
    width: 50%;
    height: 100%;
    top: 0;
    text-align: center;
    vertical-align: middle;
    background: #fff;
    color: #525151;
    transition: transform 0.3s cubic-bezier(0, 1, 0.5, 1);
    z-index: 5;
}
.checkbox-dark input[type="checkbox"] {
    display: block;
    width: 0;
    height: 0;
    position: absolute;
    z-index: -1;
    opacity: 0;
}
.checkbox-dark input[type="checkbox"]:checked + .checkbox-dark-switch {
    background-color: #515560;
}
.checkbox-dark input[type="checkbox"]:checked + .checkbox-dark-switch:before {
    content: attr(data-label-off);
    left: 0;
}
.checkbox-dark input[type="checkbox"]:checked + .checkbox-dark-switch:after {
    content: attr(data-label-on);
    color: #000;
    transform: translate3d(100%, 0, 0);
}

/* Hover */
.checkbox-dark input[type="checkbox"]:not(:disabled) + .checkbox-dark-switch:hover {
    cursor: pointer;
}
.checkbox-dark input[type="checkbox"]:not(:disabled) + .checkbox-dark-switch:hover:after {
    box-shadow: 0 3px 3px rgba(0, 0, 0, 0.4);
}

/* Disabled */
.checkbox-dark input[type=checkbox]:disabled + .checkbox-dark-switch {
    opacity: 0.6;
    filter: grayscale(50%);
}

/* Focus */
.checkbox-dark.focused .checkbox-dark-switch:after {
    box-shadow: inset 0px 0px 4px #ff5623;
}
