/* ==========================================================================
   Accesso, registrazione e codice di conferma (woocommerce/myaccount/form-login.php)
   Porting del prototipo "login otp animation": stesse misure e movimenti, colori e font del sito.
   Movimento in assets/js/access.js. Solo su questa pagina (ms_access_page in inc/account.php).
   ========================================================================== */

.msl {
	/* Arancio del design (assets/design-home), solo decorativo: per il testo serve --ms-orange (AA) */
	--msl-accent: #E85D00;
	--msl-accent-soft: rgba(232, 93, 0, .16);
	--msl-link: var(--ms-orange);
	--msl-link-hover: var(--ms-flame);
	--msl-ink: var(--ms-ink);
	--msl-ink-700: var(--ms-grey-700);
	--msl-soft: var(--ms-grey-600);   /* testo secondario: 5,1:1 su bianco */
	--msl-faint: var(--ms-grey-500);  /* placeholder */
	--msl-field: var(--ms-grey-450);  /* bordo dei campi: 3:1 sul bianco (WCAG 1.4.11), come nel resto del sito */
	--msl-danger: var(--ms-flag-red);
	--msl-success: var(--ms-green);
	--msl-ease: var(--ms-ease-out);
	--msl-spring: cubic-bezier(.34, 1.56, .64, 1);
	/* Altezza sopra il contenuto (barra superiore + header + menu) per stare nella prima schermata */
	--msl-head: 156px;
	--gutter-x: clamp(24px, 8vw, 140px);
	--gutter-y: clamp(16px, 4vh, 44px);

	position: relative;
	isolation: isolate;
	overflow: clip; /* l'Orb entra da fuori, senza barre di scorrimento */
	display: flex;
	padding: var(--gutter-y) var(--gutter-x);
	background: var(--ms-line);
	font-family: var(--ms-font-body);
	color: var(--msl-ink);
}

/* La pagina lascia spazio al layout: niente contenitore, niente H1 di pagina (l'H1 e' il titolo del pannello) */
.ms-access .ms-main { max-width: none; padding: 0; }
.ms-access .ms-main > .ms-page-title { display: none; }

.msl-shell {
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
	gap: 10px;
	height: max(620px, calc(100dvh - var(--msl-head) - 2 * var(--gutter-y)));
	padding: 10px;
	background: var(--ms-white);
	border-radius: 22px;
	box-shadow: 0 1px 2px rgba(11, 11, 12, .04), 0 12px 40px -18px rgba(11, 11, 12, .14);
}

/* ---------------- pannello sinistro ---------------- */

.msl-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 0;
	padding: 32px 40px 44px;
	border-radius: 16px;
}

.msl-hero__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(172deg, #F5F4F0 0%, #F8EFD8 30%, #FBDDA0 58%, #FFC54D 78%, #FFD98A 100%);
}

.msl-hero__blob { position: absolute; border-radius: 50%; filter: blur(60px); will-change: transform; }

