Effects of phase transition on ESR and optical spectra in NH4Cl:Cu2+