Definitely not a pied wagtail! Turnstone sounds likely. They have red legs and hang around piers and jetties occasionally, though more often they are picking around in seaweed and mussel beds or in mud.
I used to know girls with red legs who hung around piers...