Flooding in southern Brazil leaves at least 31 dead and 2,300 homeless