Fix a login form inside a modal so that the Tab key cycles only within the modal and does not escape behind the overlay.
Currently, pressing Tab lets focus leave the modal and move to page elements behind it, which is a WCAG accessibility violation. Trap the focus so it stays within the modal.
Implement a focus trap: on Tab from the last focusable element, wrap to the first; on Shift+Tab from the first, wrap to the last. Also focus the modal on open.
Ensure all interactive elements in the modal are reachable by keyboard and that focus does not escape.
Test Tab and Shift+Tab cycling within the modal without escaping.