If \( n \) is the number of solutions of the equation \( 2 \cos x \left( 4 \sin\!\left(\frac{\pi}{4} + x\right) \sin\!\left(\frac{\pi}{4} - x\right) - 1 \right) = 1 \), \( x \in [0, \pi] \) and \( S \) is the sum of all these solutions, then the ordered pair \( (n, S) \) is: