.fgm-popup {
	--fgm-popup-width: 560px;
	--fgm-popup-z-index: 9999;
	--fgm-popup-bg: #0b0d13;
	--fgm-popup-text: #f5f7fb;
	--fgm-popup-accent: #d6df23;
	--fgm-popup-border: #d6df23;
	--fgm-popup-overlay-alpha: 0.76;
	--fgm-popup-radius: 0;
	--fgm-popup-padding: 36px;
	--fgm-popup-viewport-gap: clamp(12px, 3vw, 32px);
	align-items: center;
	bottom: 0;
	display: flex;
	justify-content: center;
	left: 0;
	opacity: 0;
	padding: var(--fgm-popup-viewport-gap);
	pointer-events: none;
	position: fixed;
	right: 0;
	top: 0;
	transform: translateY(14px);
	transition: opacity 180ms ease, transform 180ms ease;
	z-index: var(--fgm-popup-z-index);
}

.fgm-popup[hidden] {
	display: none;
}

.fgm-popup.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.fgm-popup__overlay {
	background:
		radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--fgm-popup-accent) 16%, transparent), transparent 30%),
		rgba(4, 5, 10, var(--fgm-popup-overlay-alpha));
	bottom: 0;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
}

.fgm-popup__dialog {
	background: linear-gradient(145deg, color-mix(in srgb, var(--fgm-popup-bg) 92%, #ffffff 8%) 0%, var(--fgm-popup-bg) 100%);
	border: 1px solid color-mix(in srgb, var(--fgm-popup-border) 70%, transparent);
	border-radius: var(--fgm-popup-radius);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 34px color-mix(in srgb, var(--fgm-popup-accent) 16%, transparent);
	color: var(--fgm-popup-text);
	display: flex;
	flex-direction: column;
	max-height: calc(100dvh - (var(--fgm-popup-viewport-gap) * 2));
	max-width: calc(100vw - (var(--fgm-popup-viewport-gap) * 2));
	overflow: visible;
	padding: var(--fgm-popup-padding);
	position: relative;
	width: min(max(var(--fgm-popup-width), 72vw), calc(100vw - (var(--fgm-popup-viewport-gap) * 2)));
}

.fgm-popup__dialog:focus {
	outline: 2px solid var(--fgm-popup-accent);
	outline-offset: 4px;
}

.fgm-popup__title {
	color: var(--fgm-popup-accent);
	font-size: clamp(1.45rem, 3vw, 2.35rem);
	line-height: 1.12;
	margin: 0 42px 18px 0;
}

.fgm-popup__content {
	color: var(--fgm-popup-text);
	font-size: 1rem;
	line-height: 1.65;
	min-height: 0;
}

.fgm-popup__content :where(p, ul, ol, figure) {
	margin-bottom: 1rem;
}

.fgm-popup__content :where(figure, .wp-block-image) {
	text-align: center;
}

.fgm-popup__content > :last-child {
	margin-bottom: 0;
}

.fgm-popup__content :where(a) {
	color: var(--fgm-popup-accent);
}

.fgm-popup__content :where(.btn, .wp-block-button__link, button, input[type="submit"]) {
	background: var(--fgm-popup-accent);
	border: 0;
	border-radius: 0;
	color: #090a0f;
	font-weight: 800;
	padding: 0.85rem 1.25rem;
	text-decoration: none;
}

.fgm-popup__content img {
	height: auto;
	max-width: 100%;
	object-fit: contain;
	width: auto;
}

.fgm-popup__content :where(figure, .wp-block-image) img {
	max-height: calc(100dvh - (var(--fgm-popup-viewport-gap) * 2) - (var(--fgm-popup-padding) * 2) - 150px);
}

.fgm-popup__close {
	align-items: center;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.16);
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 26px;
	height: 38px;
	justify-content: center;
	line-height: 1;
	position: absolute;
	right: 14px;
	top: 14px;
	transition: background 160ms ease, color 160ms ease;
	width: 38px;
}

.fgm-popup__close:hover,
.fgm-popup__close:focus {
	background: var(--fgm-popup-accent);
	color: #07080d;
	outline: none;
}

.fgm-popup--top-left,
.fgm-popup--top-center,
.fgm-popup--top-right {
	align-items: flex-start;
}

.fgm-popup--bottom-left,
.fgm-popup--bottom-center,
.fgm-popup--bottom-right {
	align-items: flex-end;
}

.fgm-popup--top-left,
.fgm-popup--bottom-left {
	justify-content: flex-start;
}

.fgm-popup--top-right,
.fgm-popup--bottom-right {
	justify-content: flex-end;
}

.fgm-popup--top-center,
.fgm-popup--bottom-center,
.fgm-popup--center {
	justify-content: center;
}

.fgm-popup--fullscreen .fgm-popup__dialog {
	height: auto;
	width: calc(100vw - (var(--fgm-popup-viewport-gap) * 2));
}

.fgm-popup--top-bar,
.fgm-popup--bottom-bar {
	padding: 0;
}

.fgm-popup--top-bar {
	align-items: flex-start;
}

.fgm-popup--bottom-bar {
	align-items: flex-end;
}

.fgm-popup--top-bar .fgm-popup__dialog,
.fgm-popup--bottom-bar .fgm-popup__dialog {
	border-left: 0;
	border-radius: 0;
	border-right: 0;
	max-width: 100vw;
	width: 100vw;
}

.fgm-popup--animation-zoom {
	transform: scale(0.96);
}

.fgm-popup--animation-slide-up {
	transform: translateY(34px);
}

.fgm-popup--animation-none,
.fgm-popup--animation-none.is-open {
	transform: none;
	transition: none;
}

.fgm-popup-lock {
	overflow: hidden;
}

@media (max-width: 600px) {
	.fgm-popup {
		--fgm-popup-viewport-gap: 12px;
	}

	.fgm-popup__dialog {
		padding: min(var(--fgm-popup-padding), 24px);
		width: calc(100vw - (var(--fgm-popup-viewport-gap) * 2));
	}

	.fgm-popup__content :where(figure, .wp-block-image) img {
		max-height: calc(100dvh - (var(--fgm-popup-viewport-gap) * 2) - (min(var(--fgm-popup-padding), 24px) * 2) - 132px);
	}

	.fgm-popup--top-left,
	.fgm-popup--top-right,
	.fgm-popup--bottom-left,
	.fgm-popup--bottom-right {
		justify-content: center;
	}
}
