﻿.switch [type="checkbox"] {
    position: absolute;
    left: -9999px;
}

.switch label {
    padding: 15px;
    cursor: pointer;
}

.switch span:last-child {
    position: relative;
    width: 50px;
    height: 26px;
    border-radius: 15px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4);
    background: #cbcbcb;
    transition: all 0.3s;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

    .switch span:last-child::before,
    .switch span:last-child::after {
        content: "";
        position: absolute;
    }

    .switch span:last-child::before {
        left: 1px;
        top: 1px;
        width: 24px;
        height: 24px;
        background: #ffffff;
        border-radius: 50%;
        z-index: 1;
        transition: transform 0.3s;
    }

    .switch span:last-child::after {
        top: 50%;
        right: 8px;
        width: 12px;
        height: 12px;
        transform: translateY(-50%);
        background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/uncheck-switcher.svg);
        background-size: 12px 12px;
    }

.switch [type="checkbox"]:checked + label span:last-child {
    background: #00d084;
}

    .switch [type="checkbox"]:checked + label span:last-child::before {
        transform: translateX(24px);
    }

    .switch [type="checkbox"]:checked + label span:last-child::after {
        width: 14px;
        height: 14px;
        left: 8px;
        background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/checkmark-switcher.svg);
        background-size: 14px 14px;
    }
