Early geochemical environment of Mars as determined from thermodynamics of phyllosilicates