/* checkboxToggle */

/* hide the checkbox but keep it tab accessible */
input[type="checkbox"] {
    position: absolute;
    opacity:0 !important;
}

/* toggle container */
input[type="checkbox"] + label {
    display: block;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 0 0px 1px #d5d5d5;
    margin: 0;
    border: 0;
    height: 30px;
    width: 50px;
    border-radius: 15px;
    outline: none;
}

/* bootstrap style focus */
input[type="checkbox"]:focus + label {
    box-shadow: inset 0 0 0 1px #66afe9, 0 0 8px rgba(140,175,233,.6);
}

/* toggle state and toggle switch  */
input[type="checkbox"] + label:before,
input[type="checkbox"] + label:after {
    content: "";
    position: absolute;
    display: block;
    height: 30px;
    width: 30px;
    top: 0;
    left: 0;
    border-radius: 15px;
    -webkit-transition: .25s ease-in-out;
    transition: .25s ease-in-out;
}

/* the toggle state 'off' */
input[type="checkbox"] + label:before {
    background: rgba(51,122,183,0);
}

/* the toggle switch 'off' */
input[type="checkbox"] + label:after {
    background: white;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.2), 0 2px 4px rgba(0,0,0,.2);
}

/* the toggle state 'on' */
input[type="checkbox"]:checked + label:before {
    width: 50px;
    background: rgba(51,122,183,1);
}

/* the toggle switch 'on' */
input[type="checkbox"]:checked + label:after {
    left: 20px;
    box-shadow: inset 0 0 0 1px rgba(51,122,183,1), 0 2px 4px rgba(0,0,0,.2);
}

/* disabled variants */
input[type="checkbox"][disabled] + label,
input[type="checkbox"][readonly] + label {
    cursor: not-allowed;
}
input[type="checkbox"][disabled] + label:before,
input[type="checkbox"][readonly] + label:before {
    background: rgba(221,221,221,0);
}
input[type="checkbox"][disabled]:checked + label:before,
input[type="checkbox"][readonly]:checked + label:before {
    background: #ddd;
}
input[type="checkbox"][disabled]:checked + label:after,
input[type="checkbox"][readonly]:checked + label:after {
    box-shadow: inset 0 0 0 1px #ddd, 0 2px 4px rgba(0,0,0,.2);
}
