3. Let $a, b, 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
$(\boldsymbol{c}-\boldsymbol{a}) \cdot(\boldsymbol{c}-\boldsymbol{b})=1-\boldsymbol{c}(\boldsymbol{a}+\boldsymbol{b}) \leqslant 1+\sqrt{2}$, equality holds when $\boldsymbol{c}$ is in the opposite direction of $\boldsymbol{a}+\boldsymbol{b}$, so the answer is $A$.