/* custom properties (AKA css variables) */
.si {
    --color-label: #333;
    --color-default: #dee5f2;
    --color-active: #009ee0;
    --color-red: #e2007a;
    --rotate-default: 180deg;
    --rotate-active: 40deg;
    --border-size-checkmark: 2px;
    --border-size-box: 1px;
    --input-size: 20px;
    --guter: 15px;
}

/* basic reset */
.si,
.si *,
.si *::before,
.si *::after {
    box-sizing: border-box;
}

/* label */
.si {
    cursor: pointer;
    position: relative;
}

.si .si-label {
    display: inline-block;
    padding-left: var(--guter);
    color: var(--color-label);
    vertical-align: text-top;
}
.si > input { display: none; }
.si > input[type="checkbox"],
.si > input[type="radio"] {
    clip-path: polygon(0 0);
}
/* change property values smoothly */
.si .si-label::before,
.si .si-label::after {
    transition: all 0.2s ease-in-out;
}

/* an element for both checkbox and radio */
.si .si-label::before {
    content: '';
    display: block;
    width: var(--input-size);
    height: var(--input-size);
    border: var(--border-size-box) solid var(--color-default);
    position: absolute;
    top: -3px;
    left: 0;
    transform: rotate(0deg) scale(1);
}

/* feedback when the user interacts with an element */
.si .si-label:hover::before {
    border-color: var(--color-active);
}




/* switcher label gutter */
.si.si-switcher .si-label {
    padding-left: 45px;
}

/* switcher rounded rectangle */
.si.si-switcher .si-label::before {
    content: '';
    width: 36px;
    height: 20px;
    border-radius: 20px;
    top: 2px;
}

/* switcher bullet */
.si.si-switcher .si-label::after {
    content: '';
    border-radius: 50%;
    width: 12px;
    height: 12px;
    background-color: var(--color-red);
    position: absolute;
    top: 6px;
    left: 4px;
}
.si.si-switcher > input:checked + .si-label::before {
    background-color: var(--color-active);
    border-color: var(--color-active);
}

.si.si-switcher > input:checked + .si-label::after {
    background-color: #fff;
    left: 20px;
}




.switch-field {
    display: flex;
    overflow: hidden;
}

.switch-field input {
    position: absolute !important;
    clip: rect(0, 0, 0, 0);
    height: 0px;
    width: 0px;
    border: 0;
    overflow: hidden;
}

.switch-field label {
    background-color: #e4e4e4;
    color: rgba(0, 0, 0, 0.6);
    font-size: 14px;
    line-height: 1;
    text-align: center;
    padding: 8px 16px;
    margin-right: -1px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.1s ease-in-out;
}

.switch-field label:hover {
    cursor: pointer;
}

.switch-field input:checked + label {
    background-color: #0072BB;
    color: #fff;
    box-shadow: none;
}

.switch-field label:first-of-type {
    border-radius: 4px 0 0 4px;
}

.switch-field label:last-of-type {
    border-radius: 0 4px 4px 0;
}