.custom-checkbox {
    position: absolute;
    z-index: -1;
    opacity: 0;
    width: 0;
}

.custom-checkbox+label {
    display: inline-flex;
    align-items: center;
    user-select: none;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.custom-checkbox+label::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    flex-grow: 0;
    border: 1px solid #adb5bd;
    background-color: #fff;
    border-radius: 0.25em;
    margin-right: 0.375em;
    background-repeat: no-repeat;
    background-size: 100%;
    transition: box-shadow .125s ease-in-out;
}

.custom-checkbox:checked+label::before {
    border-color: #5e029e;
    border-width: 4px;
    background-color: #5e029e;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
}

.custom-checkbox:not(:disabled):not(:checked)+label:hover::before {
    border-color: #6d00bb;
}

.custom-checkbox:not(:disabled):checked:active+label::before {
    background-color: #b3d7ff;
    border-color: #b3d7ff;
}

.custom-checkbox:disabled+label::before {
    background-color: #e9ecef;
}

.custom-checkbox:disabled+label {
    cursor: default;
}

.custom-radio {
    position: absolute;
    z-index: -1;
    opacity: 0;
}

.custom-radio+label {
    display: inline-flex;
    align-items: center;
    user-select: none;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.custom-radio+label::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    flex-grow: 0;
    border: 1px solid #adb5bd;
    border-radius: 50%;
    margin-right: 0.375em;
    background-repeat: no-repeat;
    background-size: 100%;
    transition: box-shadow .125s ease-in-out;
}

.custom-radio:not(:disabled):not(:checked)+label:hover::before {
    border-color: #b3d7ff;
}

.custom-radio:checked+label::before {
    border-color: #5e029e;
    border-width: 4px;
    background-color: #5e029e;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.custom-radio:disabled+label::before {
    background-color: #e9ecef;
}

.custom-radio:disabled+label {
    cursor: default;
}

@media only screen and (max-width: 767px) {
    .custom-checkbox+label::before {
        width: 18px;
        height: 18px;
    }
}

/* Адаптация fancybox чекбосов под Bootstrap */

.fancy-checkbox {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.fancy-checkbox>label {
    margin-bottom: 0 !important;
}

.theme-cyan .fancy-checkbox input[type="checkbox"]+span:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    flex-grow: 0;
    border: 1px solid #adb5bd;
    background-color: #fff;
    border-radius: 0.25em;
    margin-right: 0.375em;
    background-repeat: no-repeat;
    background-size: 100%;
    transition: box-shadow .125s ease-in-out;
}

.theme-cyan .fancy-checkbox:hover input[type="checkbox"]:not(:disabled):not(:checked)+span:before {
    border-color: #6d00bb;
}

.theme-cyan .fancy-checkbox input[type="checkbox"]:checked+span:before {
    color: #5e029e;
    border-color: #5e029e;
    border-width: 4px;
    background-color: #5e029e;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
    margin-right: 5.25px;
}

.theme-cyan .fancy-checkbox input[type="checkbox"]:disabled+span::before {
    background-color: #e9ecef;
}

.theme-cyan .fancy-checkbox input[type="checkbox"]:disabled+span {
    cursor: default;
}