/* nucleo arancio, basso e un po' a destra del centro */
.msl-hero__blob--a {
	width: 70%; height: 52%; left: 22%; top: 46%;
	background: radial-gradient(closest-side, #E85D00 0%, rgba(232, 93, 0, .55) 55%, transparent 100%);
	animation: msl-drift-a 18s ease-in-out infinite alternate;
}
/* giallo caldo in basso a destra */
.msl-hero__blob--b {
	width: 60%; height: 46%; right: -14%; bottom: -10%;
	background: radial-gradient(closest-side, #FFD27A 0%, rgba(255, 210, 122, .4) 60%, transparent 100%);
	animation: msl-drift-b 22s ease-in-out infinite alternate;
}
/* velo chiaro in alto a sinistra: tiene leggibile il logo */
.msl-hero__blob--c {
	width: 80%; height: 50%; left: -20%; top: -12%;
	background: radial-gradient(closest-side, #F7F7F5 0%, rgba(247, 247, 245, .5) 60%, transparent 100%);
}
.msl-hero__grain {
	position: absolute; inset: 0; opacity: .22; mix-blend-mode: soft-light;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes msl-drift-a { to { transform: translate(-8%, -6%) scale(1.08); } }
@keyframes msl-drift-b { to { transform: translate(-10%, -8%) scale(1.12); } }

.msl-brand { display: flex; align-items: center; }
.msl-brand__mark { width: auto; height: 40px; }

.msl-hero__copy { max-width: 440px; }
.msl-hero__kicker { margin: 0 0 14px; font-size: 14px; color: rgba(11, 11, 12, .68); }
.msl h2.msl-hero__title { /* batte ".ms-main > .woocommerce h2" di style.css */
	margin: 0;
	font-family: var(--ms-font-display);
	font-size: clamp(26px, 2.6vw, 34px);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -.02em;
	text-wrap: balance;
}

/* ---------------- card fluttuanti (tela fissa 460x380, scalata da access.js) ---------------- */

.msl-show { position: relative; flex: 1; min-height: 0; margin: 12px 0 132px; }
.msl-show[data-tiny] { visibility: hidden; }
.msl-show__canvas {
	position: absolute; top: 50%; left: 50%; width: 460px; height: 380px;
	transform: translate(-50%, -50%) scale(var(--scale, 1));
	transform-origin: center;
}
.msl-show__halo {
	position: absolute; left: 50%; top: 50%; width: 420px; height: 420px; margin: -210px 0 0 -210px;
	border-radius: 50%; pointer-events: none;
	background: radial-gradient(closest-side, rgba(255, 255, 255, .55), rgba(255, 255, 255, .18) 55%, transparent 100%);
}
.msl-layer { position: absolute; will-change: transform; }
.msl-layer--cat { left: 52px; top: 74px; width: 330px; }
.msl-layer--toast { left: 176px; top: 22px; width: 284px; z-index: 3; }
.msl-layer--ship { left: 0; top: 248px; z-index: 2; }
.msl-layer--pill { left: 214px; top: 312px; z-index: 2; }

/* galleggiamento lento di ogni card, sfalsato */
.msl-bob { animation: msl-bob var(--time) ease-in-out var(--delay) infinite; }
@keyframes msl-bob { 50% { transform: translateY(var(--lift)); } }

.msl-card {
	position: relative;
	background: rgba(255, 255, 255, .6);
	-webkit-backdrop-filter: blur(18px) saturate(150%);
	backdrop-filter: blur(18px) saturate(150%);
	border: 1px solid rgba(255, 255, 255, .75);
	border-radius: 18px;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 24px 44px -22px rgba(120, 60, 0, .38), 0 4px 14px -6px rgba(120, 60, 0, .12);
	color: var(--msl-ink);
}
.msl.is-js .msl-card, .msl.is-js .msl-toast-slot, .msl.is-js .msl-show__halo { opacity: 0; }
.msl.is-js .msl-toast-slot .msl-card { opacity: 1; }

/* catalogo (al posto del saldo) */
.msl-cat { padding: 18px 18px 16px; }
.msl-cat__top { display: flex; align-items: center; gap: 9px; }
.msl-cat__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--msl-ink); color: var(--ms-white); }
.msl-cat__label { font-size: 12.5px; font-weight: 600; color: var(--msl-ink-700); }
.msl-cat__pill {
	margin-left: auto; padding: 4px 9px; font-size: 10.5px; font-weight: 600; color: var(--msl-ink-700);
	background: rgba(255, 255, 255, .75); border: 1px solid rgba(11, 11, 12, .06); border-radius: 999px;
}
.msl-cat__row { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.msl-cat__amount { font-family: var(--ms-font-display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.msl-cat__amount small { font-family: var(--ms-font-body); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--msl-soft); }
.msl-cat__delta { padding: 3px 8px; font-size: 11px; font-weight: 700; color: #7A4A00; background: rgba(255, 180, 0, .22); border-radius: 999px; }
.msl-cat__reparti { display: flex; justify-content: space-between; align-items: center; height: 74px; }
.msl-cat__rep { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--msl-ink); box-shadow: 0 8px 16px -10px rgba(11, 11, 12, .6); }
.msl-cat__rep img { display: block; }

/* prodotto del catalogo (al posto del pagamento inviato) */
.msl-toast-slot { position: relative; height: 62px; }
.msl-toast { position: absolute; inset: 0; display: flex; align-items: center; gap: 11px; padding: 0 14px 0 11px; border-radius: 16px; }
.msl-toast[hidden] { display: none; }
.msl-toast__avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border-radius: 50%; background: var(--ms-white); box-shadow: 0 0 0 1px rgba(11, 11, 12, .06); }
.msl-toast__avatar img { width: 30px; height: 30px; object-fit: contain; }
.msl-toast__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msl-toast__title { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msl-toast__sub { font-family: var(--ms-font-mono); font-size: 10.5px; color: var(--msl-soft); white-space: nowrap; }
.msl-toast__amount { flex: none; margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 11.5px; font-weight: 700; line-height: 1.25; }
.msl-toast__amount small { font-size: 10.5px; font-weight: 600; color: var(--msl-soft); }

/* spedizione (al posto del tasso di successo) */
.msl-ship { display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; }
.msl-ring { width: 56px; height: 56px; transform: rotate(-90deg); }
.msl-ring__track, .msl-ring__bar { fill: none; stroke-width: 7; }
.msl-ring__track { stroke: rgba(11, 11, 12, .08); }
.msl-ring__bar { stroke: var(--msl-success); stroke-linecap: round; stroke-dasharray: 188.5; stroke-dashoffset: 0; }
.msl-ship__text { display: flex; flex-direction: column; gap: 2px; }
.msl-ship__value { font-family: var(--ms-font-display); font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.msl-ship__label { font-size: 11px; color: var(--msl-soft); }

/* P.IVA verificata (al posto del regolamento istantaneo) */
.msl-pill {
	display: inline-flex; align-items: center; gap: 9px; padding: 7px 16px 7px 7px; overflow: hidden;
	font-size: 12.5px; font-weight: 700; white-space: nowrap; border-radius: 999px;
}
.msl-pill__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--msl-accent); color: var(--ms-white); box-shadow: 0 6px 14px -6px rgba(232, 93, 0, .9); }
/* un riflesso attraversa la pillola ogni pochi secondi */
.msl-pill__shine {
	position: absolute; inset: 0; pointer-events: none; transform: translateX(-120%);
	background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .85) 48%, transparent 66%);
	animation: msl-shine 4.2s ease-in-out 2s infinite;
}
@keyframes msl-shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

/* ---------------- pannello destro ---------------- */

.msl-panel { display: flex; min-height: 0; overflow-y: auto; padding: 40px 24px; overscroll-behavior: contain; }
.msl-panel__inner { width: 100%; max-width: 368px; margin: auto; }
.msl-view { display: none; }
.msl[data-view="login"] .msl-view--login,
.msl[data-view="signup"] .msl-view--signup,
.msl[data-view="otp"] .msl-view--otp { display: block; }
.msl.is-intro [data-late] { opacity: 0; }

.msl-title {
	margin: 0 0 12px; font-family: var(--ms-font-display); font-size: 32px; font-weight: 700;
	line-height: 1.12; letter-spacing: -.03em; color: var(--msl-ink);
}
.msl-title:focus { outline: 0; }
.msl-sub, .msl .ms-b2b-intro { margin: 0 0 26px; font-size: 12.5px; line-height: 1.55; color: var(--msl-soft); }
.msl-sub strong { color: var(--msl-ink); font-weight: 700; }

.msl form.msl-form { display: flex; flex-direction: column; margin: 0; padding: 0; border: 0; }
.msl-field { margin: 0 0 14px; }
.msl-field__top { display: flex; align-items: baseline; justify-content: space-between; }
.msl-label, .msl .form-row label {
	display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--msl-ink);
}
.msl-field__link { font-size: 12px; color: var(--msl-soft); text-decoration: none; transition: color .2s ease; }
@media (hover: hover) and (pointer: fine) { .msl-field__link:hover { color: var(--msl-link-hover); } }

