/* =====================================================================
 * Sphere — Site Layout 2.0
 * Refactor di sp-site-layout-1.1.css (2326 righe → ~modernizzato vanilla)
 * Drop-in compatibile: stessi selettori sp-*, .fen-*, .sphere-* del 1.1
 * Modernizzazione interna:
 *   - CSS custom properties calcolate dai placeholder Sphere
 *   - Vendor prefix puliti (drop -moz/-webkit/-ms obsoleti)
 *   - Transizioni più snappy (0.5s → 0.2s dove sensato)
 *   - focus-visible (no outline:none generico, accessibility-safe)
 *   - gap dove possibile invece di margin tricks
 *   - Logical properties (margin-inline, padding-block) dove leggibile
 * 2026-05-14
 * 2026-05-19 — refactor: rimosse sezioni admin (10, 11, 15, 16, 17) e
 *   placeholder #f08aa0, #1f7a55, 260px. Vedi
 *   /home/jerda/dev/sitebasic/refactor-sp-site-layout-2.0-notes.md
 *   Backup: /home/jerda/dev/sitebasic/sp-site-layout-2.0.css.bak.20260519
 *
 * @placeholders: #50acbc, #34d1ea, #00fff8,
 *                #ffffff, #fafafa, #0a1521,
 *                #000000, #b2b2b2, #ef0000,
 *                #1f7a55, #9a7320,
 *                Montserrat, 5px, 15px, 30px
 * ===================================================================== */

/* =====================================================================
 * 1. Theming — variabili CSS calcolate dai placeholder Sphere
 * ===================================================================== */
