/* Popup site-wide gestito dal backoffice (doctype dgPopup). */
.dg-popup-overlay{
	position:fixed;inset:0;z-index:9000;
	display:flex;align-items:center;justify-content:center;
	padding:20px;
	background:rgba(10,20,40,.6);
	opacity:0;transition:opacity .3s ease;
}
.dg-popup-overlay[hidden]{display:none;}
.dg-popup-overlay.open{opacity:1;}

.dg-popup{
	position:relative;width:100%;max-width:540px;max-height:90vh;overflow-y:auto;
	background:#fff;border-radius:16px;overflow:hidden;
	box-shadow:0 24px 70px rgba(0,0,0,.4);
	transform:translateY(16px) scale(.98);transition:transform .35s ease;
}
.dg-popup-overlay.open .dg-popup{transform:none;}

/* --- Hero: immagine a banner con titolo sovrapposto --- */
.dg-popup-hero{position:relative;aspect-ratio:16/8;overflow:hidden;background:#0b1a2b;}
.dg-popup-hero img{display:block;width:100%;height:100%;object-fit:cover;}
.dg-popup-hero::after{
	content:"";position:absolute;inset:0;
	background:linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.30) 55%, rgba(0,0,0,.62) 100%);
}
.dg-popup .dg-popup-title--over{
	position:absolute;inset:0;z-index:1;margin:0;padding:22px;
	display:flex;align-items:center;justify-content:center;text-align:center;
	color:#fff !important;font-weight:800 !important;font-size:2.4rem;line-height:1.15;
	text-shadow:0 2px 16px rgba(0,0,0,.55);
}

/* --- Contenuto: sfondo bianco, testi scuri --- */
.dg-popup-content{
	padding:26px 28px 30px;text-align:center;
	background:#fff;color:#333;
}
.dg-popup--noimg .dg-popup-content{padding-top:34px;}
.dg-popup-content .dg-popup-title{margin:0 0 14px;font-size:1.6rem;line-height:1.2;font-weight:800;color:rgb(15,26,45) !important;}
.dg-popup-body{margin:0 0 22px;font-size:1.02rem;line-height:1.55;color:#333;}
.dg-popup-body p:last-child{margin-bottom:0;}
.dg-popup-body a{color:rgb(65,64,121);text-decoration:underline;}

/* --- Pulsante: blu/testo bianco -> hover bianco/testo blu --- */
.dg-popup-btn,
.dg-popup-btn:link,
.dg-popup-btn:visited{
	display:inline-block;min-width:200px;
	background:rgb(65,64,121) !important;
	color:#fff !important;
	border:2px solid rgb(65,64,121) !important;
	transition:background .2s ease,color .2s ease;
}
.dg-popup-btn:hover,
.dg-popup-btn:focus{
	background:#fff !important;
	color:rgb(65,64,121) !important;
	border-color:rgb(65,64,121) !important;
}

/* --- Chiudi --- */
.dg-popup-close{
	position:absolute;top:12px;right:14px;
	width:40px;height:40px;padding:0;border:none;border-radius:50%;
	background:rgba(0,0,0,.45);color:transparent;font-size:0;
	cursor:pointer;z-index:3;transition:background .2s ease,transform .2s ease;
}
/* X disegnata con due lineette, centrate esattamente (niente metriche del font) */
.dg-popup-close::before,
.dg-popup-close::after{
	content:"";position:absolute;top:50%;left:50%;
	width:16px;height:2px;border-radius:2px;background:#fff;
}
.dg-popup-close::before{transform:translate(-50%,-50%) rotate(45deg);}
.dg-popup-close::after{transform:translate(-50%,-50%) rotate(-45deg);}
.dg-popup-close:hover{background:rgba(0,0,0,.72);transform:scale(1.08);}

body.dg-popup-open{overflow:hidden;}

@media (max-width:600px){
	.dg-popup-hero{aspect-ratio:16/9;}
	.dg-popup .dg-popup-title--over{font-size:1.7rem;padding:16px;}
	.dg-popup-content{padding:22px 18px 24px;}
	.dg-popup-content .dg-popup-title{font-size:1.35rem;}
	.dg-popup-btn{min-width:0;width:100%;}
}