.msl-input-wrap { position: relative; }
.msl input.msl-input, .msl .form-row .input-text, .msl .form-row select {
	display: block; width: 100%; height: 42px; min-height: 0; padding: 0 14px; margin: 0;
	font-family: var(--ms-font-body); font-size: 13px; color: var(--msl-ink);
	background: var(--ms-white); border: 1px solid var(--msl-field); border-radius: 5px; outline: 0;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.msl .form-row select {
	appearance: none; padding-right: 36px; cursor: pointer;
	background: var(--ms-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236C6C70' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.msl .msl-input::placeholder, .msl .input-text::placeholder { color: var(--msl-faint); }
@media (hover: hover) and (pointer: fine) { .msl input.msl-input:hover, .msl .form-row .input-text:hover, .msl .form-row select:hover { border-color: var(--msl-ink-700); } }
.msl input.msl-input:focus, .msl .form-row .input-text:focus, .msl .form-row select:focus { border-color: var(--msl-ink); box-shadow: 0 0 0 4px rgba(11, 11, 12, .06); }
.msl input.msl-input[aria-invalid="true"], .msl .form-row .input-text[aria-invalid="true"] { border-color: var(--msl-danger); box-shadow: 0 0 0 4px rgba(205, 33, 42, .1); }
.msl input.msl-input--pw, .msl .form-row .msl-input--pw { padding-right: 44px; }

.msl-eye {
	position: absolute; top: 5px; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
	background: none; border: 0; border-radius: 6px; color: var(--msl-soft); cursor: pointer; transition: color .2s ease;
}
@media (hover: hover) and (pointer: fine) { .msl-eye:hover { color: var(--msl-ink); } }
.msl-eye__ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.msl-eye__slash { stroke-dasharray: 22; stroke-dashoffset: 0; transition: stroke-dashoffset .25s var(--msl-ease); }
.msl-eye[aria-pressed="true"] .msl-eye__slash { stroke-dashoffset: 22; }

.msl-note { min-height: 18px; margin: 0; padding-top: 6px; font-size: 12px; line-height: 1.45; }
.msl-error, .msl-errors { color: var(--msl-danger); }
.msl-hint { color: var(--msl-soft); font-size: 12px; }

.msl-check { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 12.5px; font-weight: 600; color: var(--msl-ink-700); cursor: pointer; }
.msl-check input, .msl .ms-b2b-consent input { width: 16px; height: 16px; margin: 0; accent-color: var(--msl-ink); }

.msl-errors { margin: 0 0 20px; padding: 12px 14px; font-size: 12.5px; line-height: 1.5; background: rgba(205, 33, 42, .06); border-radius: 6px; }
/* WooCommerce (account-i18n.js) porta il focus sul primo avviso per farlo leggere: non e' un controllo, niente anello */
.msl [role="alert"]:focus { outline: none; }
.msl-errors p, .msl-errors ul { margin: 0; }
.msl-errors ul { padding-left: 18px; margin-top: 4px; }

/* ---------------- registrazione: campi di WooCommerce e di inc/b2b.php nello stile del prototipo ---------------- */

.msl .ms-b2b-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.msl .form-row { display: block; margin: 0 0 14px; }
.msl .ms-b2b-fields .form-row { grid-column: 1 / -1; }
.msl .ms-b2b-fields .form-row-first { grid-column: 1; }
.msl .ms-b2b-fields .form-row-last { grid-column: 2; }
.msl .form-row .required { color: var(--msl-danger); text-decoration: none; border: 0; }
.msl .form-row .optional { font-weight: 500; color: var(--msl-soft); }
.msl .form-row .description, .msl .ms-b2b-fields__note { display: block; margin: 6px 0 0; font-size: 12px; color: var(--msl-soft); }
.msl .ms-b2b-fields__note { grid-column: 1 / -1; margin: -6px 0 14px; }
.msl .ms-b2b-consent label { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 12.5px; font-weight: 500; line-height: 1.5; color: var(--msl-ink-700); }
.msl .ms-b2b-consent input { flex: none; margin-top: 2px; }
.msl .ms-b2b-consent a { color: var(--msl-link); text-decoration: underline; text-underline-offset: 2px; }
.msl .woocommerce-password-strength { margin-top: 6px; font-size: 12px; font-weight: 700; }
.msl .woocommerce-password-hint { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--msl-soft); }
.msl .woocommerce-notices-wrapper:not(:empty) { margin-bottom: 18px; }
.msl .woocommerce-message, .msl .woocommerce-info, .msl .woocommerce-error { margin: 0 0 18px; font-size: 12.5px; }

/* ---------------- pulsante principale ---------------- */

.msl-submit {
	position: relative; width: 100%; height: 42px; margin-top: 10px; display: grid; place-items: center;
	font-family: var(--ms-font-body); font-size: 13.5px; font-weight: 700; color: var(--ms-white);
	background: var(--msl-ink); border: 0; border-radius: 6px; cursor: pointer;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 18px 30px -12px rgba(11, 11, 12, .55);
	transition: transform .2s var(--msl-ease), box-shadow .25s ease, background-color .3s ease;
}
@media (hover: hover) and (pointer: fine) {
	.msl-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 22px 34px -12px rgba(11, 11, 12, .6); }
	.msl-link:hover:not(:disabled) { color: var(--msl-link-hover); text-decoration: underline; text-underline-offset: 3px; }
}
.msl-submit:active:not(:disabled) { transform: translateY(0) scale(.99); }
.msl-submit:focus-visible { outline: 2px solid var(--msl-ink); outline-offset: 3px; }
.msl-submit:disabled { cursor: default; }
.msl-submit:disabled:not(.is-loading):not(.is-success) { opacity: .45; box-shadow: none; cursor: not-allowed; }
.msl-submit__label, .msl-submit__spinner, .msl-submit__check { grid-area: 1 / 1; transition: opacity .2s ease, transform .25s var(--msl-ease); }
.msl-submit__spinner {
	width: 16px; height: 16px; margin-left: -150px; opacity: 0;
	border: 2px solid rgba(255, 255, 255, .3); border-top-color: var(--ms-white); border-radius: 50%;
}
.msl-submit.is-loading .msl-submit__spinner { opacity: 1; animation: msl-spin .7s linear infinite; }
.msl-submit.is-loading .msl-submit__label, .msl-submit.is-success .msl-submit__label { padding-left: 24px; }
.msl-submit__check {
	width: 18px; height: 18px; margin-left: -110px; opacity: 0; transform: scale(.6);
	fill: none; stroke: var(--ms-white); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.msl-submit.is-success { background: var(--msl-success); box-shadow: 0 18px 30px -12px rgba(30, 122, 46, .55); }
.msl-submit.is-success .msl-submit__check { opacity: 1; transform: scale(1); }
@keyframes msl-spin { to { transform: rotate(360deg); } }

.msl-switch { margin: 30px 0 0; text-align: center; font-size: 12px; color: var(--msl-soft); }
.msl-link {
	padding: 0; font: inherit; font-weight: 700; color: var(--msl-link); background: none; border: 0;
	text-decoration: none; cursor: pointer; transition: color .2s ease;
}
.msl-link:disabled { color: var(--msl-faint); font-weight: 600; cursor: not-allowed; }

/* ---------------- codice di conferma ---------------- */

.msl.is-js .msl-otp-single { display: none; }
.msl-otp { position: relative; isolation: isolate; display: flex; gap: 18px; }
.msl-otp[hidden] { display: none; }

/* luce verde dietro la casella rimasta */
.msl-otp::after {
	content: ""; position: absolute; inset: -60px -30px; z-index: -1; pointer-events: none; opacity: 0;
	background: radial-gradient(closest-side, rgba(30, 122, 46, .18), transparent 72%);
	transition: opacity 1s ease-in-out;
}
.msl-otp.is-done::after { opacity: 1; }

/* ogni casella e' una cella: lo sfondo fa da bordo, il campo sta dentro */
.msl-otp__cell {
	position: relative; flex: 0 1 68px; min-width: 0; height: 62px; overflow: hidden;
	border-radius: 8px; background: var(--msl-field); will-change: transform, opacity;
	transition: background-color .2s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) { .msl-otp__cell:hover { background: var(--msl-ink-700); } }
.msl-otp__cell.is-filled { background: var(--msl-ink-700); }
.msl-otp__cell:focus-within { background: var(--msl-ink); box-shadow: 0 0 0 4px rgba(11, 11, 12, .06); }
.msl-otp.is-error .msl-otp__cell { background: var(--msl-danger); box-shadow: 0 0 0 4px rgba(205, 33, 42, .1); }

.msl-otp.is-spin .msl-otp__cell, .msl-otp.is-merge .msl-otp__cell { background: var(--ms-line); box-shadow: 0 0 16px var(--msl-accent-soft); }
/* la luce che gira, nascosta fino alla verifica */
.msl-otp__cell::before {
	content: ""; position: absolute; top: -100%; left: -100%; width: 300%; height: 300%; z-index: 0; opacity: 0; pointer-events: none;
}
.msl-otp.is-spin .msl-otp__cell::before, .msl-otp.is-merge .msl-otp__cell::before {
	opacity: 1;
	background: conic-gradient(from 0deg, transparent 0%, transparent 45%, rgba(232, 93, 0, .25) 62%, #E85D00 80%, #FFB400 90%, #FFFFFF 97%, #E85D00 100%);
	animation: msl-spin 1s linear infinite;
}

.msl input.msl-otp__box, .msl input.msl-otp__box:focus {
	position: absolute; inset: 1px; z-index: 1; width: calc(100% - 2px); height: calc(100% - 2px); min-height: 0; padding: 0; box-shadow: none;
	text-align: center; font-family: var(--ms-font-display); font-size: 22px; font-weight: 700; color: var(--msl-ink);
	background: var(--ms-white); border: 0; border-radius: 6px; outline: 0; caret-color: var(--msl-accent);
	transition: color .2s ease, background-color .3s ease;
}
.msl .msl-otp__cell.is-filled .msl-otp__box { animation: msl-digit .28s var(--msl-spring); }
.msl--staff .msl-otp__cell.is-filled .msl-otp__box { animation: none; } /* 2FA: si scrive in fretta, niente pop */
.msl .msl-otp.is-spin .msl-otp__box, .msl .msl-otp.is-merge .msl-otp__box { inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); border-radius: 5px; }
@keyframes msl-digit { 50% { transform: scale(1.08); } }
.msl .msl-otp.is-merge .msl-otp__box, .msl .msl-otp.is-done .msl-otp__box { color: transparent; }
.msl-otp.is-done .msl-otp__cell:first-child { background: var(--msl-success); box-shadow: 0 10px 26px -8px rgba(30, 122, 46, .7); }
.msl .msl-otp.is-done .msl-otp__cell:first-child .msl-otp__box { background: linear-gradient(145deg, #2E9A40, #1E7A2E); }
.msl-otp__tick {
	position: absolute; top: 50%; left: 50%; z-index: 3; width: 26px; height: 26px; margin: -13px 0 0 -13px; opacity: 0;
	fill: none; stroke: var(--ms-white); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.msl-otp__tick path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.msl-otp-note { min-height: 0; }
.msl-otp-note:empty { padding: 0; }

.msl-otp-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 6px; font-size: 12px; color: var(--msl-soft); }
.msl-otp-meta strong { font-weight: 700; color: var(--msl-ink); font-variant-numeric: tabular-nums; }

/* ---------------- Orb guida ---------------- */

.msl-orb { position: absolute; top: 0; left: 0; z-index: 3; width: 84px; height: 84px; pointer-events: none; opacity: 0; will-change: transform; }
.msl-orb__hop { width: 100%; height: 100%; }
.msl-orb__body {
	position: relative; width: 100%; height: 100%; border-radius: 50%;
	background:
		radial-gradient(circle at 50% 108%, rgba(255, 247, 222, 1) 0 13%, rgba(255, 222, 140, .75) 26%, transparent 52%),
		radial-gradient(circle at 33% 22%, rgba(255, 251, 236, .92) 0 8%, rgba(255, 228, 160, .42) 28%, transparent 54%),
		radial-gradient(circle at 50% 44%, #FFC21F 0 32%, #FFA200 60%, #E85D00 100%);
	box-shadow: 0 18px 34px -16px rgba(232, 93, 0, .5), inset 0 -12px 22px rgba(255, 238, 196, .55), inset 0 8px 18px rgba(255, 255, 255, .22);
}
.msl-orb__pulse {
	position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
	border: 2px solid rgba(232, 93, 0, .85); box-shadow: 0 0 22px rgba(255, 180, 0, .55);
}
.msl-orb__eye {
	position: absolute; top: 33%; left: 32%; width: 7.5px; height: 21px; margin-left: -3.5px;
	border-radius: 4px; background: var(--msl-ink);
}
.msl-orb__eye--right { left: 68%; }
.msl-orb__joy, .msl-orb__tickeye, .msl-orb__smile { position: absolute; fill: none; stroke: var(--msl-ink); stroke-linecap: round; opacity: 0; }
.msl-orb__joy { top: 35%; left: 32%; width: 17px; height: 11px; margin-left: -8.5px; stroke-width: 1.9; }
.msl-orb__tickeye { top: 33%; left: 32%; width: 17px; height: 17px; margin-left: -8.5px; stroke-width: 2.4; stroke-linejoin: round; }
.msl-orb__tickeye path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.msl-orb__joy--right, .msl-orb__tickeye--right { left: 68%; }
.msl-orb__smile { bottom: 25%; left: 50%; width: 20px; height: 10px; margin-left: -10px; stroke-width: 2.8; opacity: .95; }
.msl-orb__bubble {
	position: absolute; bottom: calc(100% + 12px); left: 50%; translate: -50% 0; padding: 8px 14px; white-space: nowrap;
	font-size: 13px; font-weight: 700; color: var(--ms-white); background: var(--msl-ink); border-radius: 999px;
	box-shadow: 0 10px 24px -10px rgba(11, 11, 12, .7);
}
.msl-orb__bubble::after {
	content: ""; position: absolute; top: 100%; left: 50%; translate: -50% -2px;
	border: 6px solid transparent; border-top-color: var(--msl-ink);
}
.msl-orb__confetti { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
.msl-orb__bit { position: absolute; top: -3px; left: -5px; width: 10px; height: 6px; border-radius: 2px; }
.msl-orb__bit--round { width: 7px; height: 7px; border-radius: 50%; }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
	.msl { padding: 0; }
	.msl-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; height: auto; border-radius: 0; box-shadow: none; }
	.msl-hero { min-height: 300px; padding: 22px 24px 26px; }
	.msl h2.msl-hero__title { font-size: 24px; }
	.msl-show { display: none; }
	.msl-panel { overflow: visible; padding: 32px 16px 40px; }
	.msl-panel__inner { margin: 0 auto; }
}
@media (max-width: 420px) {
	.msl-title { font-size: 28px; }
	.msl-otp { gap: 12px; }
	.msl .ms-b2b-fields { grid-template-columns: minmax(0, 1fr); }
	.msl .ms-b2b-fields .form-row-first, .msl .ms-b2b-fields .form-row-last { grid-column: 1; }
}

/* ==========================================================================
   Login dello staff (wp-login.php, /accesso-staff/): moduli di WordPress e del plugin Two Factor nello stile del pannello.
   Involucro e titoli da inc/security.php. Selettori con #login per superare login.css di WordPress.
   ========================================================================== */

body.login.ms-staff { min-width: 0; background: var(--ms-line); }
.msl--staff { --msl-head: 0px; min-height: 100vh; }
.msl[data-view="staff"] .msl-view--staff { display: block; }
.msl--staff #login { width: auto; margin: 0; padding: 0; }
.msl--staff #login .wp-login-logo { display: none; } /* il logo e' nel pannello sinistro */
.msl--staff #login form { margin: 0; padding: 0; overflow: visible; background: none; border: 0; box-shadow: none; font-weight: 400; }
.msl--staff #login form p, .msl--staff #login .user-pass-wrap { margin: 0 0 14px; }
.msl--staff #login label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--msl-ink); }
.msl--staff #login form .input, .msl--staff #login input[type="text"], .msl--staff #login input[type="password"], .msl--staff #login input[type="email"] {
	display: block; width: 100%; height: 42px; min-height: 0; max-height: none; padding: 0 14px; margin: 0;
	font-family: var(--ms-font-body); font-size: 13px; line-height: normal; color: var(--msl-ink);
	background: var(--ms-white); border: 1px solid var(--msl-field); border-radius: 5px; box-shadow: none; outline: 0;
	transition: border-color .2s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) { .msl--staff #login form .input:hover { border-color: var(--msl-ink-700); } }
.msl--staff #login form .input:focus, .msl--staff #login input[type="text"]:focus, .msl--staff #login input[type="password"]:focus {
	border-color: var(--msl-ink); box-shadow: 0 0 0 4px rgba(11, 11, 12, .06);
}
.msl--staff #login .wp-pwd { position: relative; }
.msl--staff #login .wp-pwd .input { padding-right: 44px; }
.msl--staff #login .button.wp-hide-pw {
	position: absolute; top: 5px; right: 6px; width: 32px; height: 32px; min-height: 0; padding: 0; margin: 0;
	display: grid; place-items: center; background: none; border: 0; border-radius: 6px; box-shadow: none; color: var(--msl-soft);
}
@media (hover: hover) and (pointer: fine) { .msl--staff #login .button.wp-hide-pw:hover { color: var(--msl-ink); } }
.msl--staff #login .button.wp-hide-pw:focus-visible { outline: 2px solid var(--msl-ink); outline-offset: 0; }
.msl--staff #login .button.wp-hide-pw .dashicons { position: static; width: 18px; height: 18px; font-size: 18px; color: currentColor; }
.msl--staff #login .forgetmenot { float: none; display: flex; align-items: center; gap: 8px; margin: 2px 0 0; }
.msl--staff #login .forgetmenot label { display: inline; margin: 0; font-weight: 600; color: var(--msl-ink-700); }
.msl--staff #login input[type="checkbox"] { width: 16px; height: 16px; min-width: 0; margin: 0; accent-color: var(--msl-ink); }

/* pulsante: come .msl-submit (e' un <input>, la rotella sta sul paragrafo) */
.msl--staff #login .submit { position: relative; float: none; clear: both; margin: 10px 0 0; padding: 0; }
.msl--staff #login .submit .button-primary {
	float: none; width: 100%; height: 42px; min-height: 0; padding: 0; margin: 0;
	font-family: var(--ms-font-body); font-size: 13.5px; font-weight: 700; line-height: 42px; color: var(--ms-white); text-shadow: none;
	background: var(--msl-ink); border: 0; border-radius: 6px; cursor: pointer;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 18px 30px -12px rgba(11, 11, 12, .55);
	transition: transform .2s var(--msl-ease), box-shadow .25s ease, opacity .2s ease;
}
@media (hover: hover) and (pointer: fine) {
	.msl--staff #login .submit .button-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 22px 34px -12px rgba(11, 11, 12, .6); }
}
.msl--staff #login .submit .button-primary:active:not(:disabled) { transform: translateY(0) scale(.99); }
.msl--staff #login .submit .button-primary:focus-visible { outline: 2px solid var(--msl-ink); outline-offset: 3px; box-shadow: none; }
.msl--staff #login .submit.is-loading .button-primary, .msl--staff #login .submit .button-primary:disabled { opacity: 1; color: var(--ms-white); background: var(--msl-ink); }
.msl--staff #login .submit.is-loading .button-primary { text-indent: 24px; }
.msl--staff #login .submit.is-loading::before {
	content: ""; position: absolute; top: 13px; left: calc(50% - 60px); z-index: 1; width: 16px; height: 16px; pointer-events: none;
	border: 2px solid rgba(255, 255, 255, .3); border-top-color: var(--ms-white); border-radius: 50%;
	animation: msl-spin .7s linear infinite;
}

/* pulsanti secondari di WordPress (es. "Genera password") */
.msl--staff #login .button-secondary:not(.wp-hide-pw) {
	min-height: 0; height: 36px; padding: 0 14px; font-family: var(--ms-font-body); font-size: 12.5px; font-weight: 700; line-height: 34px;
	color: var(--msl-ink); background: var(--ms-white); border: 1px solid var(--msl-field); border-radius: 6px; box-shadow: none;
}
@media (hover: hover) and (pointer: fine) { .msl--staff #login .button-secondary:not(.wp-hide-pw):hover { border-color: var(--msl-ink); color: var(--msl-ink); } }
.msl--staff #login #pass-strength-result { margin: 6px 0 0; padding: 6px 10px; border-radius: 5px; font-weight: 700; color: var(--msl-ink); }

/* avvisi di WordPress (errore, disconnessione, email inviata) */
.msl--staff #login .notice, .msl--staff #login .message, .msl--staff #login #login_error {
	margin: 0 0 18px; padding: 12px 14px; font-size: 12.5px; line-height: 1.5; color: var(--msl-ink-700);
	background: var(--ms-surface); border: 0; border-radius: 6px; box-shadow: none;
}
.msl--staff #login #login_error, .msl--staff #login .notice-error { color: var(--msl-danger); background: rgba(205, 33, 42, .06); }
.msl--staff #login .notice p, .msl--staff #login .message p, .msl--staff #login #login_error p { margin: 0; padding: 0; }
.msl--staff #login .notice a, .msl--staff #login .message a { color: var(--msl-link); font-weight: 700; }
.msl--staff #login .description, .msl--staff #login .indicator-hint, .msl--staff #login #pass-strength-result { font-size: 12px; color: var(--msl-soft); }

