12. Let $0<\theta<\pi$, the complex numbers $z_{1}=1-\cos \theta+i \sin \theta, z_{2}=a^{2}+a i, u \in \mathbf{R}, z_{1} z_{2}$ is a pure imaginary number, and $\bar{a}=z_{1}^{2}+z_{2}^{2}-2 z_{1} z_{2}$. Then $\theta=$ $\qquad$ when it is a negative real number.
12. $\frac{\pi}{2}$.

Since $z_{1} z_{2}=\left[a^{2}(1-\cos \theta)-a \sin \theta\right]+\left[a(1-\cos \theta)+a^{2} \sin \theta\right] i$ is a pure imaginary number, we have
$\left\{\begin{array}{l}a^{2}(1-\cos \theta)-a \sin \theta=0 \\ a(1-\cos \theta)+a^{2} \sin \theta \neq 0\end{array}\right.$, so $a \neq 0$. And $a=\frac{\sin \theta}{1-\cos \theta}$.
Also, $\omega=z_{1}^{2}+z_{2}^{2}-2 z_{1} z_{2}=\left(z_{1}-z_{2}\right)^{2}$ is a non-negative real number, so $z_{1}-z_{2}$ is a real number, and $z_{1}-z_{2}=\left(1-\cos \theta-a^{2}\right)+(\sin \theta-a) i$. Therefore, $a=\sin \theta \neq 0$. Thus, $\sin \theta=\frac{\sin \theta}{1-\cos \theta}$, which gives $\cos \theta=0$. Given $0<\theta<\pi$, we finally get $\theta=\frac{\pi}{2}$.