When Elections Lose Legitimacy