/* link sotto il modulo */
.msl--staff #nav, .msl--staff #backtoblog, .msl--staff .privacy-policy-page-link { margin: 18px 0 0; padding: 0; text-align: center; font-size: 12px; color: var(--msl-soft); }
.msl--staff #backtoblog { margin-top: 10px; }
.msl--staff #nav a { font-weight: 700; color: var(--msl-link); }
.msl--staff #backtoblog a, .msl--staff .privacy-policy-page-link a { color: var(--msl-soft); }
@media (hover: hover) and (pointer: fine) {
	.msl--staff #nav a:hover, .msl--staff #backtoblog a:hover, .msl--staff .privacy-policy-page-link a:hover { color: var(--msl-link-hover); text-decoration: underline; text-underline-offset: 3px; }
}

/* verifica in due passaggi: le caselle del codice (access.js), 6 per app ed email, 8 per i codici di backup */
.msl--staff #login .two-factor-prompt { margin: 0 0 22px; font-size: 12.5px; line-height: 1.55; color: var(--msl-soft); }
.msl--staff .msl-otp { gap: 10px; }
.msl--staff .msl-otp__cell { flex: 1 1 0; height: 56px; }
.msl--staff #login .two-factor-email-resend { margin: 14px 0 0; text-align: center; }
.msl--staff #login .two-factor-email-resend .button {
	min-height: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--msl-link);
	background: none; border: 0; box-shadow: none; cursor: pointer;
}
.msl--staff .backup-methods-wrap { margin: 26px 0 0; padding: 0; text-align: center; font-size: 12px; color: var(--msl-soft); }
.msl--staff .backup-methods-wrap p { margin: 0 0 6px; }
.msl--staff .backup-methods-wrap ul { margin: 0; padding: 0; list-style: none; }
.msl--staff .backup-methods-wrap li { margin: 4px 0 0; }
.msl--staff .backup-methods-wrap a { font-weight: 700; color: var(--msl-link); }

