/**
 * Registrazione studenti - stesso stile della schermata di accesso di /studente/.
 *
 * I valori non sono inventati: sono gli stessi token di
 * wp-content/plugins/mentium-app/assets/app.css (sezione LOGIN, classi .lg-*),
 * copiati qui nella sola variante CHIARA. La app segue prefers-color-scheme,
 * questa pagina no: header bianco e footer blu del sito restano chiari sempre,
 * e una card scura in mezzo a due fasce chiare stonerebbe.
 *
 * Tutto e' dentro .mreg (o sotto body.mentium-reg-page): nessuna regola puo'
 * raggiungere altre pagine del sito.
 *
 * @package tutorstarter-child
 */

/* La fascia di pagina fra header e footer prende il fondo della app (--bg). */
body.mentium-reg-page {
	background: #EAF6F9;
}

.mreg {
	/* Token di app.css, tema chiaro. */
	--blue: #539ae0;
	--blue-deep: #254A87;
	--surface: #ffffff;
	--surface-2: #D7F2F9;
	--line: #c9e2ec;
	--ink: #212327;
	--muted: #676d7e;
	/* Le varianti -text sono la stessa tinta scurita quanto serve per restare
	   leggibile come TESTO su fondo chiaro (>=4.5:1), vedi app.css. */
	--blue-text: #254A87;
	--green-text: #1a6b3c;
	--danger: #b3261e;
	--radius: 14px;
	--shadow: 0 6px 24px rgba(19, 39, 68, 0.08);

	/* Stessa pila di caratteri della shell della app (templates/app.php):
	   la registrazione deve rendere identica alla schermata di accesso. */
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	padding: clamp(20px, 3.5vw, 44px) 0;
}

.mreg *,
.mreg *::before,
.mreg *::after {
	box-sizing: border-box;
}

.mreg :focus-visible {
	outline: 3px solid var(--blue);
	outline-offset: 2px;
	border-radius: 10px;
}

.mreg-card {
	display: grid;
	grid-template-columns: 0.95fr 1.05fr;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	background: var(--surface);
}

/* ===================== pannello brand ===================== */

.mreg-brand {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(900px 500px at 85% 0%, rgba(83, 154, 224, 0.25), transparent 60%),
		linear-gradient(155deg, #132744 0%, #0E151E 70%);
	color: #eef2ff;
	padding: clamp(28px, 3.4vw, 46px);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 32px;
}

/* Lo stesso segno di acqua della schermata di accesso. */
.mreg-brand::after {
	content: "\222B";
	position: absolute;
	right: -6%;
	bottom: -14%;
	font-size: 380px;
	line-height: 0.8;
	font-weight: 700;
	color: #fff;
	opacity: 0.06;
	pointer-events: none;
	user-select: none;
}

.mreg-claim {
	position: relative;
	z-index: 1;
}

.mreg-eyebrow,
.mreg-form-eyebrow {
	display: block;
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.mreg-eyebrow {
	color: var(--blue);
}

.mreg-claim h2 {
	margin: 0 0 12px;
	font-size: clamp(1.4rem, 2.1vw, 1.75rem);
	font-weight: 900;
	letter-spacing: -0.02em;
	line-height: 1.12;
	color: #fff;
}

.mreg-claim p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.6;
	color: #b9c4e8;
	max-width: 40ch;
}

.mreg-points {
	position: relative;
	z-index: 1;
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mreg-points li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 0.88rem;
	font-weight: 600;
	color: #eef2ff;
	line-height: 1.35;
}

.mreg-points i {
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	font-style: normal;
	font-size: 12px;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(140deg, var(--blue), var(--blue-deep));
}

/* ===================== form ===================== */

.mreg-form-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(28px, 3.4vw, 46px);
}

.mreg-form-col {
	width: min(460px, 100%);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.mreg-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
}

.mreg-form-eyebrow {
	margin-bottom: -10px;
	color: var(--blue-text);
}

.mreg-form h3 {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	color: var(--ink);
	letter-spacing: -0.01em;
}

.mreg-sub {
	margin: -8px 0 4px;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--muted);
}

