Senior means first in line. The senior loan is recorded against the property first, and in a foreclosure sale the proceeds pay it off in full, plus its costs, before a single dollar reaches anyone junior. So second position doesn't mean you get half. It means you get whatever is left after the hard money lender is made whole, and in a bad flip that can be nothing.
On the vocabulary: gap funding, strictly, is capital that fills the space between what the senior loan covers and what the deal actually needs, so the down payment, the rehab reserve, or the piece the senior lender won't advance. Bridge lending is the broader term for short-term money carrying a project until it refinances or sells. People use "bridge" loosely for almost any short loan. Mezzanine gets used just as loosely for anything in the middle of the capital stack, but strictly it means debt secured by a pledge of the ownership interests in the entity that owns the property. The lien on the real estate itself stays with the senior lender. If your $40,000 would be a recorded second mortgage, that's a junior lien and not mezz.
The piece people miss at this stage: plenty of hard money notes forbid the borrower from recording any additional lien, and doing it anyway can trigger a default on the senior loan. That's how gap money ends up unsecured or written as an equity slice instead. Ask to see the senior term sheet and its additional-indebtedness language before you commit, and have a lawyer in the state where the property sits handle your paperwork, since recording practice and foreclosure timelines differ by state.