:root {
	--mg-popup-green: #82ca3a;
	--mg-popup-dark: #0f3f2e;
	--mg-popup-text: #31453b;
	--mg-popup-muted: #718077;
	--mg-popup-line: #dfe8db;
	--mg-popup-soft: #f6f9f3;
}

body.mg-contact-modal-open { overflow: hidden; }
.mg-contact-modal[hidden] { display: none !important; }

.mg-contact-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: grid;
	place-items: center;
	padding: 24px;
	opacity: 0;
	transition: opacity .18s ease;
}

.mg-contact-modal.is-open { opacity: 1; }

.mg-contact-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(7,24,17,.72);
	backdrop-filter: blur(5px);
}

.mg-contact-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(610px, 100%);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 36px;
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 28px 80px rgba(0,0,0,.24);
	transform: translateY(12px) scale(.985);
	transition: transform .18s ease;
}

.mg-contact-modal.is-open .mg-contact-modal__dialog {
	transform: translateY(0) scale(1);
}

.mg-contact-modal__close {
	position: absolute;
	top: 15px;
	right: 15px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mg-popup-soft);
	color: var(--mg-popup-dark);
	font-size: 27px;
	line-height: 1;
	cursor: pointer;
}

.mg-contact-modal__eyebrow {
	display: block;
	margin-bottom: 10px;
	color: #6da82d;
	font-size: 11px;
	font-weight: 900;
	letter-spacing: .15em;
}

.mg-contact-modal__head {
	padding-right: 35px;
	margin-bottom: 24px;
}

.mg-contact-modal__head h2 {
	margin: 0 0 10px;
	color: var(--mg-popup-dark);
	font-size: clamp(28px,5vw,38px);
	line-height: 1.08;
}

.mg-contact-modal__head p {
	margin: 0;
	color: var(--mg-popup-muted);
	font-size: 15px;
	line-height: 1.55;
}

.mg-cf7-form {
	display: grid;
	gap: 15px;
}

.mg-cf7-field label {
	display: block;
	margin-bottom: 7px;
	color: var(--mg-popup-dark);
	font-size: 13px;
	font-weight: 800;
}

.mg-cf7-field input,
.mg-cf7-field select,
.mg-cf7-field textarea {
	width: 100%;
	margin: 0;
	border: 1px solid var(--mg-popup-line) !important;
	border-radius: 11px !important;
	background: var(--mg-popup-soft) !important;
	color: var(--mg-popup-text) !important;
	box-shadow: none !important;
	font-size: 15px !important;
}

.mg-cf7-field input,
.mg-cf7-field select {
	min-height: 50px;
	padding: 10px 14px !important;
}

.mg-cf7-field textarea {
	min-height: 105px;
	padding: 12px 14px !important;
	resize: vertical;
}

.mg-cf7-submit {
	width: 100% !important;
	min-height: 54px !important;
	border: 0 !important;
	border-radius: 11px !important;
	background: var(--mg-popup-green) !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 900 !important;
	cursor: pointer;
}

.mg-cf7-consent {
	color: var(--mg-popup-muted);
	font-size: 12px;
	line-height: 1.45;
}

.mg-cf7-consent .wpcf7-list-item { margin: 0; }
.mg-cf7-consent a { color: #5f9828; }

.mg-contact-modal .wpcf7-response-output {
	margin: 14px 0 0 !important;
	padding: 10px 12px !important;
	border-width: 1px !important;
	border-radius: 9px;
	font-size: 13px;
}

@media (max-width:640px) {
	.mg-contact-modal {
		align-items: end;
		padding: 12px;
	}

	.mg-contact-modal__dialog {
		width: 100%;
		max-height: calc(100vh - 24px);
		padding: 28px 18px 20px;
		border-radius: 20px;
	}
}