/* Griglia dei campi: due colonne, come il modulo di oggi. */
.mreg-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 16px;
}

.mreg-full {
	grid-column: 1 / -1;
}

.mreg-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	margin: 0;
}

.mreg-field > span:first-child {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}

.mreg-form input:not([type="checkbox"]):not([type="hidden"]),
.mreg-form select {
	font: inherit;
	font-size: 14.5px;
	color: var(--ink);
	background: var(--surface-2);
	border: 1px solid var(--line);
	border-radius: 11px;
	padding: 13px 15px;
	outline: none;
	transition: border-color 0.15s ease;
	width: 100%;
	max-width: 100%;
	margin: 0;
	box-shadow: none;
	height: auto;
	line-height: 1.3;
}

.mreg-form input:focus,
.mreg-form select:focus {
	border-color: var(--blue);
	box-shadow: none;
}

.mreg-form input::placeholder {
	color: var(--muted);
	opacity: 0.85;
}

.mreg-form select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23676d7e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px;
	cursor: pointer;
}

/* Nome utente: si compila da solo, quindi si legge ma non si scrive. */
.mreg-form input.mreg-readonly {
	background: #eef4f7;
	color: var(--muted);
	cursor: default;
}

.mreg-hint {
	font-size: 11.5px;
	line-height: 1.45;
	color: var(--muted);
}

.mreg-pass {
	position: relative;
}

.mreg-pass input {
	padding-right: 82px;
}

.mreg-show {
	position: absolute;
	right: 8px;
	bottom: 9px;
	border: none;
	background: transparent;
	cursor: pointer;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	color: var(--blue-text);
	padding: 6px 8px;
	border-radius: 8px;
}

/* ===================== stati ===================== */

.mreg-alert {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--danger);
	background: rgba(214, 69, 69, 0.08);
	border: 1px solid rgba(214, 69, 69, 0.35);
	border-radius: 10px;
	padding: 10px 13px;
}

.mreg-alert ul {
	margin: 0;
	padding-left: 18px;
}

.mreg-alert li + li {
	margin-top: 4px;
}

.mreg-alert a {
	color: var(--danger);
	font-weight: 800;
	text-decoration: underline;
}

.mreg-success {
	margin: 0;
	font-size: 13px;
	line-height: 1.55;
	font-weight: 600;
	color: var(--green-text);
	background: rgba(46, 158, 91, 0.1);
	border: 1px solid rgba(46, 158, 91, 0.35);
	border-radius: 10px;
	padding: 12px 14px;
}

.mreg-success strong {
	display: block;
	margin-bottom: 2px;
	font-weight: 800;
}

.mreg-error {
	display: none;
	margin: 0;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--danger);
}

/* ===================== privacy, invio, coda ===================== */

.mreg-privacy {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
}

.mreg-privacy > label {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	color: var(--muted);
	font-weight: 600;
	line-height: 1.45;
	cursor: pointer;
	margin: 0;
}

.mreg-privacy input[type="checkbox"] {
	accent-color: var(--blue-deep);
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	flex: 0 0 16px;
}

.mreg-privacy a {
	color: var(--blue-text);
	font-weight: 700;
	text-decoration: none;
}

.mreg-privacy a:hover {
	text-decoration: underline;
}

.mreg-submit {
	border: none;
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(180deg, var(--blue), var(--blue-deep));
	padding: 14px 20px;
	border-radius: 12px;
	box-shadow: 0 8px 20px rgba(37, 74, 135, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	width: 100%;
}

.mreg-submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 26px rgba(37, 74, 135, 0.45);
	background: linear-gradient(180deg, var(--blue), var(--blue-deep));
	color: #fff;
}

.mreg-foot {
	margin: 4px 0 0;
	font-size: 12.5px;
	color: var(--muted);
	text-align: center;
	line-height: 1.5;
}

.mreg-foot a {
	color: var(--blue-text);
	font-weight: 700;
	text-decoration: none;
}

.mreg-foot a:hover {
	text-decoration: underline;
}

