/*
 * Style widżetów formularzy (combobox, kalendarz, pole pliku). Combobox: style wtyczki bootstrap-combobox
 * z poprzedniej wersji.
 */
.has-error .combobox .list-group-item {
    border-color: #a94442;
}
.has-error .combobox .tick-box {
    border-color: #a94442;
}

.combobox .combobox-choices .combobox-choice {
    cursor: pointer;
}
.combobox .combobox-choice-label {
    position: relative;
    top: 4px;
}
.combobox .tick-box {
    width: 25px;
    height: 25px;
    border-radius: 25px;
    /* WCAG 1.4.11: obramowanie kółka wyboru z kontrastem co najmniej 3:1; kolor jak w front.css */
    border: 1px solid var(--a11y-border, #8a8a8a);
    display: inline-block;
}
.combobox .tick-box.tick-box-ticked {
    border: 1px solid var(--a11y-border, #8a8a8a);
    position: relative;
    font-weight: 500;
}
.combobox.has-error .tick-box {
    border: 1px solid #a94442 !important;
}

.combobox .tick-box.tick-box-ticked:before{
    position: absolute;
    content: '';
    top: 5px;
    left: 5px;
    width: 13px;
    height: 13px;
    border-radius: 13px;
    background: #337ab7;
}

.combobox.has-error .tick-box.tick-box-ticked:before{
    background: #a94442;
}

.combobox.has-error .list-group-item{
    border-color: #a94442 !important;
}

/* kalendarz: natywne pole daty pod przyciskiem, niewidoczne (otwiera je showPicker()) */
.input-group.date {
    position: relative;
}
.input-group.date .input-group-addon {
    cursor: pointer;
}
.input-group.date .datepicker-native {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
}

/*
 * Pole „Wybierz plik” (WCAG 2.4.7): pole pliku jest ukryte tylko wizualnie (`sr-only`) wewnątrz etykiety-przycisku,
 * więc fokus z klawiatury pokazuje etykieta: obrys w kolorze marki z odstępem (kontrast z białym tłem ok. 10:1).
 * Myszą i dotykiem bez obrysu (:focus-visible); przeglądarka bez :has() używa :focus-within.
 */
[data-controller="file-input"] > label.btn:has(> input:focus-visible) {
    outline: 3px solid #004577;
    outline-offset: 2px;
}
@supports not selector(:has(*)) {
    [data-controller="file-input"] > label.btn:focus-within {
        outline: 3px solid #004577;
        outline-offset: 2px;
    }
}
