/*
 * LeLeggi Tema Child: account.
 *
 * Theme My Login e il white-label (LeLeggi User Growth, Delete Account) portano i loro fogli di stile,
 * con colori e forme del sito da cui nascono. Questo foglio si carica dopo i loro: le variabili del
 * white-label prendono i colori di LeLeggi e i moduli la forma di LeLeggi, in chiaro e in scuro.
 * Dove il white-label usa !important, serve anche qui.
 *
 * Indice: 1 variabili, 2 colonna e riquadri, 3 campi, 4 pulsanti, 5 messaggi, 6 preferenze,
 * 7 notifiche e finestra, 8 piede, 9 schermi stretti.
 */

/* 1. Variabili del white-label, con i colori del tema. */
body {
	--wl-ink: var(--ink);
	--wl-muted: var(--muted);
	--wl-line: var(--line);
	--wl-paper: var(--paper);
	--wl-panel: var(--card);
	--wl-sage: var(--acc);
	--wl-brick: var(--solid-h);
	--wl-gold: var(--gold);
	--wl-focus: var(--acc);
}

/* 2. Colonna: stretta per accesso e registrazione, larga per il profilo. */
.leleggi-pagina-account .site-main {
	max-width: 1120px;
}

.wl-auth,
.leleggi-pagina-account.tml-action .entry-content > .wl-tml-wrapper,
.leleggi-pagina-account.tml-action .entry-header,
.leleggi-pagina-account .wl-gate-card {
	max-width: 620px;
	margin-left: auto;
	margin-right: auto;
}

.wl-auth,
.wl-dashboard {
	padding-top: 0;
}

.wl-auth-card,
.wl-profile-panel,
.wl-gate-card,
.leleggi-pagina-account.tml-action .entry-content > .wl-tml-wrapper {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(42, 26, 32, 0.06);
}

.leleggi-pagina-account.tml-action .entry-content > .wl-tml-wrapper,
.wl-gate-card {
	padding: clamp(22px, 4vw, 42px);
}

.wl-auth h1,
.wl-dashboard h1 {
	margin: 0 0 12px;
	font-size: clamp(1.9rem, 4.5vw, 2.7rem);
}

.wl-profile-panel h2,
.wl-gate-card h2,
.wl-notification-center__header h2 {
	margin: 0 0 8px;
	font-size: 1.35rem;
}

.wl-profile-panel > div > p,
.wl-dashboard-hero p,
.wl-auth-card > p,
.wl-gate-card p {
	color: var(--muted);
}

.wl-auth .wl-auth-kicker,
.wl-dashboard .wl-auth-kicker,
.wl-gate-card .wl-auth-kicker {
	color: var(--acc);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.08em;
}

.wl-dashboard .wl-dashboard-hero {
	padding: 0 0 18px;
}

.wl-dashboard-hero p:last-child {
	margin-bottom: 0;
}

.wl-dashboard .wl-profile-summary > div {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
}

.wl-profile-summary span {
	color: var(--muted);
	font-size: 0.85rem;
}

/* 3. Campi. Theme My Login chiude ogni campo in un div, il white-label in un paragrafo. */
.wl-tml-wrapper .tml-field-wrap,
.wl-register-extra .tml-field-wrap {
	display: grid;
	gap: 7px;
	margin: 0;
}

.wl-register-extra {
	display: grid;
	gap: 15px;
}

body .wl-tml-wrapper label,
body .wl-register-extra label,
body .wl-form label,
body .wl-resend label {
	font-weight: 500;
}

/* Caselle e scelte: il segno accanto al testo, non sopra. */
body .wl-form label.wl-check,
body .wl-register-extra .wl-check label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

body .wl-tml-wrapper input:not([type="checkbox"]):not([type="radio"]),
body .wl-tml-wrapper select,
body .wl-register-extra input:not([type="checkbox"]):not([type="radio"]),
body .wl-register-extra select,
body .wl-form input:not([type="checkbox"]):not([type="radio"]),
body .wl-form select,
body .wl-resend input:not([type="checkbox"]):not([type="radio"]) {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	color: var(--ink);
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	font-weight: 400;
}

body .wl-tml-wrapper input:focus,
body .wl-tml-wrapper select:focus,
body .wl-form input:focus,
body .wl-form select:focus,
body .wl-resend input:focus {
	outline: 3px solid var(--rose-bg);
	border-color: var(--acc);
}

