Geometry of quantum phase transitions