Earthquakes, religion, and transition to self-government in Italian cities