I had the same problem. Tried purging and reinstalling lightdm, it fixed the issue for me.
This is what I did:
- During boot-up press shift key repeatedly to go grub options
- Choose latest kernel but with recovery options
- Open cli as root
- Removed lightdm by running apt purge lightdm
- Installed lightdm by running apt install lightdm
- Ran 'lightdm' which brought up the login screen but couldn't use mouse or keyboard. Probably this step was unnecessary.
- Did a hard shutdown and booted up again. Got the login screen okay and I was able to login fine.
I wasn't sure this would work. I had the 24.04 LTS usb ready to start a fresh installation just in case.