Ferroelectric phase transition and spontaneous electric polarization in CaMn7O12 from first principles