Starting from version 12, Tibia uses a new login system that requires a website with a login.php endpoint — this is what the client calls to authenticate, instead of the old direct login port on the game server. Without it, you will always get the "Login failed / Tibia might be down for maintenance" error.
My recommendation: download Canary 15x+ or Crystal Server 15x+, both already come with the proper setup for this system (MyAAC + login endpoint included), saving you a lot of work.
Avoid OTX — the project is practically abandoned, no updates, and trying to adapt it for newer clients will give you more headaches than it's worth.