.wl-tml-wrapper input[type="checkbox"],
.wl-tml-wrapper input[type="radio"],
.wl-form input[type="checkbox"],
.wl-form input[type="radio"] {
	width: 1.15rem;
	height: 1.15rem;
	accent-color: var(--acc);
}

.wl-check,
.wl-check label {
	line-height: 1.5;
}

.wl-tml-wrapper .tml-rememberme-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
}

.wl-tml-wrapper .tml-rememberme-wrap label {
	display: inline;
}

/* Campo password con il comando che la mostra. */
.wl-tml-wrapper .tml-pwd {
	position: relative;
}

body .wl-tml-wrapper .tml-pwd input {
	padding-right: 56px;
}

body .wl-tml-wrapper .tml-pwd button.tml-toggle-pwd {
	position: absolute;
	top: 1px;
	right: 1px;
	width: 44px;
	min-height: 44px;
	padding: 0 !important;
	color: var(--muted) !important;
	-webkit-text-fill-color: var(--muted) !important;
	background: transparent !important;
	border-color: transparent !important;
	border-radius: 11px;
	transform: none;
}

body .wl-tml-wrapper .tml-pwd button.tml-toggle-pwd:hover,
body .wl-tml-wrapper .tml-pwd button.tml-toggle-pwd:focus-visible {
	color: var(--acc) !important;
	-webkit-text-fill-color: var(--acc) !important;
	background: var(--rose-bg) !important;
	border-color: transparent !important;
	transform: none;
}

.wl-tml-wrapper .tml-message,
.wl-tml-wrapper #reg_passmail,
body .wl-form-helper {
	margin: 0;
	color: var(--muted);
	font-size: 0.95rem;
}

/* 4. Pulsanti. */
body .wl-button,
body .wl-tml-wrapper .tml-button,
body .wl-tml-wrapper input[type="submit"],
body .wl-form button,
body .wl-resend button,
html body .wl-gate-card a.wl-button:not(.wl-button-secondary),
html body .entry-content a.wl-button {
	min-height: 46px;
	padding: 10px 24px;
	color: var(--on-solid) !important;
	-webkit-text-fill-color: var(--on-solid) !important;
	background: var(--solid) !important;
	background-color: var(--solid) !important;
	border: 1px solid var(--solid) !important;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

body .wl-button:hover,
body .wl-tml-wrapper .tml-button:hover,
body .wl-tml-wrapper input[type="submit"]:hover,
body .wl-form button:hover,
body .wl-resend button:hover,
html body .wl-gate-card a.wl-button:not(.wl-button-secondary):hover,
html body .entry-content a.wl-button:hover,
html body .entry-content a.wl-button:focus-visible {
	color: var(--on-solid) !important;
	-webkit-text-fill-color: var(--on-solid) !important;
	background: var(--solid-h) !important;
	background-color: var(--solid-h) !important;
	border-color: var(--solid-h) !important;
}

.wl-form button,
.wl-tml-wrapper .tml-button,
.wl-resend button {
	justify-self: start;
}

body .wl-button.wl-button-secondary,
body .wl-gate-actions button,
html body .wl-gate-card a.wl-button-secondary,
html body .entry-content a.wl-button.wl-button-secondary {
	color: var(--ink) !important;
	-webkit-text-fill-color: var(--ink) !important;
	background: transparent !important;
	background-color: transparent !important;
	border-color: var(--line) !important;
}

body .wl-button.wl-button-secondary:hover,
body .wl-gate-actions button:hover,
html body .wl-gate-card a.wl-button-secondary:hover,
html body .entry-content a.wl-button.wl-button-secondary:hover,
html body .entry-content a.wl-button.wl-button-secondary:focus-visible {
	color: var(--acc) !important;
	-webkit-text-fill-color: var(--acc) !important;
	background: var(--rose-bg) !important;
	background-color: var(--rose-bg) !important;
	border-color: var(--acc) !important;
}

/*
 * Eliminazione dell'account: l'unico riquadro che avverte.
 * Il plugin Delete Account scrive il suo stile nella testata della pagina, con !important sul pulsante.
 */
body .wl-delete-profile-form {
	display: grid;
	gap: 15px;
	margin: 0;
	padding: 18px;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--err);
	border-radius: 14px;
}

body .wl-delete-profile-form p {
	display: grid;
	gap: 7px;
	margin: 0;
}

body .wl-delete-profile-form label {
	margin: 0;
	color: var(--ink);
	font-weight: 500;
}

body .wl-delete-profile-form input[type="password"] {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	color: var(--ink);
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
}

body .wl-delete-profile-form input[type="password"]:focus {
	outline: 3px solid var(--rose-bg);
	border-color: var(--acc);
}

