Let $p$ be an odd prime. Dirichlet's class number formula for quadratic fields essentially determines the value of the product $\prod_{k=1}^{(p-1)/2}(1-e^{2\pi ik^2/p})$. I think it is interesting to investigate the product $$S_p(x)=\prod_{k=1}^{(p-1)/2}(x-e^{2\pi i k^2/p})$$ with $x$ a root of unity. In a recent preprint available from http://arxiv.org/abs/1908.02155, I determined the value of $S_p(i)$ for $p\equiv 1\pmod4$. For the cubic root $\omega=(-1+\sqrt{-3})/2$ of unity, I have proved in the same preprint that $$(-1)^{|\{1\le k\le\lfloor\frac{p+1}3\rfloor:\ (\frac kp)=-1\}|}S_p(\omega)=\begin{cases}1&\text{if}\ p\equiv1\pmod{12},\\\omega \varepsilon_p^{h(p)}&\text{if}\ p\equiv5\pmod{12},\end{cases}$$ where $(\frac kp)$ is the Legendre symbol, $\varepsilon_p$ and $h(p)$ are the fundamental unit and the class number of the real quadratic field $\mathbb Q(\sqrt p)$.
Question 1. How to determine the value of $S_p(i)$ for primes $p\equiv3\pmod4$? How to determine the value of $S_p(\omega)$ for primes $p\equiv 7,11\pmod{12}$?
Question 2. Let $p>3$ be a prime and let $n>2$ be an integer. Define $$f_n(p)=(-1)^{|\{1\le k<\frac p{2^n}:\ (\frac kp)=1\}|}S_p(e^{2\pi i/2^n})$$ Via numerical computation, I guess that $$e^{-2\pi i(p-1)/2^{n+2}}f_n(p)>0$$ if $p\equiv1\pmod4$, and $$(-1)^{(h(-p)+1)/2}f(p)e^{-2\pi i(p+2^n-1)/2^{n+2}}>0$$ if $p\equiv3\pmod4$, where $h(-p)$ is the class number of the imaginary quadratic field $\mathbb Q(\sqrt{-p})$. How to prove this observation? How to determine the exact values of $S_p(e^{2\pi i/2^n})$ $(n=3,4,\ldots)$?
Your comments are welcome!
New Addition (August 12, 2019). I have conjectures on the exact values of $S_p(i)$ and $S_p(\omega)$ for primes $p\equiv 3\pmod4$. For the conjectural value of $S_p(i)$ with $p\equiv3\pmod4$, see my posted answer. Here I state my conjecture on $S_p(\omega)$.
Conjecture. Let $p>3$ be a prime with $p\equiv 3\pmod4$, and let $(x_p,y_p)$ be the least positive integer solution to the diophantine equation $$3x^2+4\left(\frac p3\right)=py^2.$$ Then \begin{align}S_p(\omega)=&(-1)^{(h(-p)+1)/2}\left(\frac p3\right)\frac{x_p\sqrt3-y_p\sqrt{p}}2 \\&\times\begin{cases}i&\text{if}\ p\equiv7\pmod{12}, \\(-1)^{|\{1\le k<\frac p3:\ (\frac kp)=1\}|}i\omega&\text{if}\ p\equiv11\pmod{12}. \end{cases}\end{align}
For example, this conjecture predicts that $$S_{79}(\omega)=i\frac{\sqrt{79}-5\sqrt3}2\ \ \text{and}\ \ S_{227}(\omega)=i\omega(1338106\sqrt3-153829\sqrt{227}).$$