21. (12 points) Given a fixed point $A(1,0)$ and two moving points $E, F$ on the fixed line $x=-1$, satisfying $\overrightarrow{A E} \perp \overrightarrow{A F}$, a moving point $P$ satisfies $\overrightarrow{E P} / / \overrightarrow{O A}, \overrightarrow{F O} / / \overrightarrow{O P}$ (where $O$ is the origin).
(1) Find the equation of the trajectory $C$ of the moving point $P$;
(2) A line $l$ passing through the point $B(0,2)$ intersects the trajectory $C$ from (1) at two different points $M, N$. If $\overrightarrow{A M} \cdot \overrightarrow{A N}<0$, find the range of the slope of the line $l$.
21. (1) Let $P(x, y)$, $E\left(-1, y_{1}\right)$, $F\left(-1, y_{2}\right)$ ($y_{1}$, $y_{2}$ are not 0).
From $\overrightarrow{E P} / / \overrightarrow{O A}$, we get $y_{1}=y$, i.e., $E(-1, y)$.
From $\overrightarrow{F O} / / \overrightarrow{O P}$, we get $y_{2}=-\frac{y}{x}$, i.e.,
$$
F\left(-1,-\frac{y}{x}\right).
$$

From $\overrightarrow{A E}: \overrightarrow{A F}=0$
$$
\begin{array}{l}
\Rightarrow\left(2,-y_{1}\right) \cdot\left(2,-y_{2}\right)=0 \\
\Rightarrow y_{1} y_{2}=-4 \Rightarrow y^{2}=4 x(x \neq 0).
\end{array}
$$

Therefore, the equation of the trajectory $C$ of the moving point $P$ is
$$
y^{2}=4 x(x \neq 0).
$$
(2) Let the line $l: y=k x+2$ ($k \neq 0$),
$$
M\left(\frac{y_{1}^{2}}{4}, y_{1}\right), N\left(\frac{y_{2}^{2}}{4}, y_{2}\right).
$$

From $\left\{\begin{array}{l}y=k x+2, \\ y^{2}=4 x,\end{array}\right.$ eliminating $x$ we get
$$
k y^{2}-4 y+8=0.
$$

Then $y_{1}+y_{2}=\frac{4}{k}$, $y_{1} y_{2}=\frac{8}{k}$, and
$$
\begin{array}{l}
\Delta=16-32 k>0 \Rightarrow k<\frac{1}{2}. \\
\text { Hence } \overrightarrow{A M} \cdot \overrightarrow{A N}=\left(\frac{y_{1}^{2}}{4}-1, y_{1}\right) \cdot\left(\frac{y_{2}^{2}}{4}-1, y_{2}\right) \\
=\left(\frac{y_{1}^{2}}{4}-1\right)\left(\frac{y_{2}^{2}}{4}-1\right)+y_{1} y_{2} \\
=\frac{y_{1}^{2} y_{2}^{2}}{16}-\frac{1}{4}\left(y_{1}^{2}+y_{2}^{2}\right)+y_{1} y_{2}+1 \\
=\frac{4}{k^{2}}-\frac{1}{4}\left(\frac{16}{k^{2}}-\frac{16}{k}\right)+\frac{8}{k}+1=\frac{k+12}{k}.
\end{array}
$$

Since $\overrightarrow{A M} \cdot \overrightarrow{A N}<0$, we have $-12<k<0$.