/* =========================
   Popups
   ========================= */

:root {
	--popup-blue: #0572ff;
	--popup-blue-dark: #0756c9;
	--popup-text: #071436;
	--popup-muted: #62729c;
	--popup-bg: #f4f8ff;
	--popup-card: #ffffff;
	--popup-line: #dbe6f6;
	--popup-shadow: 0 20px 60px rgba(25, 83, 158, 0.16);
	--popup-radius: 24px;
}

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

.site-popup,
.site-popup *,
.site-popup *::before,
.site-popup *::after {
	box-sizing: border-box;
}

.site-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.site-popup.is-open {
	display: flex;
}

.site-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(7, 20, 54, 0.58);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

/* Dialog */

.site-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 480px);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 32px;
	border-radius: 24px;
	background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 55%, #eaf3ff 100%);
	box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
	animation: sitePopupIn 0.2s ease;
}

@keyframes sitePopupIn {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Close button */

.site-popup .site-popup__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: var(--popup-text);
	background: #f1f5fb !important;
	font-size: 0;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	transition: background 0.18s ease, transform 0.18s ease;
}

.site-popup .site-popup__close::before {
	content: "×";
	display: block;
	margin-top: -2px;
	font-size: 28px;
	font-weight: 400;
	line-height: 1;
	color: var(--popup-text);
}

.site-popup .site-popup__close:hover {
	background: #e7eef8 !important;
	transform: none;
}

.site-popup .site-popup__close:focus,
.site-popup .site-popup__close:active {
	background: #f1f5fb !important;
	outline: none;
}

.site-popup .site-popup__close span {
	display: none;
}

/* Header */

.site-popup__head {
	padding-right: 42px;
	margin-bottom: 22px;
}

.site-popup__eyebrow {
	display: none;
}

.site-popup__title {
	margin: 0 42px 10px 0;
	font-size: 30px;
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.04em;
	color: var(--popup-text);
}

.site-popup__text {
	margin: 0 0 22px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--popup-muted);
}

/* Status */

.site-popup__status {
	display: block;
	margin: 0 0 14px;
	padding: 13px 15px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
}

.site-popup__status[hidden] {
	display: none;
}

.site-popup__status.is-success {
	color: #047857;
	background: #eafaf3;
}

.site-popup__status.is-error {
	color: #9b1c1c;
	background: #fff1f1;
}

/* Form */

.site-popup__form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

.site-popup__field {
	display: grid;
	gap: 7px;
}

.site-popup__field--wide {
	grid-column: auto;
}

.site-popup__field label {
	color: #23345f;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
}

.site-popup__field input,
.site-popup__field textarea {
	width: 100%;
	min-height: 52px;
	padding: 0 15px;
	border: 1px solid var(--popup-line);
	border-radius: 12px;
	color: var(--popup-text);
	font-size: 15px;
	line-height: 1.4;
	outline: none;
	background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 55%, #eaf3ff 100%);
	box-shadow: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.site-popup__field textarea {
	min-height: 96px;
	padding-top: 14px;
	padding-bottom: 14px;
	resize: vertical;
}

.site-popup__field input:focus,
.site-popup__field textarea:focus {
	border-color: var(--popup-blue);
	box-shadow: 0 0 0 4px rgba(5, 114, 255, 0.11);
}

.site-popup__field input::placeholder,
.site-popup__field textarea::placeholder {
	color: rgba(98, 114, 156, 0.72);
}

/* Consent */

.site-popup .form-consent {
	display: flex;
	align-items: flex-start;
	gap: 7px;

	margin: -2px 0 0;

	color: rgba(98, 114, 156, 0.86);
	font-size: 10px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0;
	cursor: pointer;
}

.site-popup .form-consent input {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	min-height: 16px;
	margin: 1px 0 0;

	accent-color: var(--popup-blue);
	cursor: pointer;
}

.site-popup .form-consent span {
	display: block;
	min-width: 0;
}

.site-popup .form-consent a {
	color: var(--popup-blue);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.site-popup .form-consent a:hover {
	color: var(--popup-blue-dark);
}

/* Submit */

.site-popup__submit {
	width: 100%;
	min-height: 56px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 0 24px;
	border: 0;
	border-radius: 12px;
	color: #ffffff;
	background: linear-gradient(135deg, var(--popup-blue), var(--popup-blue-dark));
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 14px 28px rgba(5, 114, 255, 0.28);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.site-popup__submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 32px rgba(5, 114, 255, 0.34);
}

.site-popup__submit:focus,
.site-popup__submit:active {
	outline: none;
}

/* Honeypot */

.site-popup__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Mobile */

@media (max-width: 620px) {
	.site-popup {
		align-items: center;
		padding: 14px;
	}

	.site-popup__dialog {
		width: min(100%, 480px);
		max-height: calc(100vh - 28px);
		padding: 24px;
		border-radius: 24px;
	}

	.site-popup__title {
		margin-right: 42px;
		font-size: 26px;
	}

	.site-popup__text {
		font-size: 15px;
	}

	.site-popup .form-consent {
		font-size: 9px;
		line-height: 1.3;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-popup__dialog,
	.site-popup .site-popup__close,
	.site-popup__field input,
	.site-popup__field textarea,
	.site-popup__submit,
	.site-form-success-notice {
		transition: none;
		animation: none;
	}
}

/* =========================
   Form success notice
   ========================= */

.site-form-success-notice {
	position: fixed;
	left: 50%;
	top: 50%;
	z-index: 99999;

	width: min(460px, calc(100% - 32px));
	padding: 22px 52px 22px 22px;

	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	align-items: center;
	gap: 16px;

	background: #ffffff;
	border: 1px solid rgba(34, 197, 94, 0.28);
	border-radius: 16px;

	box-shadow:
		0 26px 70px rgba(7, 31, 99, 0.18),
		0 0 0 1px rgba(255, 255, 255, 0.82) inset;

	opacity: 0;
	transform: translate(-50%, calc(-50% - 14px)) scale(0.98);
	pointer-events: none;

	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.site-form-success-notice.is-visible {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
	pointer-events: auto;
}

.site-form-success-notice__icon {
	width: 52px;
	height: 52px;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	color: #ffffff;
	background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
	border-radius: 50%;

	box-shadow:
		0 12px 26px rgba(34, 197, 94, 0.28),
		0 0 0 6px rgba(34, 197, 94, 0.10);
}

.site-form-success-notice__icon svg {
	width: 30px;
	height: 30px;

	fill: none;
	stroke: currentColor;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.site-form-success-notice__content {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.site-form-success-notice__content strong {
	color: #071f63;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.site-form-success-notice__content span {
	color: #151b2a;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.45;
}

.site-form-success-notice__close {
	position: absolute;
	right: 13px;
	top: 11px;

	width: 30px;
	height: 30px;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	color: #7b8491;
	background: transparent;
	border: 0;
	border-radius: 50%;

	font-size: 25px;
	font-weight: 400;
	line-height: 1;

	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease;
}

.site-form-success-notice__close:hover {
	color: #071f63;
	background: rgba(34, 197, 94, 0.10);
}

@media (max-width: 768px) {
	.site-form-success-notice {
		width: min(420px, calc(100% - 28px));
		padding: 18px 46px 18px 18px;

		grid-template-columns: 46px minmax(0, 1fr);
		gap: 14px;
	}

	.site-form-success-notice__icon {
		width: 46px;
		height: 46px;
	}

	.site-form-success-notice__icon svg {
		width: 27px;
		height: 27px;
	}

	.site-form-success-notice__content strong {
		font-size: 17px;
	}

	.site-form-success-notice__content span {
		font-size: 13px;
	}
}