3. Let $a$, $b$, and $c$ be three unit vectors in the same plane, and $a \perp b$. Then the maximum value of $(c-a) \cdot(c-b)$ is ( ).
(A) $1+\sqrt{2}$
(B) $1-\sqrt{2}$
(C) $\sqrt{2}-1$
(D) 1
3. A.

Given $\boldsymbol{a} \perp \boldsymbol{b},|\boldsymbol{a}|=|\boldsymbol{b}|=|\boldsymbol{c}|=1$, we know $\boldsymbol{a} \cdot \boldsymbol{b}=0,|\boldsymbol{a}+\boldsymbol{b}|=\sqrt{2}$.
Let the angle between vector $\boldsymbol{c}$ and $\boldsymbol{a}+\boldsymbol{b}$ be $\theta$. Then
$$
\begin{array}{l}
(\boldsymbol{c}-\boldsymbol{a}) \cdot(\boldsymbol{c}-\boldsymbol{b})=\boldsymbol{c}^{2}-\boldsymbol{c} \cdot(\boldsymbol{a}+\boldsymbol{b})+\boldsymbol{a} \cdot \boldsymbol{b} \\
=|\boldsymbol{c}|^{2}-|\boldsymbol{c}||\boldsymbol{a}+\boldsymbol{b}| \cos \theta \\
=1-\sqrt{2} \cos \theta \leqslant 1+\sqrt{2},
\end{array}
$$

The equality holds if and only if $\cos \theta=-1$, i.e., $\theta=\pi$.
Therefore, the maximum value of $(\boldsymbol{c}-\boldsymbol{a}) \cdot(\boldsymbol{c}-\boldsymbol{b})$ is $1+\sqrt{2}$.