:root {
	/* Colori brand (placeholder Sphere → CSS vars) */
	--sp-primary:    #50acbc;
	--sp-secondary:  #34d1ea;
	--sp-tertiary:   #00fff8;
	--sp-default:    #000000;
	--sp-contrast:   #ffffff;
	--sp-background: #fafafa;
	--sp-footer:     #0a1521;
	--sp-muted:      #b2b2b2;
	--sp-danger:     #ef0000;
	--sp-success:    #1f7a55;
	--sp-warning:    #9a7320;
	/* Tipografia */
	--sp-font: Montserrat, system-ui, -apple-system, Segoe UI, sans-serif;
	/* Spacing */
	--sp-unit:    15px;
	--sp-unit-l:  30px;
	--sp-unit-s:  5px;
	--sp-unit-xl: calc(var(--sp-unit-l, 16px) * 2);
	/* Motion */
	--sp-ease:      cubic-bezier(.2, .7, .2, 1);
	--sp-ease-out:  cubic-bezier(0, 0, .2, 1);
	--sp-tr-fast:   .15s;
	--sp-tr:        .25s;
	--sp-tr-slow:   .5s;
	/* Surfaces */
	--sp-radius-sm: 4px;
	--sp-radius:    6px;
	--sp-radius-lg: 12px;
	--sp-shadow-1:  0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
	--sp-shadow-2:  0 4px 16px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
	--sp-shadow-3:  0 14px 40px rgba(0,0,0,.14), 0 4px 8px rgba(0,0,0,.08);
	/* Focus ring */
	--sp-focus: 0 0 0 3px color-mix(in srgb, var(--sp-primary, #0066cc) 35%, transparent);
}

/* =====================================================================
 * 2. Reset / base
 * ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
	margin: 0;
	min-height: 100vh;
	background-color: var(--sp-background, #ffffff);
	color: var(--sp-default, #333333);
	font-family: var(--sp-font, system-ui, -apple-system, Segoe UI, sans-serif);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
html { height: 100vh; }

a { text-decoration: none; color: var(--sp-primary, #0066cc); }
a:hover { color: var(--sp-secondary, #4d4d4d); }

img, svg, video { display: block; max-width: 100%; }

/* Accessibility-safe focus: no outline su mouse, visibile su keyboard */
:focus { outline: none; }
:focus-visible {
	outline: none;
	box-shadow: var(--sp-focus, 0 0 0 3px rgba(0,102,204,.35));
}

select { margin-left: -4px; }
select:-moz-focusring { color: transparent; text-shadow: 0 0 0 var(--sp-default, #333333); }

input:focus:invalid,
select:focus:invalid,
textarea:focus:invalid { box-shadow: none; }

input:invalid,
select:invalid,
textarea:invalid,
.sphereEditable.invalid {
	box-shadow: 0 4px var(--sp-unit-s, 4px) calc(var(--sp-unit-s, 4px) * -1) var(--sp-danger, #d32f2f);
}

div:not('.editor') ul { margin: 0; padding: 0; }
table ul { margin: 0; }
tr .sp-button { white-space: nowrap; }

mark {
	margin: 0 -0.4em;
	padding: 0.1em 0.4em;
	border-radius: 0.8em 0.3em;
	background: transparent;
	background-image: linear-gradient(to right,
		rgba(255, 225, 0, 0.1),
		rgba(255, 225, 0, 0.7) 4%,
		rgba(255, 225, 0, 0.3)
	);
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

::selection {
	color: var(--sp-contrast, #ffffff);
	background-color: var(--sp-primary, #0066cc);
}

/* =====================================================================
 * 3. Global data-* helpers (cursor / formatting)
 * ===================================================================== */
[data-fiscode] { text-transform: uppercase; }
[data-page]    { cursor: pointer !important; }
[data-mailto]  { cursor: pointer; }
[data-tel]     { cursor: pointer; }
[data-orderable] {
	cursor: pointer;
	white-space: nowrap;
	transition: color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), transform var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
[data-sphere], [data-control], [data-panel], [data-desk], [data-callback], [data-slider] {
	cursor: pointer;
}

/* =====================================================================
 * 4. Loader / state
 * ===================================================================== */
.splwrapper, .sp-loader {
	width: 100%;
	height: 100vh;
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: color-mix(in srgb, var(--sp-background, #ffffff) 51%, transparent);
	display: none;
}
.sp-loader.is-on, .splwrapper.is-on { display: block; }

.sploader, .sp-loader-spinner {
	border: var(--sp-unit-s, 4px) solid color-mix(in srgb, var(--sp-muted, #cccccc) 67%, transparent);
	border-top: var(--sp-unit-s, 4px) solid var(--sp-primary, #0066cc);
	border-radius: 50%;
	width: var(--sp-unit-l, 16px);
	height: var(--sp-unit-l, 16px);
	animation: spin 1.5s linear infinite;
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
}

@keyframes spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =====================================================================
 * 5. Menu (header dropdown)
 * ===================================================================== */
.sp-menu-item {
	color: var(--sp-primary, #0066cc);
	cursor: pointer;
	text-transform: uppercase;
	margin: 0 var(--sp-unit, 8px);
}
.sp-menu-item:last-child { margin-right: 0; }

.sp-menu-item:hover .sp-menu-item-nested {
	visibility: visible;
	opacity: 1;
}

.sp-menu-item-nested {
	position: absolute;
	list-style-type: none;
	padding: var(--sp-unit, 8px);
	margin: 0;
	background: color-mix(in srgb, var(--sp-contrast, #ffffff) 97%, transparent);
	visibility: hidden;
	opacity: 0;
	transition: opacity var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), visibility var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
	box-shadow: var(--sp-shadow-1, 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08));
	border-radius: var(--sp-radius-sm, 4px);
}
.sp-menu-item-nested .sp-menu-item-label { margin: 0; }
.sp-menu-item-nested li { margin: 0 0 var(--sp-unit-s, 4px); }
.sp-menu-item-nested li:last-child { margin: 0; }

.sp-menu-item-icon { margin-right: calc(var(--sp-unit, 8px) / 3); }
.sp-footer-menu-item { width: 100%; }
.sp-footer-logo { max-height: 3rem; }
.sp-logo { max-height: calc(var(--sp-unit-l, 16px) * 1.5); }

/* =====================================================================
 * 6. Text utilities (colors, alignment, weight)
 * ===================================================================== */
.sp-text-primary   { color: var(--sp-primary, #0066cc);   transition: color var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-text-secondary { color: var(--sp-secondary, #4d4d4d); transition: color var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-text-tertiary  { color: var(--sp-tertiary, #888888);  transition: color var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-text-muted     { color: var(--sp-muted, #cccccc);     transition: color var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-text-danger    { color: var(--sp-danger, #d32f2f) !important;  transition: color var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-text-warning   { color: var(--sp-warning, #ed6c02) !important; transition: color var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-text-success   { color: var(--sp-success, #2e7d32);   transition: color var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-contrast,
.sphere-desk-active { color: var(--sp-contrast, #ffffff); }

.sp-text-center { text-align: center; }
.sp-text-left   { text-align: left; }
.sp-text-right  { text-align: right; }
.sp-text-large  { font-size: 1.5rem; }
.sp-text-bold   { font-size: 1.05em; font-weight: 500; }
.sp-text-italic { font-style: italic; }
.sp-text-h      { min-height: 2rem; }
.nobr           { white-space: nowrap; }

/* =====================================================================
 * 7. Spacing utilities (margin / padding)
 * ===================================================================== */
.sp-padding         { padding: var(--sp-unit, 8px); }
.sp-padding-s       { padding: var(--sp-unit-s, 4px) calc(var(--sp-unit-s, 4px) * 2); }
.sp-padding-l       { padding: var(--sp-unit-l, 16px) calc(var(--sp-unit-l, 16px) * 2); }
.sp-padding-r       { padding-right: var(--sp-unit, 8px); }
.sp-padding-rl      { padding-right: calc(var(--sp-unit, 8px) * 2); }
.sp-no-padding-b    { padding-bottom: 0 !important; }

.sp-margin-b   { margin-bottom: var(--sp-unit, 8px); }
.sp-margin-bl  { margin-bottom: var(--sp-unit-l, 16px); }
.sp-margin-bs  { margin-bottom: var(--sp-unit-s, 4px); }
.sp-margin-t   { margin-top: var(--sp-unit, 8px); }
.sp-margin-tl  { margin-top: var(--sp-unit-l, 16px); }
.sp-margin-tld { margin-top: calc(var(--sp-unit-l, 16px) * 2); }
.sp-margin-tll { margin-top: calc(var(--sp-unit-l, 16px) * 2); }
.sp-margin-ts  { margin-top: var(--sp-unit-s, 4px); }
.sp-margin-r   { margin-right: var(--sp-unit, 8px); }
.sp-margin-rl  { margin-right: var(--sp-unit-l, 16px); }
.sp-margin-rs  { margin-right: var(--sp-unit-s, 4px); }
.sp-margin-l   { margin-left: var(--sp-unit, 8px); }
.sp-margin-ll  { margin-left: var(--sp-unit-l, 16px); }
.sp-margin-ls  { margin-left: var(--sp-unit-s, 4px); }

/* =====================================================================
 * 8. Width helpers
 * ===================================================================== */
.sp-full-width { width: 100%; }
.sp-half-width { width: 50%; }
.sp-20u        { width: calc(var(--sp-unit, 8px) * 20); }

/* =====================================================================
 * 9. Flex utilities
 * ===================================================================== */
.sp-flex                          { display: flex; }
.sp-flex-wrap                     { flex-wrap: wrap; }
.sp-flex-space-between            { justify-content: space-between; }
.sp-flex-space-evenly             { justify-content: space-evenly; }
.sp-flex-space-around             { justify-content: space-around; }
.sp-flex-center                   { justify-content: center; }
.sp-flex-end                      { justify-content: flex-end; }
.sp-flex-column                   { flex-direction: column; }
.sp-flex-cross-center             { align-items: center; }
.sp-flex-cross-baseline           { align-items: baseline; }
.sp-flex-cross-start              { align-items: flex-start; }
.sp-flex-cross-end                { align-items: flex-end; }
.sp-flex-crossrows-start          { align-content: flex-start; }
.sp-flex-crossrows-end            { align-content: flex-end; }
.sp-flex-crossrows-space-between  { align-content: space-between; }
.sp-flex-crossrows-space-around   { align-content: space-around; }
.sp-flex-self-start               { align-self: flex-start; }
.sp-flex-self-end                 { align-self: flex-end; }
.sp-flex-self-center              { align-self: center; }
.sp-flex-self-space-between       { align-self: space-between; }
.sp-flex-self-space-around        { align-self: space-around; }
.sp-flex-item-grow                { flex-grow: 1; }
.sp-flex-grow > *                 { flex-grow: 1; flex-basis: 0; }
.sp-gap                           { gap: 2rem; }

.disable-selection {
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

/* =====================================================================
 * 12. Dialog system (sphere-dialog)
 * ===================================================================== */
.sphere-dialog {
	opacity: 0;
	min-width: 40%;
	max-width: 100%;
	min-height: 10%;
	z-index: 1;
	background: var(--sp-background, #ffffff);
	box-shadow: var(--sp-shadow-2, 0 4px 16px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06));
	overflow: hidden;
	resize: both;
	transition: transform .1s ease, opacity .2s ease, height .1s ease, width .1s ease;
}
#sp-dialog { display: none; }

.sp-dialog-handle { cursor: move; }
.pause-drag .sp-dialog-handle { cursor: default; }

/* Header dialog: solo COLORI (niente cambi di layout → drag e icona espandi restano operativi).
 * Stessa sfumatura della topbar del sito (primary→secondary) per coerenza brand. */
.sp-dialog-header {
	text-shadow: 0 0;
	background: linear-gradient(90deg, var(--sp-primary, #4ec3c8) 0%, var(--sp-secondary, #3da8ad) 100%);
	color: var(--sp-contrast, #ffffff);
	padding: var(--sp-unit-s, 4px);
}
.sphere-dialog-icon { color: var(--sp-contrast, #ffffff); }

.sphere-dialog-controls { color: var(--sp-contrast, #ffffff); }
.sphere-dialog-controls > * {
	margin: 0 var(--sp-unit-s, 4px);
	cursor: pointer;
}
.sphere-dialog-controls > *:first-child { margin: 0 var(--sp-unit-s, 4px) 0 0; }
.sphere-dialog-controls > *:last-child  { margin: 0 0 0 var(--sp-unit-s, 4px); }
.sphere-dialog-controls > *:hover       { color: var(--sp-contrast, #ffffff); opacity: 0.75; }

.sphere-dialog-content {
	height: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	max-height: 90vh;
}
.sphere-dialog-dash .sphere-dialog-content { max-height: 100%; }
.sphere-dialog-max  .sphere-dialog-content { max-height: 98vh; }
.sphere-dialog-content > * { box-sizing: border-box; }

.sphere-dialog-max { transform: none !important; }
.sphere-dialog-dash { box-shadow: none; }
.sphere-dialog-blank { background: none; box-shadow: none; }

.sphere-dialog-icon, .sphere-panel-icon { margin-right: var(--sp-unit-s, 4px); }
.sphere-icon-large { font-size: var(--sp-unit-l, 16px); }

[draggable] > .sphere-dialog-head { cursor: move; }

/* =====================================================================
 * 13. Modal
 * ===================================================================== */
.sp-modal {
	position: fixed;
	inset: 0 auto auto 0;
	width: 100%;
	background: rgba(0, 0, 0, 0.8);
	opacity: 0;
	transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
	z-index: 100;
}
.sp-modal-close {
	position: absolute;
	padding: var(--sp-unit, 8px);
	color: #fff;
	top: 0; right: 0;
	cursor: pointer;
}
.sp-modal-content {
	height: 100%;
	overflow: auto;
}
.sp-modal-content > img { max-height: 90vh; }
.sp-modal-content > .sp-main-content-content,
.sp-modal-content > .sp-des-page {
	background-color: var(--sp-contrast, #ffffff);
	margin: 0 calc(var(--sp-unit-l, 16px) * 10);
	padding: var(--sp-unit-l, 16px) calc(var(--sp-unit-l, 16px) * 5);
}
.sp-modal-content > .sp-main-content-content ~ .sp-des-page { margin-top: 0; }
.sp-modal-content > .sp-main-content-content { padding-bottom: 0; }
.sp-modal-content .sp-main-content-content h1 { margin-bottom: var(--sp-unit-l, 16px); }

/* /cookie-settings standalone (F5 sulla page = niente modal wrapper).
 * Layout pulito: max-width centrato, padding-top per non finire sotto header sticky,
 * pulsantiera con gap visibile. Lo styling dei bottoni .sp-public-desbar > .sp-button è
 * già scoped a .sp-des-page → funziona sia dentro modal sia fuori. */
body:not(.sp-modal-open) #sp-main-content > .sp-main-content-content,
body:not(.sp-modal-open) #sp-main-content > .sp-des-page {
	max-width: 880px;
	margin: 0 auto;
	padding: calc(var(--sp-unit, 8px) * 2) calc(var(--sp-unit, 8px) * 3);
}
body:not(.sp-modal-open) #sp-main-content > .sp-main-content-content {
	padding-top: calc(var(--sp-unit, 8px) * 12);
}
body:not(.sp-modal-open) #sp-main-content > .sp-main-content-content h1 {
	font-size: 1.8rem;
	margin-bottom: calc(var(--sp-unit, 8px) * 2);
	text-align: left;
}
#sp-main-content > .sp-des-page .des { padding: 0; }
#sp-main-content > .sp-des-page .sp-public-desbar {
	margin-top: calc(var(--sp-unit, 8px) * 3);
	padding-bottom: calc(var(--sp-unit, 8px) * 6);
}

/* Cookie Banner v1 — pulsantiera modal /cookie-settings (publicDesBar):
 * allineata al design system .sp-tpl-btn (padding/radius/weight identici).
 * Outline neutro di default; primary turchese su data-control closeCookieBanner (Accetta tutti)
 * e cookieDes (Conferma le mie scelte). */
.sp-des-page .sp-public-desbar > .sp-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	padding: 13px 26px;
	border-radius: var(--sp-tpl-r-sm, 4px);
	background: transparent;
	color: #1a1a1a;
	border: 1px solid var(--sp-tpl-line, #d1d5db);
	margin-left: var(--sp-unit-s, 4px);
}
.sp-des-page .sp-public-desbar > .sp-button:hover {
	background: rgba(0, 0, 0, 0.03);
	border-color: #6b7280;
	color: #1a1a1a;
	transform: translateY(-1px);
}
.sp-des-page .sp-public-desbar > .sp-button:active {
	background: rgba(0, 0, 0, 0.06);
	color: #1a1a1a;
	transform: scale(0.97);
}
.sp-des-page .sp-public-desbar > .sp-button::before,
.sp-des-page .sp-public-desbar > .sp-button::after { display: none; }
.sp-des-page .sp-public-desbar > .sp-button[data-control="cookieDes"],
.sp-des-page .sp-public-desbar > .sp-button[data-control="closeCookieBanner"] {
	background: var(--sp-primary, #4ec3c8);
	color: var(--sp-tpl-navy-0, #0e1d2b);
	border-color: var(--sp-primary, #4ec3c8);
}
.sp-des-page .sp-public-desbar > .sp-button[data-control="cookieDes"]:hover,
.sp-des-page .sp-public-desbar > .sp-button[data-control="closeCookieBanner"]:hover {
	background: var(--sp-secondary, #3da8ad);
	color: var(--sp-tpl-navy-0, #0e1d2b);
	border-color: var(--sp-secondary, #3da8ad);
	transform: translateY(-1px);
}

.sp-main-content-content ~ .sp-des-page {
	margin-top: calc(var(--sp-unit-l, 16px) * -3);
	margin-bottom: calc(var(--sp-unit-l, 16px) * 3);
}

.sp-des-page { padding: 0 calc(30px * 10); }

/* =====================================================================
 * 14. Gallery
 * ===================================================================== */
.sp-gal-nav {
	padding: var(--sp-unit, 8px);
	color: #fff;
	cursor: pointer;
	font-size: 3rem;
	z-index: 1;
}
.sp-gal-prev { position: absolute; left: 0; }
.sp-gal-next { position: absolute; right: 0; }
.sp-gal-in   { opacity: 0; }
[data-galcur] {
	transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), transform var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
	position: absolute;
}

/* =====================================================================
 * 18. Context menu
 * ===================================================================== */
.context-menu {
	transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
	opacity: 0;
	display: none;
	position: fixed;
	z-index: 999;
}
.context-item, .context-center {
	opacity: 0;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	padding: 5px 6px;
	border-radius: 50%;
	font-size: 1.5em;
	box-shadow: 0 0 4px;
}
.context-item   { transition: opacity .8s var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.context-center { transition: opacity .2s var(--sp-ease, cubic-bezier(.2,.7,.2,1)); opacity: 1; font-size: 1em; padding: 10px; }

/* =====================================================================
 * 19. Scale effects
 * ===================================================================== */
.sp-scale { transition: transform .2s var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-scale:hover { transform: scale(1.05); }

.sp-preview {
	max-width: 100px;
	max-height: 50px;
	display: inline-block;
	transition: transform .2s var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-preview:hover { transform: scale(2); }

/* =====================================================================
 * 20. Editable rich text (WYSIWYG)
 * ===================================================================== */
.sphereEditable {
	min-height: 150px;
	overflow: auto;
	padding: var(--sp-unit-s, 4px);
	resize: vertical;
	outline: none;
	transition: background var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), color var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-editor { transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), height var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }

/* =====================================================================
 * 21. Table
 * ===================================================================== */
.sp-table-container { overflow-x: auto; }
.sp-table-status    { width: 20%; z-index: 0 !important; }

.sp-table table {
	border-collapse: collapse;
	cursor: default;
}
.sp-table table td,
.sp-table table th {
	padding: var(--sp-unit-s, 4px) 0;
	border-bottom: 1px solid #ddd;
	max-width: 20%;
}
.sphere-dialog .sp-table table td,
.sphere-dialog .sp-table table th { padding: var(--sp-unit-s, 4px); }

.sp-table table.contrast thead tr {
	background-color: var(--sp-background, #ffffff);
	color: var(--sp-primary, #0066cc);
}
.sp-table table.contrast th {
	font-weight: normal;
	font-size: 1.3rem;
	text-shadow: 0 0;
}
.sp-table table.contrast th[data-orderable]:hover {
	color: var(--sp-secondary, #4d4d4d);
	transform: scale(1.05);
}
.sp-table table.contrast th[data-orderable]:hover .sp-text-primary { color: var(--sp-secondary, #4d4d4d); }

.sp-table table tr:nth-child(even)   { background-color: #eee; }
.sp-table table tbody tr:hover       { background-color: #ddd; }

.sp-table-filters > div:not(:last-child),
.sp-chart-filters > div:not(:last-child) { margin-right: var(--sp-unit-s, 4px); }

.sp-table .fen-bar      { background: #ddd; }
.sp-table .fen > i      { color: #ddd; }
.sp-table .fen:hover > i { color: var(--sp-primary, #0066cc); }

/* =====================================================================
 * 22. Pagination + page setter
 * ===================================================================== */
.sp-pagination { margin: var(--sp-unit, 8px) 0; }

.sp-pages, .sp-page-setter {
	transition: opacity .2s var(--sp-ease, cubic-bezier(.2,.7,.2,1));
	opacity: 0;
	box-shadow: 0 0 4px;
	background: #fff;
	padding: var(--sp-unit-s, 4px);
	position: absolute;
	top: calc(-100% - var(--sp-unit-s, 4px));
	left: 50%;
	transform: translateX(-50%);
	display: none;
}
.sp-page-setter {
	top: calc(-100% - var(--sp-unit, 8px));
	width: 100px;
}
.sp-page-setter .fen-field {
	padding: 5px 0;
	text-align: center;
}
.sp-pages [data-pager] { padding: 0 var(--sp-unit-s, 4px); }

/* =====================================================================
 * 23. Buttons
 * ===================================================================== */
.sp-buttons-list ul {
	margin: 0;
	padding: var(--sp-unit-s, 4px) 0 0;
	list-style-type: none;
	display: flex;
}

.sp-button, .sp-buttons-list li {
	background: var(--sp-primary, #0066cc);
	color: #fff;
	border: none;
	position: relative;
	font-size: 1.3rem;
	padding: var(--sp-unit-s, 4px) calc(var(--sp-unit-s, 4px) * 2);
	cursor: pointer;
	outline: none;
	margin-left: calc(var(--sp-unit-s, 4px) * 2);
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	transition: background var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), transform var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-button:first-child, .sp-buttons-list li:first-child { margin-left: 0; }
.sp-button:hover, .sp-buttons-list li:hover {
	background: transparent;
	color: var(--sp-primary, #0066cc);
	transform: scale(1.05);
}
.sp-button::before, .sp-button::after,
.sp-buttons-list li::before, .sp-buttons-list li::after {
	content: '';
	position: absolute;
	top: 0; right: 0;
	height: 1px;
	width: 0;
	background: var(--sp-secondary, #4d4d4d);
	transition: width var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-button::after, .sp-buttons-list li::after {
	right: auto; top: auto; left: 0; bottom: 0;
}
.sp-button:hover::before, .sp-button:hover::after,
.sp-buttons-list li:hover::before, .sp-buttons-list li:hover::after { width: 100%; }
.sp-button:active, .sp-buttons-list li:active {
	background: var(--sp-primary, #0066cc);
	color: #fff;
	transform: scale(0.95);
}
.sp-button:active::before, .sp-button:active::after,
.sp-buttons-list li:active::before, .sp-buttons-list li:active::after {
	width: 0;
	transform: scale(0.95);
}

/* Button variants */
.sp-pager.sp-button:not(:first-child) { margin-left: var(--sp-unit-s, 4px); }
.sp-pager.sp-button.current,
.sp-button.current {
	background: transparent;
	color: var(--sp-primary, #0066cc);
	transform: scale(1);
}
.sp-button.current::before, .sp-button.current::after {
	width: 100%;
	transform: scale(1);
}

.sp-button.sp-text-muted {
	background: #eee;
	transform: scale(1);
	cursor: default;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.3) inset;
}
.sp-button.sp-text-muted:hover { color: var(--sp-muted, #cccccc); transform: scale(1); }
.sp-button.sp-text-muted::before,
.sp-button.sp-text-muted::after,
.sp-button.sp-text-muted:hover::before,
.sp-button.sp-text-muted:hover::after,
.sp-button.sp-text-muted:active::before,
.sp-button.sp-text-muted:active::after { width: 0; transform: scale(1); }
.sp-button.sp-text-muted:active { color: var(--sp-muted, #cccccc); transform: scale(1); }

.sp-editor-button {
	border: none;
	position: relative;
	font-size: 0.8em;
	padding: calc(var(--sp-unit-s, 4px) / 2) var(--sp-unit-s, 4px);
	cursor: pointer;
	outline: none;
	margin-left: calc(var(--sp-unit-s, 4px) / 2);
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	transition: background var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-editor-button:hover { background: lightgrey; }
.sp-editor-separator    { cursor: default; margin: 0 var(--sp-unit, 8px); }

/* =====================================================================
 * 24. Switches (round on/off + semantic variants)
 * ===================================================================== */
.sp-switch {
	width: 20px;
	height: 20px;
	border-radius: 100%;
	background: var(--sp-muted, #cccccc);
	opacity: 0.7;
	text-align: center;
	transition: background var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-switch.on      { border: none; background: var(--sp-primary, #0066cc); padding: var(--sp-unit-s, 4px); opacity: 1; }
.sp-switch.danger  { background: var(--sp-danger, #d32f2f); }
.sp-switch.warning { background: var(--sp-warning, #ed6c02); }
.sp-switch.success { background: var(--sp-success, #2e7d32); }

/* =====================================================================
 * 25. Dropdown
 * ===================================================================== */
.sp-dropdown { position: relative; }
.sp-dropdown ul {
	display: none;
	list-style-type: none;
	opacity: 0;
	position: absolute;
	border: 1px solid lightgrey;
	background-color: var(--sp-contrast, #ffffff);
	padding: var(--sp-unit-s, 4px) 0;
	overflow-y: auto;
	overflow-x: hidden;
	max-height: 350px;
	z-index: 1;
	transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-dropdown li {
	padding: var(--sp-unit-s, 4px) var(--sp-unit, 8px);
	cursor: pointer;
}
.sp-dropdown li:hover { background-color: #eee; }
.sp-dropdown .sp-button .up     { display: none; }
.sp-dropdown .sp-button.drop .up   { display: inline; }
.sp-dropdown .sp-button .down   { display: inline; }
.sp-dropdown .sp-button.drop .down { display: none; }

/* =====================================================================
 * 26. Nav (sphere main nav)
 * ===================================================================== */
.sp-nav { padding: var(--sp-unit-s, 4px); }
.sp-nav > li {
	list-style-type: none;
	padding: var(--sp-unit-s, 4px);
}
.sp-nav > li:hover { background-color: rgba(255, 255, 255, 0.1); }
.sp-nav > li[data-separator] {
	cursor: default;
	border-bottom: 1px solid var(--sp-primary, #0066cc);
	padding: 0;
	margin: var(--sp-unit-s, 4px) 0;
}
.sp-nav > li[data-separator]:hover { background-color: transparent; }
.sp-nav a       { color: var(--sp-contrast, #ffffff); }
.sp-nav a:hover { color: var(--sp-primary, #0066cc); }

.sp-nav-separator { cursor: pointer; }
.sp-nav-separator .sp-nav-caret-up { display: none; }
.sp-nav-separator ul {
	transition: opacity .2s var(--sp-ease, cubic-bezier(.2,.7,.2,1));
	opacity: 0;
	display: none;
}

.sp-main-nav {
	padding: 0;
	margin-top: var(--sp-unit-s, 4px);
	font-size: 1.2em;
}
.sp-main-nav > li { transition: border-color .2s var(--sp-ease, cubic-bezier(.2,.7,.2,1)); }
.sp-main-nav > li:hover { border-left: 4px solid var(--sp-secondary, #4d4d4d); }

/* =====================================================================
 * 27. fen system (form fields)
 * ===================================================================== */
.fen {
	position: relative;
	margin-right: var(--sp-unit, 8px);
	font-size: 1.2rem;
	padding: 0 0 calc(var(--sp-unit-s, 4px) * 2);
}
.fen-radio-item {
	position: relative;
	margin-top: var(--sp-unit-s, 4px);
	margin-right: var(--sp-unit, 8px);
	font-size: 1.2rem;
	margin-bottom: var(--sp-unit, 8px);
}
.fen.disabled    { opacity: 0.5; }
.fen:last-child  { margin-right: 0; }

.fen > i {
	position: absolute;
	right: 1rem; top: 2px;
	color: var(--sp-muted, #cccccc);
	transition: color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}

.fen-helper {
	font-size: 0.9rem;
	color: var(--sp-muted, #cccccc);
	transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}

.fen-helper-full {
	display: none;
	font-size: 1rem;
	background-color: var(--sp-background, #ffffff);
	color: var(--sp-contrast, #ffffff);
	text-align: center;
	border-radius: 6px;
	padding: var(--sp-unit-s, 4px) calc(var(--sp-unit-s, 4px) * 2);
	position: absolute;
	z-index: 100;
	opacity: 0;
	transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.fen-helper-full::after {
	content: "";
	position: absolute;
	bottom: 100%; left: 50%;
	margin-left: calc(var(--sp-unit-s, 4px) * -1);
	border-width: var(--sp-unit-s, 4px);
	border-style: solid;
	border-color: transparent transparent black transparent;
}

.fen-1-1 { width: 100%; }
.fen-1-2 { width: calc(50% - (var(--sp-unit, 8px) / 2)); }

.fen-field {
	line-height: 1.5rem;
	padding: 0 0 var(--sp-unit-s, 4px);
	outline: none;
	background: transparent;
	font-size: 1rem;
	border: none;
	width: 100%;
	color: var(--sp-default, #333333);
	opacity: 0;
	transition: opacity var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
/* niente "rettangolone" di focus sui campi: l'indicatore è l'underline (.fen-bar) + label.
   Box-shadow di :focus-visible resta su bottoni/link (dove non c'è underline). */
.fen-field:focus-visible { box-shadow: none; }
.fen-file { outline: none; }
.fen-file-preview > * {
	max-width: 100px;
	transition: transform var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.fen-file-preview > *:hover {
	position: fixed;
	z-index: 100;
	transform: scale(4);
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.jfen-field {
	line-height: 1.5rem;
	padding: 0 0 var(--sp-unit-s, 4px);
	outline: none;
	background: transparent;
	font-size: 1rem;
	border: none;
	color: var(--sp-primary, #0066cc);
	transition: color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.jfen-field:focus { color: var(--sp-secondary, #4d4d4d); }

.fen-auto              { width: auto; margin-right: var(--sp-unit, 8px); }
.fen-auto:last-child   { margin-right: 0; }

.fen-field::placeholder {
	color: var(--sp-muted, #cccccc);
	transform: scale(0.9);
	transform-origin: left top;
}
.fen-field:-ms-input-placeholder {
	color: var(--sp-muted, #cccccc);
	transform: scale(0.9);
	transform-origin: left top;
}

.fen-file ~ .fen-label {
	transform: translateY(-100%) translateY(-0.5em) scale(0.9);
	cursor: pointer;
	pointer-events: auto;
}
.fen-field:focus ~ .fen-bar::after { transform: scaleX(1); }
.fen-field:focus ~ .fen-label      { color: var(--sp-primary, #0066cc); }

input.fen-field:focus { opacity: 1; }

select.fen-field {
	-moz-appearance: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.fen-field:focus ~ .fen-label {
	transform: translateY(-100%) translateY(-0.5em) scale(0.9);
	cursor: pointer;
	pointer-events: auto;
}

input.fen-field:not(:placeholder-shown),
textarea.fen-field:not(:placeholder-shown),
.sphereEditable:not(:empty),
.sphereEditable.invalid { opacity: 1; }

input.fen-field:not(:placeholder-shown) ~ .fen-label,
textarea.fen-field:not(:placeholder-shown) ~ .fen-label,
.sphereEditable.fen-field ~ .fen-label {
	transform: translateY(-100%) translateY(-0.5em) scale(0.9);
	cursor: pointer;
	pointer-events: auto;
}

.fen-label.fen-fixed {
	transform: translateY(-100%) translateY(-0.5em) scale(0.9);
	cursor: pointer;
	pointer-events: auto;
}

select.fen-field.selected { opacity: 1; }
select.fen-field.selected ~ .fen-label {
	transform: translateY(-100%) translateY(-0.5em) scale(0.9);
	cursor: pointer;
	pointer-events: auto;
}

input[type="checkbox"], input[type="radio"] {
	box-sizing: border-box;
	width: auto;
	opacity: 0;
	position: absolute;
	left: 0.25rem; top: 0.25rem;
	margin: 0; padding: 0;
	transition: height var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}

.fen > i ~ .fen-field { width: calc(100% - 1.7rem); }

.fen-label, .main-fen-label {
	position: absolute;
	top: 0.75rem;
	line-height: 1.5rem;
	pointer-events: none;
	z-index: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--sp-muted, #cccccc);
	transform: translateY(-50%);
	transform-origin: left center;
	transition: transform var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), color var(--sp-tr, .25s) linear, opacity var(--sp-tr, .25s) linear;
}
.main-fen-label { top: -0.75rem; pointer-events: auto; }

.jfen-label {
	line-height: 1.5rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--sp-muted, #cccccc);
}

.fen-title, .des-title {
	line-height: 1.5rem;
	pointer-events: none;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--sp-muted, #cccccc);
}
.des-title { font-size: 1.2rem; color: var(--sp-secondary, #4d4d4d); }

.sp-des-title {
	font-size: 1.2rem;
	padding-bottom: var(--sp-unit-s, 4px);
}

.fen-bar {
	position: relative;
	height: 1px;
	background: var(--sp-muted, #cccccc);
	display: block;
}
.fen-bar::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	background: var(--sp-primary, #0066cc);
	height: 2px;
	display: block;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}

.fen-view-label { font-weight: bold; color: var(--sp-primary, #0066cc); font-size: 1.1rem; }
.fen-view-val   { line-height: 2rem; }

.fen-check, .fen-radio {
	position: absolute;
	color: var(--sp-muted, #cccccc);
	top: 0.4rem;
	width: 1rem; height: 1rem;
	z-index: 0;
	border: 0.125rem solid currentColor;
	border-radius: 0.0625rem;
	transition: color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.fen-radio { border: none; }

.fen-switch {
	position: absolute;
	top: 0.25rem;
	box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
	box-sizing: border-box;
	width: 1.2rem; height: 1.2rem;
	border-radius: 50%;
	pointer-events: none;
	color: var(--sp-contrast, #ffffff);
	background-color: currentColor;
	transition: transform var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.fen-switch-track {
	position: absolute;
	top: 0.4rem;
	width: 2.2rem; height: 1rem;
	box-sizing: border-box;
	border-radius: 7px;
	color: var(--sp-muted, #cccccc);
	background-color: currentColor;
	opacity: 0.4;
	transition: opacity 90ms cubic-bezier(.4,0,.2,1),
	            background-color 90ms cubic-bezier(.4,0,.2,1),
	            color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}

.fen-check:hover, .fen-radio:hover, .fen-switch:hover { color: var(--sp-primary, #0066cc); }

.fen-check::before, .fen-check::after {
	position: absolute;
	height: 0; width: 0.2rem;
	background-color: var(--sp-primary, #0066cc);
	border-radius: 0.25rem;
	content: "";
	transform-origin: left top;
	opacity: 0;
	z-index: 0;
	transition: opacity var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), height 0s linear var(--sp-tr, .25s);
}
.fen-radio::before, .fen-radio::after {
	position: absolute;
	content: "";
	left: 0; top: 0;
	width: 1rem; height: 1rem;
	border-radius: 50%;
	border: 0.125rem solid currentColor;
	transition: transform var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)), color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}

.fen-check::before {
	width: 0.18rem; top: 0.9rem; left: 0.4rem;
	transform: rotate(-135deg);
}
.fen-check::after {
	top: 0.55rem; left: 0;
	transform: rotate(-45deg);
}
.fen-radio::after {
	transform: scale(0);
	background-color: var(--sp-primary, #0066cc);
	border-color: var(--sp-primary, #0066cc);
}

.fen-check-label, .fen-radio-label {
	position: relative;
	cursor: pointer;
	padding-left: 1.6rem;
	z-index: 1;
	transition: color var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.fen-switch ~ .fen-check-label { padding-left: 2.7rem; }

.fen-check-label:hover ~ .fen-check,
.fen-check-label:hover ~ .fen-switch-track,
.fen-radio-label:hover ~ .fen-radio { color: var(--sp-primary, #0066cc); }

input[type="checkbox"]:focus ~ .fen-check,
input[type="checkbox"]:focus ~ .fen-switch-track,
input[type="radio"]:focus ~ .fen-radio { color: var(--sp-primary, #0066cc); }

input[type="checkbox"]:checked ~ .fen-check::after,
input[type="checkbox"]:checked ~ .fen-check::before {
	opacity: 1;
	transition: height var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
input[type="checkbox"]:checked ~ .fen-check::after { height: 0.5rem; }
input[type="checkbox"]:checked ~ .fen-check::before {
	height: 1rem;
	transition-delay: 0.2s;
}
input[type="checkbox"]:checked ~ .fen-switch-track {
	color: var(--sp-primary, #0066cc); opacity: 0.5;
}
input[type="checkbox"]:checked ~ .fen-switch {
	color: var(--sp-primary, #0066cc);
	transform: translateX(1.2rem);
}
input[type="radio"]:checked ~ .fen-radio::after { transform: scale(0.5); }

.fen-constraint .fen-helper,
.fen-constraint .fen-label { color: var(--sp-danger, #d32f2f); }

.invalid { color: var(--sp-danger, #d32f2f); }

/* =====================================================================
 * 28. Banner (toast notification)
 * ===================================================================== */
[data-banner] {
	background: #F4F4F4;
	z-index: 10;
	padding: 15px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	position: fixed;
	top: 10%;
	left: 50%;
	transform: translateX(-50%);
	box-shadow: 0 0 2px 0px;
	transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.banner-alert {
	background: #EBCDC8;
	color: rgba(175, 26, 0, 0.8);
}
.banner-success {
	background: green;
	color: rgba(0, 98, 59, 0.6);
}
.banner-primary {
	background: lightblue;
	color: rgba(37, 37, 37, 0.8);
	border: 1px solid rgba(0, 0, 0, 0.08);
}
.banner-secondary {
	background: #fff;
	color: red;
	border: 1px solid rgba(0, 0, 0, 0.08);
	font-weight: bold;
}

/* =====================================================================
 * 29. Select autocomplete (sp-select-table)
 * ===================================================================== */
.sp-select-table {
	background: #ECECEC;
	transition: opacity var(--sp-tr-fast, .15s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
	max-height: 30vh;
	overflow-y: auto;
	padding: var(--sp-unit, 8px) 0;
}
.sp-select-table.active {
	display: block;
	opacity: 1;
	height: auto;
}
[data-sel-value] {
	padding: var(--sp-unit-s, 4px) var(--sp-unit, 8px);
	cursor: pointer;
	transition: background var(--sp-tr-fast, .15s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
[data-sel-value]:hover { background: #ddd; }

.sp-sel-add { padding: 0; }
.sp-sel-add .sp-button { width: auto; }
.sp-more   { cursor: default; }
.sp-sel-drop {
	cursor: pointer;
	opacity: 0;
	transition: opacity var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}

/* =====================================================================
 * 30. Main content blocks (site editorial)
 * ===================================================================== */
.sp-main-content-content h1 {
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 2px;
	font-size: 2.5rem;
	line-height: 2.5rem;
	margin-bottom: calc(var(--sp-unit-l, 16px) * 1);
}
.sp-main-content-content ul {
	padding: 0 0 0 var(--sp-unit, 8px);
	margin: 0;
}
.sp-main-content-content li {
	margin-bottom: var(--sp-unit, 8px);
	line-height: 1.5rem;
}
.sp-main-content img { max-width: 100%; }

.sp-boxed-item-content {
	font-size: 1.2rem;
	line-height: 2.5rem;
}
.sp-legal-menu-item, .sp-top-menu-item {
	margin: 0 var(--sp-unit-s, 4px);
	cursor: pointer;
}
.sp-top-menu-item { margin: 0 calc(var(--sp-unit-s, 4px) * 2); }
.sp-legal-menu-item:last-child, .sp-top-menu-item:last-child { margin-right: 0; }
.sp-legal-menu-item:first-child, .sp-top-menu-item:first-child { margin-left: 0; }

.sp-main-content-block:first-child { margin-top: 0; }
.sp-main-content-block:last-child  { margin-bottom: 0; }
.sp-main-content-block {
	margin: var(--sp-unit-l, 16px) 0;
	height: 500px;
	width: 100%;
	opacity: 1;
	transition: opacity var(--sp-tr-slow, .5s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-main-content-hcontents {
	padding: calc(var(--sp-unit-l, 16px) * 3) calc(var(--sp-unit-l, 16px) * 5);
}
.sp-main-content-block:nth-child(odd)  .sp-main-content-block-img-container { order: 1; }
.sp-main-content-block:nth-child(odd)  .sp-main-content-block-desc          { order: 2; }
.sp-main-content-block:nth-child(even) .sp-main-content-block-img-container { order: 2; }
.sp-main-content-block:nth-child(even) .sp-main-content-block-desc          { order: 1; }

.sp-main-content-block-img-container { width: 60%; }
.sp-main-content-block-img {
	width: 100%;
	height: 500px;
	object-fit: cover;
	transition: filter .8s var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-main-content-block-icon {
	margin-bottom: var(--sp-unit-l, 16px);
	font-size: 2rem;
	transition: transform .8s var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-main-content-block-desc {
	flex-basis: 0;
	flex-grow: 1;
	background: var(--sp-primary, #0066cc);
	color: var(--sp-contrast, #ffffff);
	flex-direction: column;
	justify-content: center;
	padding: calc(var(--sp-unit-l, 16px) * 2);
}
.sp-main-content-block-title {
	font-size: 2.5em;
	margin-bottom: var(--sp-unit, 8px);
	text-transform: uppercase;
}
.sp-main-content-block-text { line-height: 2em; }

/* =====================================================================
 * 31. Login box
 * ===================================================================== */
.sp-login-box {
	box-shadow: 0 0 1px color-mix(in srgb, var(--sp-default, #333333) 80%, transparent);
	width: 45%;
	padding: var(--sp-unit-l, 16px);
	background: var(--sp-contrast, #ffffff);
}
.sp-login-title       { font-size: 1.5rem; margin-bottom: var(--sp-unit, 8px); }
.sp-login-description { line-height: 1.5rem; }
.sp-login-buttons     { width: 40%; }

.sphere-dialog .fen-label { font-size: 1.2rem; }

.sp-login-box .fen .fen-check-label { font-size: 1rem; }
.sp-login-box .fen .fen-switch-track { top: 0.45rem; }
.sp-login-box .fen .fen-switch       { top: 0.3rem; }

.sp-fen-view .fen { font-size: 1rem; }

/* =====================================================================
 * 32. Product (store)
 * ===================================================================== */
.sp-product       { margin: var(--sp-unit, 8px) 0; width: 30%; }
.sp-product-title { font-size: 1.5rem; }
.sp-product-price { font-size: 1.5rem; padding: 0 var(--sp-unit, 8px); }
.sp-product-price > div { text-align: right; }
.sp-product-helper { font-size: 0.8rem; color: var(--sp-muted, #cccccc); }
.sp-product-launcher .sp-button { font-size: 1.2rem; }
.sp-product big { font-size: 1rem; }

/* =====================================================================
 * 33. Privacy / Cookie banner
 * ===================================================================== */
.sp-privacy {
	padding: 0 calc(var(--sp-unit-l, 16px) * 10) calc(var(--sp-unit-l, 16px) * 3);
	font-size: 1.2rem;
	line-height: 2.4rem;
}
.sp-user-privacy {
	padding: var(--sp-unit-s, 4px) var(--sp-unit, 8px);
	font-size: 1.2rem;
	line-height: 2.4rem;
}
.sp-privacy .fen .fen-switch       { top: 0.6rem; }
.sp-privacy .fen .fen-switch-track { top: 0.7rem; }

/* Cookie Banner v1 — horizontal bar bottom, blur vetro (mockup v5 style adapted).
   Layout desktop: text block (titolo+msg) a sinistra, pulsantiera one-row a destra.
   Layout mobile: stack col, pulsantiera scroll-x se troppo larga.
   B7 hideCookieBanner aggiunge .is-hidden → translateY(120%) + opacity 0. */
#sp-cookie-banner {
	position: fixed;
	bottom: calc(var(--sp-unit, 8px) * 2);
	right: calc(var(--sp-unit, 8px) * 2);
	width: -moz-fit-content;
	width: fit-content;
	max-width: calc(100vw - var(--sp-unit, 8px) * 4);
	min-width: 320px;
	z-index: 100;
	background: rgba(14, 29, 43, 0.95);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	color: #f5f5f5;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--sp-radius, 12px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32), 0 4px 8px rgba(0, 0, 0, 0.16);
	transform: translateY(0);
	transition: transform var(--sp-tr-slow, .4s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)),
	            opacity var(--sp-tr-slow, .4s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
/* Pre-paint hide: se utente ha consenso pregresso, html.sp-cookie-consented nasconde il banner
 * SUBITO senza flash. Class settata da boot script inline in includes() v1 prima del banner DOM. */
html.sp-cookie-consented #sp-cookie-banner {
	display: none !important;
}

/* Sphere scroll v2 — Sidebar wheel-nav (sostituisce auto-trigger infinite scroll).
 * Fixed right side, vertically centered. 2 zone (prev top, next bottom).
 * Catch wheel/touch on the aside, click delegated to [data-sp-loadprev]/[data-sp-loadmore]. */
.sp-tpl-wheel-nav {
	position: fixed;
	right: calc(var(--sp-unit, 8px) * 2);
	top: 50%;
	transform: translateY(-50%);
	z-index: 90;
	display: flex;
	flex-direction: column;
	gap: var(--sp-unit-s, 4px);
	padding: var(--sp-unit-s, 4px);
	background: rgba(14, 29, 43, 0.85);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--sp-radius, 12px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
	opacity: 1;
	transition: opacity var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1)),
	            transform var(--sp-tr, .25s) var(--sp-ease, cubic-bezier(.2,.7,.2,1));
}
.sp-tpl-wheel-nav.is-hidden {
	opacity: 0;
	transform: translate(20px, -50%);
	pointer-events: none;
}
.sp-tpl-wheel-nav__zone {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: transparent;
	color: rgba(245, 245, 245, 0.85);
	border: none;
	border-radius: var(--sp-radius-sm, 8px);
	cursor: pointer;
	transition: background var(--sp-tr, .25s), color var(--sp-tr, .25s), transform var(--sp-tr, .25s);
}
.sp-tpl-wheel-nav__zone:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--sp-primary, #4ec3c8);
	transform: scale(1.08);
}
.sp-tpl-wheel-nav__zone:active {
	transform: scale(0.94);
}
.sp-tpl-wheel-nav__zone.is-disabled {
	opacity: 0.28;
	pointer-events: none;
}
.sp-tpl-wheel-nav__hint {
	width: 56px;
	margin-top: var(--sp-unit-s, 4px);
	padding: 6px 2px 2px;
	font-size: 0.62rem;
	line-height: 1.2;
	text-align: center;
	color: rgba(245, 245, 245, 0.6);
	letter-spacing: 0.02em;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sp-tpl-wheel-nav__tip {
	position: absolute;
	right: calc(100% + var(--sp-unit, 8px));
	top: 50%;
	transform: translateY(-50%);
	background: rgba(14, 29, 43, 0.95);
	color: #fff;
	font-size: 0.78rem;
	padding: 6px 10px;
	border-radius: var(--sp-radius-sm, 6px);
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--sp-tr, .2s);
}
.sp-tpl-wheel-nav__zone:hover .sp-tpl-wheel-nav__tip {
	opacity: 1;
}
@media (max-width: 640px) {
	/* Mobile: sidebar wheel-nav nascosta del tutto.
	 * Area touch piccola = swipe/wheel inutili + sovrapposizione contenuto fuorviante.
	 * I bottoni del pager (.sp-tpl-news-pager) restano visibili nel flusso → utente naviga lì. */
	.sp-tpl-wheel-nav { display: none !important; }
}
#sp-cookie-banner.is-hidden {
	transform: translateY(calc(100% + var(--sp-unit, 8px) * 4));
	opacity: 0;
	pointer-events: none;
}
.sp-cookie-banner__inner {
	display: flex;
	flex-direction: column;
	gap: calc(var(--sp-unit, 8px) * 1.5);
	padding: calc(var(--sp-unit, 8px) * 2) calc(var(--sp-unit, 8px) * 2.5);
}
.sp-cookie-banner__msg {
	font-size: 0.88rem;
	line-height: 1.5;
	max-width: 520px;
}
.sp-cookie-banner__links {
	display: flex;
	flex-wrap: wrap;
	gap: calc(var(--sp-unit, 8px) * 1.5);
	font-size: 0.78rem;
}
.sp-cookie-banner__link {
	color: rgba(245, 245, 245, 0.68);
	text-decoration: underline;
	text-decoration-color: rgba(245, 245, 245, 0.28);
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}
.sp-cookie-banner__link:hover {
	color: var(--sp-primary, #4ec3c8);
	text-decoration-color: var(--sp-primary, #4ec3c8);
}
.sp-cookie-banner__title {
	margin: 0 0 var(--sp-unit-s, 4px);
	font-size: 1rem;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: 0.01em;
}
.sp-cookie-banner__msg p { margin: 0 0 calc(var(--sp-unit-s, 4px) * 1.5); color: rgba(245, 245, 245, 0.78); }
.sp-cookie-banner__msg p:last-child { margin-bottom: 0; }
.sp-cookie-banner__msg ul {
	margin: var(--sp-unit-s, 4px) 0;
	padding-left: calc(var(--sp-unit, 8px) * 2);
	font-size: 0.82rem;
}
.sp-cookie-banner__msg li { margin-bottom: 2px; color: rgba(245, 245, 245, 0.72); }
.sp-cookie-banner__msg strong { color: var(--sp-primary, #4ec3c8); font-weight: 600; }
.sp-cookie-banner__msg em { opacity: 0.55; font-style: normal; font-size: 0.85em; }
.sp-cookie-banner__actions {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--sp-unit-s, 4px);
	align-items: center;
	justify-content: flex-end;
}
.sp-cookie-banner .sp-tpl-btn {
	white-space: nowrap;
	font-size: 0.82rem;
	padding: 8px 14px;
}
.sp-cookie-banner .sp-tpl-btn--outline {
	color: rgba(245, 245, 245, 0.92);
	border-color: rgba(245, 245, 245, 0.28);
	background: transparent;
}
.sp-cookie-banner .sp-tpl-btn--outline:hover {
	color: #ffffff;
	background: rgba(245, 245, 245, 0.08);
	border-color: rgba(245, 245, 245, 0.5);
}
/* Mobile ≤640: banner full-width edge-to-edge con margini ridotti, pulsantiera wrap 2x2 */
@media (max-width: 640px) {
	#sp-cookie-banner {
		bottom: var(--sp-unit, 8px);
		right: var(--sp-unit, 8px);
		left: var(--sp-unit, 8px);
		width: auto;
		max-width: none;
		min-width: 0;
	}
	.sp-cookie-banner__inner {
		padding: calc(var(--sp-unit, 8px) * 2);
		gap: calc(var(--sp-unit, 8px) * 1.5);
	}
	.sp-cookie-banner__msg { font-size: 0.85rem; max-width: none; }
	.sp-cookie-banner__title { font-size: 0.95rem; }
	.sp-cookie-banner__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: var(--sp-unit-s, 4px);
	}
	.sp-cookie-banner__actions > * {
		width: auto;
		min-width: 0;
		box-sizing: border-box;
		text-align: center;
		padding: 9px 8px;
		font-size: 0.8rem;
	}
}
/* Mobile small ≤380: 1 colonna singola (4 bottoni stacked) per UX touch-friendly */
@media (max-width: 380px) {
	.sp-cookie-banner__actions {
		grid-template-columns: 1fr;
	}
}

/* =====================================================================
 * 34. Upload
 * ===================================================================== */
.sp-upload {
	position: relative;
	margin: calc(var(--sp-unit, 8px) * 2) 0 var(--sp-unit, 8px);
}
.sp-upload-btn,
input[type=file]:not(.fen-file) {
	position: absolute;
	top: 0; left: 0;
}
input[type=file]:not(.fen-file) {
	height: 100%; width: 100%;
	opacity: 0;
}
.fen-file-value { margin-bottom: var(--sp-unit-s, 4px); }

/* =====================================================================
 * 35. Datepicker (custom)
 * ===================================================================== */
.sp-datepicker {
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	border-radius: var(--sp-radius-sm, 4px);
	background-color: #fff;
	padding: 10px;
	display: none;
	position: absolute;
	z-index: 1000;
}
.sp-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px;
}
.sp-calendar-header button {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 18px;
}
.sp-calendar-header select {
	border: 1px solid #ccc;
	border-radius: var(--sp-radius-sm, 4px);
	padding: 5px;
	font-size: 16px;
}
.sp-calendar-body { width: 100%; border-collapse: collapse; }
.sp-calendar-body th,
.sp-calendar-body td {
	border: 1px solid #ccc;
	padding: 5px;
	text-align: center;
	cursor: pointer;
}
.sp-calendar-body td:hover { background-color: #f0f0f0; }
.sp-calendar-body td.disabled {
	color: #ccc;
	cursor: default;
}
.sp-calendar-body td.disabled:hover { background-color: transparent; }

.sp-close-calendar {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 24px;
	color: #666;
	position: absolute;
	top: 0; right: 5px;
}
.sp-close-calendar:hover { color: #333; }

/* =====================================================================
 * 36. Legacy animations classes (referenziano keyframes in sp-animations-*.css)
 * ===================================================================== */
.sp-blink     { animation: 1s blink step-end infinite; }
.wobble       { animation: 0.3s wobble ease 1; }
.scaleInOut   { animation: 0.2s scaleInOut ease-in-out 1; }
.sp-fadeIn    { animation: 1.5s fadeIn ease-in 1; }

/* =====================================================================
 * 37. Media queries (responsive)
 * ===================================================================== */
@media only screen and (max-width: 1900px) {
	#sp-cookie-banner { flex-wrap: wrap; }
	#sp-cookie-banner > div {
		flex-wrap: wrap;
		justify-content: center;
	}
	#sp-cookie-banner .sp-button {
		text-align: center;
		margin: 1px;
	}
	.sp-modal-content > .sp-main-content-content,
	.sp-modal-content > .sp-des-page {
		margin: 0 var(--sp-unit-l, 16px);
	}
	.sp-modal-content > .sp-des-page { padding: 0; }
	.sp-modal-content > .sp-main-content-content {
		padding: var(--sp-unit-l, 16px);
		padding-bottom: 0;
	}
}

@media only screen and (max-width: 600px) {
	#sp-cookie-banner { flex-wrap: wrap; }
	#sp-cookie-banner > div {
		flex-wrap: wrap;
		justify-content: center;
	}
	#sp-cookie-banner .sp-button {
		width: 50%;
		text-align: center;
		margin: 1px;
	}
	.sp-des-page { padding: 0; }
	.sp-main-content-content ~ .sp-des-page {
		margin-top: 0;
		margin-bottom: var(--sp-unit-l, 16px);
	}
	.sp-modal-content > .sp-main-content-content,
	.sp-modal-content > .sp-des-page {
		padding: 0;
		margin: 0 var(--sp-unit-s, 4px);
	}
	.sp-modal-content > .sp-main-content-content {
		margin-top: var(--sp-unit-s, 4px);
		padding: var(--sp-unit-s, 4px) var(--sp-unit, 8px);
		font-size: 1rem;
		line-height: 1.3rem;
	}
	.sp-modal-content > .sp-des-page { padding-top: 0; }
	.sp-modal-content .sp-main-content-content h1 {
		font-size: 1.2rem;
		line-height: 1.5rem;
		margin-bottom: var(--sp-unit-s, 4px);
	}
	.sp-modal-content > .sp-des-page .sp-padding { padding-top: 0; }
	.sp-modal-content > .sp-des-page .des .sp-margin-t { margin-top: var(--sp-unit-s, 4px); }

	.sp-main-content-block-img-container { width: 100%; }
	.sp-main-content-block-img { height: 100%; }
	.sp-main-content-block { margin: 0; height: 100%; }
	.sp-main-content-block:nth-child(odd) .sp-main-content-block-img-container { order: 2; }
	.sp-main-content-block:nth-child(odd) .sp-main-content-block-desc { order: 1; }
	.sp-main-content-block-img { height: 128px; }
	.sp-main-content-block-title {
		font-size: 1.8rem;
		margin-bottom: 5px;
	}
	.sp-main-content-block-desc { padding: 30px; }
	.sp-main-content-block-text { line-height: 1.5rem; }
	.sp-half-width { width: 100%; }
}

@media only screen and (min-width: 600px)  { /* placeholder per future */ }
@media only screen and (min-width: 768px)  { /* placeholder per future */ }
@media only screen and (min-width: 992px)  { /* placeholder per future */ }
@media only screen and (min-width: 1200px) { /* placeholder per future */ }

/* =====================================================================
 * 38. prefers-reduced-motion (rispetta utente)
 * ===================================================================== */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .001s !important;
		transition-duration: .001s !important;
	}
}
