/* ================================================
Как Google переключатели
================================================ */
.checkbox-google {
    display: inline-block;
    height: 28px;
    line-height: 28px;
    margin-right: 10px;
    position: relative;
    vertical-align: middle;
    font-size: 14px;
    user-select: none;
}
.checkbox-google .checkbox-google-switch {
    display: inline-block;
    width: 36px;
    height: 14px;
    border-radius: 20px;
    position: relative;
    top: 6px;
    vertical-align: top;
    background: #9f9f9f;
    transition: 0.2s;
}
.checkbox-google .checkbox-google-switch:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    position: absolute;
    top: -3px;
    left: -1px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
        0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
    transition: 0.15s;
}
.checkbox-google input[type='checkbox'] {
    display: block;
    width: 0;
    height: 0;
    position: absolute;
    z-index: -1;
    opacity: 0;
}
.checkbox-google input[type='checkbox']:checked + .checkbox-google-switch {
    background: #9abef7;
}
.checkbox-google
    input[type='checkbox']:checked
    + .checkbox-google-switch:before {
    background: #1a73e8;
    transform: translateX(18px);
}

/* Hover */
.checkbox-google
    input[type='checkbox']:not(:disabled)
    + .checkbox-google-switch {
    cursor: pointer;
    border-color: rgba(0, 0, 0, 0.3);
}

/* Active/Focus */
.checkbox-google
    input[type='checkbox']:not(:disabled):active
    + .checkbox-google-switch:before,
.checkbox-google
    input[type='checkbox']:not(:disabled):focus
    + .checkbox-google-switch:before {
    animation: checkbox-active-on 0.5s forwards linear;
}
@keyframes checkbox-active-on {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 212, 212, 0);
    }
    99% {
        box-shadow: 0 0 0 10px rgba(212, 212, 212, 0.5);
    }
}

.checkbox-google
    input[type='checkbox']:not(:disabled):checked:active
    + .checkbox-google-switch:before,
.checkbox-google
    input[type='checkbox']:not(:disabled):checked:focus
    + .checkbox-google-switch:before {
    animation: checkbox-active-off 0.5s forwards linear;
}
@keyframes checkbox-active-off {
    0% {
        box-shadow: 0 0 0 0 rgba(154, 190, 247, 0);
    }
    99% {
        box-shadow: 0 0 0 10px rgba(154, 190, 247, 0.5);
    }
}

/* Disabled */
.checkbox-google input[type='checkbox']:disabled + .checkbox-google-switch {
    filter: grayscale(60%);
    border-color: rgba(0, 0, 0, 0.1);
}
.checkbox-google
    input[type='checkbox']:disabled
    + .checkbox-google-switch:before {
    background: #eee;
}
/*
HTML -----------------
<label class="checkbox-google">
	<input type="checkbox">
	<span class="checkbox-google-switch"></span>
</label>
 
<label class="checkbox-google">
	<input type="checkbox" checked>
	<span class="checkbox-google-switch"></span>
</label>
 
<label class="checkbox-google">
	<input type="checkbox" disabled>
	<span class="checkbox-google-switch"></span>
</label>
 
<label class="checkbox-google">
	<input type="checkbox" checked disabled>
	<span class="checkbox-google-switch"></span>
</label>

*/

