/* Shared by authenticated and guest pages, including Livewire-inserted forms.
   Match the group's direction, not a numeric input's explicit dir="ltr".
   Ignore validation messages, hidden inputs and dropdown menus at either end. */
html[dir] .input-group:dir(rtl) > :is(.form-control, .form-select, .input-group-text, .btn):not([hidden]):not(.d-none) {
    border-radius: 0 !important;
    margin-left: 0 !important;
    margin-right: calc(-1 * var(--bs-border-width, 1px)) !important;
}

html[dir] .input-group:dir(rtl) > :nth-child(1 of :is(.form-control, .form-select, .input-group-text, .btn):not([hidden]):not(.d-none)) {
    margin-right: 0 !important;
    border-top-right-radius: var(--bs-border-radius, .375rem) !important;
    border-bottom-right-radius: var(--bs-border-radius, .375rem) !important;
}

html[dir] .input-group:dir(rtl) > :nth-last-child(1 of :is(.form-control, .form-select, .input-group-text, .btn):not([hidden]):not(.d-none)) {
    border-top-left-radius: var(--bs-border-radius, .375rem) !important;
    border-bottom-left-radius: var(--bs-border-radius, .375rem) !important;
}

html[dir] .input-group-sm { --bs-border-radius: var(--bs-border-radius-sm, .25rem); }
html[dir] .input-group-lg { --bs-border-radius: var(--bs-border-radius-lg, .5rem); }

html[dir] .input-group:dir(ltr) > :is(.form-control, .form-select, .input-group-text, .btn):not([hidden]):not(.d-none) {
    border-radius: 0 !important;
    margin-right: 0 !important;
    margin-left: calc(-1 * var(--bs-border-width, 1px)) !important;
}

html[dir] .input-group:dir(ltr) > :nth-child(1 of :is(.form-control, .form-select, .input-group-text, .btn):not([hidden]):not(.d-none)) {
    margin-left: 0 !important;
    border-top-left-radius: var(--bs-border-radius, .375rem) !important;
    border-bottom-left-radius: var(--bs-border-radius, .375rem) !important;
}

html[dir] .input-group:dir(ltr) > :nth-last-child(1 of :is(.form-control, .form-select, .input-group-text, .btn):not([hidden]):not(.d-none)) {
    border-top-right-radius: var(--bs-border-radius, .375rem) !important;
    border-bottom-right-radius: var(--bs-border-radius, .375rem) !important;
}
