According to Maxwell's equations, electric and magnetic fields (EF and MF) should have the same phase for EM waves. Also, they must be perpendicular and perpendicular to the propagation direction.
If we consider a planar wave spreading in the +x direction with an EF in the y axis, the MF would be in the z axes. At any given moment, they will have the same sign, so one can write down their expressions:
$\vec{E}= E_{max}sin(kx-\omega t) \hat j$
$\vec{B}= B_{max}sin(kx-\omega t) \hat k$
But if we consider the wave going in the -x direction, one of the fields would need to change sign if nothing else is changed. Suppose $\vec{E}$ stays the same and we change $\vec{B}$. Now we have:
$\vec{E}= E_{max}sin(kx-\omega t) \hat j$
$\vec{B}= -B_{max}sin(kx-\omega t) \hat k= B_{max}sin(kx-\omega t + \pi)\hat{k} $
So their phases are no longer the same, which is necessary. However, the wave still exists.
What am I missing? I see they will both still have the maxima and minima at a given point and time, but supposedly their phase should be equal. We haven't been shown any true proof with actual vectorial calculus, so I could be misinterpreting the "must have the same phase" condition that might be less ambiguous when seeing the process. This is clearly the case for a phase difference of $2n\pi$, as it doesn't affect anything.