Sorry I have the complete answer and I don't know how to put it inside your's editor.
\documentclass[two pages,12pt]{article}
\usepackage{lastpage}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{color}
\usepackage{fancyhdr} % For headers and footers
\usepackage{geometry}
\geometry{a4paper,total={210mm,297mm},left=20mm,right=20mm,top=30mm,bottom=30mm}
\usepackage[most]{tcolorbox}
\tcbset{colback=white}
\pagestyle{fancy}
\chead{\fbox{\parbox{\dimexpr\linewidth-7pt}{\centering \bf Examen name and type header}}}
\lhead{} % Left header
\rhead{} % Right header
\lfoot{} % Left footer
\cfoot{\fbox{\parbox{\dimexpr\linewidth-7pt}{\bf School footer \hfill Page n.: \thepage\ of \pageref{LastPage}}}}
\rfoot{} % Right footer
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
%\renewcommand*\rmdefault{ppl} %Set font
\begin{document}
\thispagestyle{fancy}
\begin{tcolorbox}[enhanced, title style={left color=black, right color=white}, title=\bf Short Question - 30 pts, breakable]
\lipsum[1-2]\\
\begin{enumerate}
\item prima domanda
\item seconda domanda
\end{enumerate}
\end{tcolorbox}
\newpage
\begin{tcolorbox}[enhanced, title style={left color=black, right color=white}, title=\bf Long Question - 50 pts, breakable]
\lipsum[1-2]\\
\includegraphics[scale=1.5]{graph sinus and cosinus.pdf}\\
Rispondi alle seguenti domande:
\begin{enumerate}
\item dimostrare che $\sin^2 x+\cos^2 x=1$
\item Disegnare il grafico della funzione $y=\sqrt{\frac{2x-1}{x+3}}$
\end{enumerate}
\lipsum[4-7]
\end{tcolorbox}
\newpage
\begin{tcolorbox}[enhanced, title style={left color=black, right color=white}, title=\bf Shortest Question - 20 pts, breakable]
\lipsum[1-2]\\
\begin{enumerate}
\item prima domanda
\item seconda domanda
\end{enumerate}
\end{tcolorbox}
\end{document}
standalone
class is not valid to produce regular documents with header, footer. It's only to get independent figures or text fragments. And I don't understand the relation withtcolorbox
, could you better explain the problem?