Nucleon-nucleon phase variation and in-medium effects on elastic scattering cross sections