.toggle-switch {
    display: inline-block;
    width: 36px;
    height: 20px;
    position: relative;
}

.toggle-switch__helper {
    position: absolute;
    height: 12px;
    width: 100%;

    &:before,
    &:after {
        will-change: left, background-color;
        content: '';
        position: absolute;
        left: 0;
        .transition(all);
        .transition-duration(200ms);
    }

    &:before {
        background-color: @mae-darker;
        top: 4px;
        height: 100%;
        width: 100%;
        border-radius: 10px;
    }

    &:after {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background-color: #7f8e98;
        left: 0;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.12);
        z-index: 1;
    }
}

.toggle-switch__checkbox {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    .opacity(0);
    z-index: 2;
    cursor: pointer;

    &:checked {
        & ~ .toggle-switch__helper{
            &:after {
                left: ~"calc(100% - 20px)";
                background-color: @mae-lighter;
            }

            &:before {
                background-color: rgba(177, 188, 192, 0.2);
            }
        }
    }

    &:disabled {
        & ~ .toggle-switch__helper {
            .opacity(0.65);
        }
    }

    &:active {
        & ~ .toggle-switch__helper:after {
            box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.055);
        }
    }
}