A new approach to phase transitions via the entropy balance