Six years after plunging Spain into its worst political crisis in decades, Catalonia's separatist parties are in danger of losing their hold on power in the north-eastern region after the pro-union Socialist Party scored a historic result in Sunday's election.