.mreg-security {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin: 0;
	font-size: 11.5px;
	color: var(--muted);
	text-align: center;
	line-height: 1.4;
}

.mreg-security > span {
	display: grid;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	place-items: center;
	border-radius: 50%;
	background: rgba(46, 158, 91, 0.12);
	color: var(--green-text);
	font-size: 10px;
	font-weight: 800;
}

/* ===================== schermi stretti ===================== */

@media (max-width: 900px) {
	.mreg-card {
		grid-template-columns: 1fr;
	}

	.mreg-brand {
		gap: 20px;
		padding-bottom: 28px;
	}

	.mreg-brand::after {
		font-size: 220px;
		right: -10%;
		bottom: -20%;
	}

	.mreg-points {
		display: none;
	}
}

@media (max-width: 560px) {
	.mreg {
		padding: 14px 0;
	}

	.mreg-brand {
		padding: 24px 20px 28px;
	}

	.mreg-claim h2 {
		font-size: 1.6rem;
	}

	.mreg-form-wrap {
		padding: 28px 20px 36px;
	}

	.mreg-form {
		width: 100%;
	}

	/* Una colonna sola: i campi affiancati diventano illeggibili sotto i 560px. */
	.mreg-grid {
		grid-template-columns: 1fr;
	}
}

/* ===================== riallineamento sul tema =====================
   Il tema del sito impone interlinee molto larghe dentro .entry-content
   (p e titoli arrivano a 1.8): dentro la card servono quelle della
   schermata di accesso, altrimenti il modulo si allunga e non si somigliano
   piu'. Stessi valori di sopra, solo con la specificita' necessaria a
   vincere sulle regole del tema. */

.mreg .mreg-form h3 {
	line-height: 1.25;
}

.mreg .mreg-sub,
.mreg .mreg-foot {
	line-height: 1.5;
}

.mreg .mreg-security {
	line-height: 1.4;
}

.mreg .mreg-field > span:first-child {
	line-height: 1.3;
}

.mreg .mreg-hint {
	line-height: 1.45;
}

.mreg .mreg-privacy > label {
	line-height: 1.45;
}

.mreg .mreg-success {
	line-height: 1.55;
}

.mreg .mreg-alert {
	line-height: 1.5;
}

/* ===================== secondo passo: accessi social =====================
   Il modulo qui sopra chiede solo email e password. Chi entra con Google,
   Apple o Facebook non compila nulla: nome, cognome e telefono li chiede
   mu-plugins/mentium-completa-profilo.php dopo il primo accesso. */

/* Una colonna sola: i campi rimasti sono tre e affiancarli non ha piu' senso. */
.mreg-grid-1 {
	grid-template-columns: 1fr;
}

.mreg-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.mreg-divider::before,
.mreg-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

.mreg-social {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
}

/* L'addon di Tutor Pro si porta dietro un suo bordo superiore e 24px di
   spazio: qui sopra c'e' gia' il separatore "oppure", quindi si tolgono. */
.mreg-social #tutor-pro-social-authentication {
	padding-top: 0;
	border-top: 0;
	gap: 10px;
	width: 100%;
}

.mreg-social #tutor-pro-social-authentication > div {
	width: 100%;
}

.mreg-social-nota {
	margin: 0;
	font-size: 11.5px;
	line-height: 1.45;
	color: var(--muted);
}

/* Bottone Apple: nero, glifo a sinistra, testo bianco. Le linee guida di
   Apple lasciano scegliere fra nero, bianco e bianco con bordo, ma non
   ammettono altri colori ne' altri testi oltre a "Accedi/Continua con Apple". */
.mreg-apple {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	padding: 12px 18px;
	border: 1px solid #000;
	border-radius: 12px;
	background: #000;
	color: #fff;
	font: inherit;
	font-size: 14.5px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.mreg-apple:hover {
	opacity: 0.88;
	color: #fff;
}

.mreg-apple svg {
	width: 17px;
	height: 17px;
	flex: 0 0 17px;
	fill: currentColor;
	/* Il glifo Apple ha il morso in alto: senza questo scarto sembra basso. */
	margin-top: -2px;
}