@media (max-width: 900px) {
	.msl--staff { min-height: 0; }
}

/* Movimento ridotto: niente volo, niente galleggiamento; restano solo i cambi di stato */
@media (prefers-reduced-motion: reduce) {
	.msl-hero__blob, .msl-bob, .msl-pill__shine { animation: none; }
	.msl-otp.is-spin .msl-otp__cell::before, .msl-otp.is-merge .msl-otp__cell::before { animation: none; opacity: 0; }
	.msl .msl-otp__cell.is-filled .msl-otp__box { animation: none; }
	/* restano le dissolvenze (etichetta, rotella, spunta del pulsante; colori): via solo gli spostamenti */
	.msl-submit, .msl--staff #login .submit .button-primary { transition-property: box-shadow, background-color, opacity; }
	.msl-submit:hover:not(:disabled), .msl-submit:active:not(:disabled),
	.msl--staff #login .submit .button-primary:hover:not(:disabled), .msl--staff #login .submit .button-primary:active:not(:disabled) { transform: none; }
	.msl-submit__label, .msl-submit__spinner, .msl-submit__check { transition-property: opacity; }
}

/* Pausa delle animazioni continue (pulsante nel pannello sinistro, WCAG 2.2.2) */
.msl-pause { position: absolute; top: 28px; right: 32px; z-index: 2; background: rgba(255, 255, 255, .6); border-color: rgba(11, 11, 12, .12); }
.msl.is-paused .msl-hero *, .msl.is-paused .msl-hero *::before, .msl.is-paused .msl-hero *::after { animation-play-state: paused !important; }
