@op_ultra have a look at https://github.com/Yubico/yubico-pam it appears to be packaged for Debian 12 too, though repology shows an older version and I cannot find the changelog :) so it's up to you to dig around ;)
OTOH I'm not really sure about the log in thing, especially if it's relatively common to leave the Yubikey pluggedin almost all the time :D
ps: I use it for `sudo` on remote servers