An energy balance concept of habitability