body .wl-delete-profile-form input[type="submit"] {
	justify-self: start;
	width: auto;
	max-width: none;
	min-height: 46px;
	padding: 10px 24px;
	color: var(--err) !important;
	background: transparent !important;
	border: 1px solid var(--err) !important;
	border-radius: 999px;
	box-shadow: none;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
}

body .wl-delete-profile-form input[type="submit"]:hover,
body .wl-delete-profile-form input[type="submit"]:focus {
	color: var(--bg) !important;
	background: var(--err) !important;
	border-color: var(--err) !important;
}

body .wl-delete-profile-form input[type="submit"]:disabled {
	color: var(--muted) !important;
	background: transparent !important;
	border-color: var(--line) !important;
	box-shadow: none;
	cursor: not-allowed;
}

body .wl-delete-profile-form input[type="password"]:disabled {
	color: var(--muted);
	background: var(--surface);
}

/* 5. Messaggi: esiti del white-label, avvisi ed errori di Theme My Login. */
body .wl-notice,
body .wl-notification-message,
.wl-tml-wrapper .tml-alerts .tml-error,
.wl-tml-wrapper .tml-alerts .tml-message,
.wl-tml-wrapper .tml-alerts .tml-success {
	margin: 0;
	padding: 12px 16px;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line);
	border-left: 4px solid var(--acc);
	border-radius: 12px;
	list-style: none;
}

.wl-tml-wrapper .tml-alerts ul {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-tml-wrapper .tml-alerts:empty {
	display: none;
}

body .wl-notice.wl-notice-success,
body .wl-notification-message.is-ok,
.wl-tml-wrapper .tml-alerts .tml-success {
	color: var(--ink);
	border-color: var(--line);
	border-left-color: var(--ok);
}

body .wl-notice.wl-notice-error,
body .wl-notification-message.is-error,
.wl-tml-wrapper .tml-alerts .tml-error {
	color: var(--ink);
	border-color: var(--line);
	border-left-color: var(--err);
}

body .wl-notice.wl-notice-info,
body .wl-notice.wl-notice-warning {
	color: var(--ink);
	border-color: var(--line);
	border-left-color: var(--gold);
}

/* Aperture «Password dimenticata» e «Reinvia verifica email». */
.wl-auth .wl-auth-details summary {
	display: flex;
	align-items: center;
	min-height: 44px;
	color: var(--acc);
	font-weight: 600;
}

.wl-auth-details[open] summary {
	margin-bottom: 12px;
}

.wl-auth-alt {
	color: var(--muted);
}

/* 6. Preferenze di comunicazione e di lettura. */
body .wl-preference-center,
.leleggi-scelte {
	margin: 0;
	padding: 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
}

.leleggi-scelte {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 22px;
}

body .wl-preference-center legend,
.leleggi-scelte legend {
	padding: 0 7px;
	color: var(--ink);
	font-weight: 600;
}

body .wl-preference-option {
	background: var(--card);
	border-color: var(--line);
	border-radius: 12px;
}

.leleggi-scelte .wl-check {
	align-items: center;
	min-height: 44px;
}

.leleggi-scelte .wl-check input {
	margin-top: 0;
}

/* 7. Notifiche interne e finestra «crea un account o accedi». */
body .wl-notification-count {
	color: var(--on-solid);
	background: var(--solid);
	border: 0;
	border-radius: 999px;
	box-shadow: none;
}

body .wl-gate-dialog {
	color: var(--ink);
	background: var(--card);
	border-color: var(--line);
	border-radius: 18px;
}

/* 8. Piede: il gruppo «Account» che il white-label inserisce. */
.site-footer .site-footer__group--account .wl-footer-account__links {
	gap: 2px;
}

/* 9. Schermi stretti. */
@media screen and (max-width: 47.99em) {
	body .wl-profile-panel,
	body .wl-form-grid,
	body .wl-preference-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	body .wl-profile-summary {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wl-form button,
	.wl-tml-wrapper .tml-button,
	.wl-resend button,
	.wl-security-actions .wl-button,
	.wl-gate-actions .wl-button,
	body .wl-delete-profile-form input[type="submit"] {
		justify-self: stretch;
		width: 100%;
		max-width: none;
	}
}

/* Profilo senza accesso: titolo e riquadro sulla stessa colonna. */
.leleggi-pagina-account:not(.logged-in) .entry-header {
	max-width: 620px;
	margin-left: auto;
	margin-right: auto;
}
