If the value of the integral \( \int_{-\pi/2}^{\pi/2} \left( \frac{x^2 \cos x}{1 + \pi^x} + \frac{1 + \sin^2 x}{1 + e^{\sin x^{2023}}} \right) \, dx = \frac{\pi}{4} (\pi + a) - 2 \), then the value of \( a \) is:
\( 3 \)
\( \frac{3}{2} \)
\( -\frac{3}{2} \)
\( 2 \)