12...Nxd4 was correct as you found out. Missing this chance allowed white a clear plus with the d5 pawn.
Black should be just about OK after 18...Bxa3. ...f6 can negate the mate threat, although the weakening of e6 and the whole kingside is worrying in the long-term. 18...Bg7 is the safe way to play, keeping an extra pawn.
22...Bxd5 is a very bad mistake. You should have calculated the sequence up to 25. Rxc3, saw that white can't win back material via queen forks, and given up on that line, since R+2B > Q with extremely few exceptions. 22...Qf5 first, or 22...b4 are preferable.
White was the one winning the endgame. His horde of pieces can guard his king, harass your pawns and deliver strong mating pressure all at once. Advancing your kingside pawns was a bad idea too, since they won't get past white's king and pawns. White then has all the time he needs to get his king to h2, reorganise his pieces and win the queenside pawns/infiltrate the kingside.
The game below is a 15|10 game i won on time but as you'll see i got myself into a lot of trouble and felt like i had to exchange a bunch of peices to scupper his attack.
I could also use some endgame advice aswell because material with hidiously unbalanced and i'm pretty horrible at the endgame inparticular. Thanks.