/* ================================================
Как в яндексе переключатели
================================================ */
.checkbox-ya {
    display: inline-block;
    height: 28px;
    line-height: 28px;
    margin-right: 10px;
    position: relative;
    vertical-align: middle;
    user-select: none;
}
.checkbox-ya .checkbox-ya-switch {
    display: inline-block;
    box-sizing: border-box;
    width: 76px;
    height: 28px;
    margin: 0 auto;
    position: relative;
    background: linear-gradient(
        90deg,
        #ffeb9d 0%,
        #ffeb9d 50%,
        #e8e9e9 50%,
        #e8e9e9 200%
    );
    background-position: -72px 0;
    background-size: 200% 100%;
    border: 1px solid #bababb;
    border-radius: 3px;
    font-size: 13px;
    color: #000;
    transition: all 150ms ease-in;
}
.checkbox-ya .checkbox-ya-switch:before {
    content: '';
    display: block;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    position: absolute;
    top: 50%;
    left: -1px;
    text-indent: -100%;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transform: translateY(-50%);
    transition: all 150ms ease-in;
}
.checkbox-ya .checkbox-ya-feature {
    position: relative;
    display: block;
    height: 28px;
    line-height: 28px;
    overflow: hidden;
}
.checkbox-ya .checkbox-ya-feature:before,
.checkbox-ya .checkbox-ya-feature:after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: all 150ms ease-in;
}
.checkbox-ya .checkbox-ya-feature:before {
    content: attr(data-label-on);
    left: -60%;
}
.checkbox-ya .checkbox-ya-feature:after {
    content: attr(data-label-off);
    right: 8px;
}
.checkbox-ya input[type='checkbox'] {
    display: block;
    width: 0;
    height: 0;
    position: absolute;
    z-index: -1;
    opacity: 0;
}
.checkbox-ya input[type='checkbox']:checked + .checkbox-ya-switch {
    background-position: 0 0;
    border-color: rgba(153, 122, 0, 0.5);
}
.checkbox-ya input[type='checkbox']:checked + .checkbox-ya-switch:before {
    left: calc(100% - 27px);
}
.checkbox-ya
    input[type='checkbox']:checked
    + .checkbox-ya-switch
    .checkbox-ya-feature:before {
    left: 13px;
}
.checkbox-ya
    input[type='checkbox']:checked
    + .checkbox-ya-switch
    .checkbox-ya-feature:after {
    right: -60%;
}

/* Hover */
.checkbox-ya
    input[type='checkbox']:not(:disabled)
    + .checkbox-ya-switch:hover:before {
    border-color: rgba(0, 0, 0, 0.6);
}
.checkbox-ya input[type='checkbox']:not(:disabled) + .checkbox-ya-switch:hover {
    cursor: pointer;
}

/* Disabled */
.checkbox-ya input[type='checkbox']:disabled + .checkbox-ya-switch {
    border-color: rgba(0, 0, 0, 0.1);
    filter: grayscale(70%);
}
.checkbox-ya
    input[type='checkbox']:disabled
    + .checkbox-ya-switch
    .checkbox-ya-feature {
    color: #999;
}

/* Focus */
.checkbox-ya.focused .checkbox-ya-switch:before {
    border-width: 2px;
    border-color: #ffdb4d;
}
/*
HTML ------------
<label class="checkbox-ya">
	<input type="checkbox">
	<span class="checkbox-ya-switch">
		<span class="checkbox-ya-feature" data-label-on="Вкл" data-label-off="Откл"></span>
	</span>
</label>
 
<label class="checkbox-ya">
	<input type="checkbox" checked>
	<span class="checkbox-ya-switch">
		<span class="checkbox-ya-feature" data-label-on="Вкл" data-label-off="Откл"></span>
	</span>
</label>
 
<label class="checkbox-ya">
	<input type="checkbox" disabled>
	<span class="checkbox-ya-switch">
		<span class="checkbox-ya-feature" data-label-on="Вкл" data-label-off="Откл"></span>
	</span>
</label>
 
<label class="checkbox-ya">
	<input type="checkbox" checked disabled>
	<span class="checkbox-ya-switch">
		<span class="checkbox-ya-feature" data-label-on="Вкл" data-label-off="Откл"></span>
	</span>
</label>

JQuery ----------------
$(window).keyup(function(e){
	var target = $('.checkbox-ya input:focus');
	if (e.keyCode == 9 && $(target).length){
		$(target).parent().addClass('focused');
	}
});
 
$('.checkbox-ya input').focusout(function(){
	$(this).parent().removeClass('focused');
});

*/
