/* Responsividade final de formularios e barras de acao do SIGCACAMBA. */

:where(form, .card-form, .filter, .gov-filter-panel, .sig-form-section) {
    min-width: 0;
}

:where(form, .card-form, .filter, .gov-filter-panel, .sig-form-section) > .row,
:where(form, .card-form, .filter, .gov-filter-panel, .sig-form-section) .row > [class*="col-"] {
    min-width: 0;
}

:where(.form-control, .form-select, .input-group, .custom-file, .sig-upload, .sig-date-control) {
    max-width: 100%;
}

:where(.input-group, .form-actions, .page-actions, .btn-toolbar) {
    min-width: 0;
}

:where(.form-actions, .page-actions, .btn-toolbar) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

:where(.form-actions, .page-actions, .btn-toolbar) > :where(.btn, button, a, form) {
    min-width: 0;
}

:where(.form-actions, .page-actions, .btn-toolbar) > form > :where(.btn, button) {
    width: 100%;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    :where(form, .card-form, .filter, .gov-filter-panel, .sig-form-section) .row {
        --bs-gutter-x: 1rem;
    }

    :where(.form-actions, .page-actions, .btn-toolbar) > :where(.btn, button, a, form) {
        flex: 0 1 auto;
    }

    :where(.filter, .gov-filter-panel) :where(.btn, button, a[role="button"]) {
        min-height: 44px;
    }
}

@media (max-width: 767.98px) {
    :where(form, .card-form, .filter, .gov-filter-panel, .sig-form-section) .row {
        --bs-gutter-x: 1rem;
    }

    :where(.form-actions, .page-actions, .btn-toolbar),
    :where(.filter, .gov-filter-panel) .row > [class*="col-"]:has(> :where(.btn, button, a.btn)) {
        width: 100%;
        align-items: stretch;
    }

    :where(.form-actions, .page-actions, .btn-toolbar) > :where(.btn, button, a, form),
    :where(.filter, .gov-filter-panel) .row > [class*="col-"]:has(> :where(.btn, button, a.btn)) > :where(.btn, button, a.btn) {
        flex: 1 1 10rem;
    }

    :where(.form-actions, .page-actions, .btn-toolbar) :where(.btn, button, a.btn) {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        white-space: normal;
    }

    .input-group > :where(.form-control, .form-select) {
        min-width: 0;
    }

    .input-group-text {
        padding-inline: .65rem;
        white-space: normal;
    }
}

@media (max-width: 479.98px) {
    :where(.form-actions, .page-actions, .btn-toolbar) > :where(.btn, button, a, form) {
        flex-basis: 100%;
        width: 100%;
    }

    :where(.form-actions, .page-actions, .btn-toolbar) > :where(.btn, button, a),
    :where(.form-actions, .page-actions, .btn-toolbar) > form > :where(.btn, button) {
        width: 100%;
    }
}

@media (forced-colors: active) {
    :where(.form-actions, .page-actions, .btn-toolbar) :where(.btn, button, a.btn) {
        border: 1px solid ButtonText;
    }
}
