Non-standard character control by Pitch coordinate. The character tilts and moves out of capsule collision.

Hi, in my project I am using a non-standard Pitch coordinate character control, the thing is that instead of camera I am tilting the spine bones of the character. This looks good compared to the normal way of controlling, but brings a few problems that I have no way to solve. The issue is that my character tilts and goes beyond capsule collision. Thus the player can look through walls, which is just awful) I tried to use different ways, such as spring arm or increasing the collision itself. The first option didn’t change anything, and the second option didn’t work for me, because the collision has to be too big for the camera to stop going through the walls. What is the best way to solve the problem? Can I somehow change the collision to a more complex one? Or somehow push the character away from the wall if the player gets too close.