.sp-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	pointer-events: none;
	visibility: hidden;
	font-family: var(--sp-font);
}
.sp-root.sp-open { visibility: visible; }

.sp-backdrop {
	position: absolute;
	inset: 0;
	background: var(--sp-overlay);
	opacity: 0;
	transition: opacity .45s ease;
	pointer-events: none;
}
.sp-open .sp-backdrop { opacity: .6; pointer-events: auto; }

.sp-dialog {
	position: absolute;
	width: calc(100% - 32px);
	max-width: var(--sp-width);
	background: var(--sp-bg);
	color: var(--sp-text);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28), 0 4px 14px rgba(0, 0, 0, .12);
	opacity: 0;
	transform: translateY(18px) scale(.97);
	transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1);
	pointer-events: none;
	outline: none;
}
.sp-open .sp-dialog { opacity: 1; transform: none; pointer-events: auto; }

/* Positions: auto margins keep centering correct at any width */
.sp-pos-center .sp-dialog { top: 0; bottom: 0; left: 0; right: 0; margin: auto; height: fit-content; transform: translateY(18px) scale(.97); }
.sp-pos-center.sp-open .sp-dialog { transform: none; }
.sp-pos-top-left .sp-dialog { top: 24px; left: 24px; }
.sp-pos-top-center .sp-dialog { top: 24px; left: 0; right: 0; margin-inline: auto; }
.sp-pos-top-right .sp-dialog { top: 24px; right: 24px; }
.sp-pos-bottom-left .sp-dialog { bottom: 24px; left: 24px; }
.sp-pos-bottom-center .sp-dialog { bottom: 24px; left: 0; right: 0; margin-inline: auto; }
.sp-pos-bottom-right .sp-dialog { bottom: 24px; right: 24px; }

/* On narrow screens, span the width with a gutter */
@media (max-width: 560px) {
	.sp-root:not(.sp-pos-center) .sp-dialog { left: 16px; right: 16px; margin-inline: 0; width: auto; max-width: none; }
}

.sp-media { line-height: 0; background: rgba(0, 0, 0, .04); }
.sp-img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: cover; }

.sp-body { padding: 22px 26px 26px; text-align: center; }
.sp-body > *:first-child { margin-top: 0; }
.sp-heading { margin: 0 0 8px; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; color: var(--sp-text); }
.sp-text { margin: 0 0 18px; font-size: 15px; line-height: 1.6; opacity: .78; color: var(--sp-text); }

.sp-cta {
	display: inline-block;
	min-width: 60%;
	padding: 14px 32px;
	background: var(--sp-btn);
	color: var(--sp-btn-text) !important;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .02em;
	text-decoration: none !important;
	border-radius: 999px;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.sp-cta:hover, .sp-cta:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .24); filter: brightness(1.12); }
.sp-cta:focus-visible, .sp-close:focus-visible { outline: 2px solid var(--sp-btn); outline-offset: 3px; }

.sp-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: #111;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	transition: transform .2s ease, background .2s ease;
}
.sp-close:hover { transform: rotate(90deg); background: #fff; }

@media (prefers-reduced-motion: reduce) {
	.sp-backdrop, .sp-dialog, .sp-cta, .sp-close { transition: none; }
}
