The pain in Spain will follow years of rapid economic gain