I have been reading a book about electrodynamics and I have stumbled upon the following matter which is, to me , contradictory. When the electromagnetic wave changes medium, it is subject to certain boundary conditions, such as Snell's law. Another condition is that the phase factors are the same:
$$ (\vec{k}_i \cdot \vec{x}) = (\vec{k}_r \cdot \vec{x}) = (\vec{k}_t \cdot \vec{x}) $$
where the subscripts indicate the incident, reflected and transmitted wave, respectively, and are understood to be at the border between the media. On the other hand, we have the Fresnel coefficients $R$ and $T$, indicating the reflective and transmissive coefficients for a particular polarization, which are both functions of both indices of refraction $n_1$ (first medium) and $n_2$ (second medium). They can be defined such that:
$$ E_t = E_i \cdot T(n_1,n_2) $$
and
$$ E_r = E_i \cdot R(n_1,n_2) $$
If at least one index of refraction is complex, though, the Fresnel coefficients become complex themselves, which indicates a phase jump between the incident field and the reflected/transmitted field, contradicting the condition laid out above that the phases have to be the same. So which is it, what am I missing here?