/**
 * Модальний попап для форми Contact Form 7 (без шорткодів — на блоках Gutenberg).
 * Блок «Група» з класом .mfx-modal стає попапом; form-modal.js додає фон/діалог/хрестик.
 * Вигляд — за референсом, кольори — з теми Марічки. Стилі самодостатні (літерали).
 */

html.mfx-lock {
	overflow: hidden;
}

/* контейнер-група: до JS прихована, щоб форма не блимала інлайном */
.mfx-modal {
	display: none;
}

.mfx-modal.mfx-showing {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 1000;
	align-items: center;
	justify-content: center;
	padding: 20px;
	margin: 0;
}

.mfx-modal .mfx-overlay {
	position: absolute;
	inset: 0;
	background: rgba(23, 18, 51, .55);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
	opacity: 0;
	transition: opacity .25s ease;
}

.mfx-modal.is-open .mfx-overlay {
	opacity: 1;
}

.mfx-modal .mfx-dialog {
	position: relative;
	width: 100%;
	max-width: 700px;
	max-height: calc(100vh - 40px);
	overflow: auto;
	background: #fff;
	border-radius: 28px;
	padding: clamp(28px, 5vw, 46px) clamp(24px, 4.5vw, 44px) clamp(26px, 4vw, 40px);
	box-shadow: 0 40px 110px rgba(23, 18, 51, .38);
	font-family: 'Manrope', system-ui, sans-serif;
	color: #171233;
	opacity: 0;
	transform: translateY(16px) scale(.98);
	transition: transform .3s cubic-bezier(.3, .8, .3, 1), opacity .3s ease;
}

.mfx-modal.is-open .mfx-dialog {
	opacity: 1;
	transform: none;
}

.mfx-modal .mfx-close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 40px;
	height: 40px;
	border: 0;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	z-index: 3;
	transition: 0.2s;
	background: #EFEBFC;
	color: #171233;
}

.mfx-modal .mfx-close:hover {
	transform: rotate(90deg);
}

/* заголовок / підзаголовок (блоки Heading + абзац із класом .mfx-sub усередині групи) */
.mfx-dialog :is(h1, h2, h3, h4) {
	margin: 0 0 6px;
	text-align: center;
	text-transform: uppercase;
	font-size: clamp(24px, 3.6vw, 32px);
	font-weight: 800;
	letter-spacing: .01em;
	line-height: 1.1;
	color: #171233;
}

.mfx-dialog .mfx-sub {
	margin: 0 auto;
	max-width: 34ch;
	text-align: center;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	color: #5B5677;
}

/* ---------- поля Contact Form 7 ---------- */
.mfx-dialog .wpcf7 {
	margin: clamp(18px, 2.5vw, 26px) 0 0;
}

.mfx-dialog .wpcf7-form p {
	margin: 0 0 16px;
}

.mfx-dialog .wpcf7-form p:last-of-type {
	margin-bottom: 0;
}

.mfx-dialog label {
	display: block;
	font-size: 13.5px;
	font-weight: 700;
	color: #171233;
}

.mfx-dialog label .req {
	color: #A78BFA;
}

.mfx-dialog input[type=text],
.mfx-dialog input[type=tel],
.mfx-dialog input[type=email],
.mfx-dialog input[type=url],
.mfx-dialog input[type=number],
.mfx-dialog textarea,
.mfx-dialog select {
	font: inherit;
	font-size: 15px;
	color: #171233;
	background: #F3F1FB;
	border: 1.5px solid transparent;
	border-radius: 14px;
	padding: 16px 18px;
	width: 100%;
	margin-top: 8px;
	transition: border-color .2s, background .2s, box-shadow .2s;
}

.mfx-dialog input::placeholder,
.mfx-dialog textarea::placeholder {
	color: #9a95b0;
}

.mfx-dialog input:focus,
.mfx-dialog textarea:focus,
.mfx-dialog select:focus {
	outline: 0;
	border-color: #A78BFA;
	background: #fff;
	box-shadow: 0 0 0 4px rgba(167, 139, 250, .16);
}

.mfx-dialog textarea {
	resize: vertical;
	min-height: 30px;
	max-height: 150px;
	overflow-y: auto;
}

.mfx-dialog .wpcf7-submit {
	margin-top: 8px;
	display: block;
	width: 100%;
	text-align: center;
	font: inherit;
	font-weight: 800;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: .04em;
	border: 0;
	border-radius: 999px;
	padding: 18px 54px 18px 30px;
	color: #fff;
	background-color: #171233;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15'/%3E%3Cpath d='m13 6 6 6-6 6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 24px center;
	background-size: 20px 20px;
	cursor: pointer;
	transition: background-color .2s, transform .15s;
}

.mfx-dialog .wpcf7-submit:hover {
	background-color: #251C52;
}

.mfx-dialog .wpcf7-submit:active {
	transform: scale(.99);
}

.mfx-dialog .wpcf7-spinner {
	margin: 12px auto 0;
	display: block;
}

.mfx-dialog .mfx-consent {
	margin: 14px 0 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: #5B5677;
	text-align: center;
}

.mfx-dialog .mfx-consent a {
	color: #6D28D9;
	font-weight: 600;
}

.mfx-dialog .wpcf7-not-valid-tip {
	color: #e0526e;
	font-size: 12.5px;
	font-weight: 600;
	margin-top: 6px;
}

.mfx-dialog input.wpcf7-not-valid,
.mfx-dialog textarea.wpcf7-not-valid {
	border-color: #e0526e;
	background: #fff;
}

.mfx-dialog .wpcf7-response-output {
	margin: 16px 0 0 !important;
	padding: 12px 16px !important;
	border-radius: 12px;
	font-size: 13.5px;
	font-weight: 600;
	text-align: center;
}

/* кнопка-тригер: працює і на звичайному <a>/<button>, і на core-кнопці Gutenberg
   (клас mfx-trigger на блоці «Кнопка»). Темна — як у прикладі. */
a.mfx-trigger,
button.mfx-trigger,
.mfx-trigger .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	font-family: 'Manrope', system-ui, sans-serif;
	font-weight: 700;
	font-size: 15.5px;
	line-height: 1;
	border-radius: 999px;
	padding: 15px 30px;
	cursor: pointer;
	border: 1.5px solid transparent;
	background: #171233;
	color: #fff;
	text-decoration: none;
	transition: background .2s, transform .15s;
}

a.mfx-trigger:hover,
button.mfx-trigger:hover,
.mfx-trigger .wp-block-button__link:hover {
	background: #251C52;
	color: #fff;
}

a.mfx-trigger:active,
button.mfx-trigger:active,
.mfx-trigger .wp-block-button__link:active {
	transform: scale(.98);
}

@media (prefers-reduced-motion: reduce) {

	.mfx-modal .mfx-overlay,
	.mfx-modal .mfx-dialog {
		transition: none;
	}
}