All major browser have support for the :user-invalid
pseudo class since 2023.
It sounds exactly like what you are looking for:
The
:user-invalid
CSS pseudo-class represents any validated form element whose value isn't valid based on their validation constraints, after the user has interacted with it.