Dehydration of carboxylic acids with phosphoric acid To find Z one must find X. Finding Y is of no use to find Z.

I get X as: 



After addition of $\ce{H2/Pd-C}$, the unsaturated portion becomes saturated and the carboxylic acid remains unchanged.

However I am unsure what does $\ce{H3PO4}$ do to this (new) carboxylic acid? I was unable to find any information. I did find information regarding dehydration with $\ce{P2O5}$, but unsure what to make use out of it.

After looking at (unofficial/3rd party) solutions, I saw that $\ce{H3PO4}$ protonates the $\ce{-OH}$ part of the carboxylic acid (since it is a much stronger acid than the organic acid?) then $\ce{H2O}$ leaves, rendering a carbo-cation at the carbonyl carbon, followed by EAS at the ring.

However, I do not see how $\ce{H3PO4}$ exactly works with the carboxylic acid. I have merely guessed that the $\ce{-OH}$ portion gets protonated (since, this was the only thing I predicted would happen). I really do not know why this happens and how it happens. 

Hints and reference material or examples would be appreciated.

The original question is taken from the JEE (Advanced) [2018] Paper-1.
The $\ce{-OH}$ part will not get protonated, since its lone pair is in resonance with the carbonyl part of the $\ce{-COOH}$ group. Instead, the lone pair of the carbonyl part will give its lone pair to $\ce{H+}$. 

Something like this :-



It may look insignificant because the product is same, but this is the correct mechanism.