.mw-popup {
	position: fixed;
	inset: 0;
	z-index: var(--mw-popup-z, 999999);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	pointer-events: none;
	visibility: hidden;
}

.mw-popup__backdrop {
	position: absolute;
	inset: 0;
	background: var(--mw-popup-overlay, #0f172a);
	opacity: 0;
	transition: opacity .24s ease;
}

.mw-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(var(--mw-popup-width, 640px), calc(100vw - 48px));
	max-height: calc(100vh - 48px);
	padding: var(--mw-popup-padding, 28px);
	overflow: auto;
	border-radius: var(--mw-popup-radius, 18px);
	background: var(--mw-popup-bg, #fff);
	color: var(--mw-popup-text, #172033);
	box-shadow: 0 30px 90px rgba(2, 11, 37, .32);
	opacity: 0;
	outline: 0;
	transition: opacity .24s ease, transform .3s cubic-bezier(.2, .75, .25, 1);
}

.mw-popup--fade .mw-popup__dialog { transform: none; }
.mw-popup--zoom .mw-popup__dialog { transform: scale(.9); }
.mw-popup--slide_up .mw-popup__dialog { transform: translateY(48px); }
.mw-popup--slide_down .mw-popup__dialog { transform: translateY(-48px); }

.mw-popup.is-open {
	pointer-events: auto;
	visibility: visible;
}
.mw-popup.is-open .mw-popup__backdrop { opacity: var(--mw-popup-overlay-opacity, .72); }
.mw-popup.is-open .mw-popup__dialog { opacity: 1; transform: none; }

.mw-popup--top_center { align-items: flex-start; }
.mw-popup--bottom_center { align-items: flex-end; }
.mw-popup--bottom_right { align-items: flex-end; justify-content: flex-end; }

.mw-popup__close {
	position: absolute;
	z-index: 3;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-width: 38px;
	min-height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(15, 23, 42, .07);
	color: var(--mw-popup-text, #172033);
	font: 400 28px/1 Arial, sans-serif;
	cursor: pointer;
	transition: background .18s ease, color .18s ease, transform .18s ease;
}
.mw-popup__close:hover,
.mw-popup__close:focus-visible {
	background: var(--mw-popup-accent, #e8231a);
	color: #fff;
	outline: 0;
	transform: rotate(6deg);
}

.mw-popup__title {
	margin: 0 42px 14px 0;
	color: inherit;
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 750;
	line-height: 1.25;
}

.mw-popup__content { color: inherit; line-height: 1.65; }
.mw-popup__content > :first-child { margin-top: 0; }
.mw-popup__content > :last-child { margin-bottom: 0; }
.mw-popup__content input:not([type="checkbox"]):not([type="radio"]),
.mw-popup__content select,
.mw-popup__content textarea {
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	box-sizing: border-box;
}
.mw-popup__content input[type="submit"],
.mw-popup__content button[type="submit"] {
	border-color: var(--mw-popup-accent, #e8231a);
	background: var(--mw-popup-accent, #e8231a);
	color: #fff;
}

html.mw-popup-lock,
body.mw-popup-lock { overflow: hidden !important; }

@media (max-width: 767px) {
	.mw-popup { padding: 14px; }
	.mw-popup__dialog {
		width: min(var(--mw-popup-mobile-width, 92vw), calc(100vw - 28px));
		max-height: calc(100dvh - 28px);
		padding: max(18px, calc(var(--mw-popup-padding, 28px) * .72));
	}
	.mw-popup__title { margin-right: 34px; font-size: 22px; }
	.mw-popup--bottom_right { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	.mw-popup__backdrop,
	.mw-popup__dialog,
	.mw-popup__close { transition: none !important; }
}
