.gato-local-form-popup[hidden] {
	display: none !important;
}

body.gato-local-form-popup-open {
	overflow: hidden;
}

/* The imported WhatsApp widget uses a nine-digit z-index and would otherwise
 * sit above the inquiry fields on mobile. Keep it behind the modal only while
 * the local compatibility dialog is open. */
body.gato-local-form-popup-open .wa__btn_popup,
body.gato-local-form-popup-open .wa__popup_chat_box {
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.gato-local-form-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	isolation: isolate;
}

.gato-local-form-popup__backdrop {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(0, 0, 0, 0.72);
}

.gato-local-form-popup__dialog {
	position: relative;
	width: min(800px, calc(100vw - 48px));
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow: auto;
	background: #fff;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
	outline: none;
	-webkit-overflow-scrolling: touch;
}

.gato-local-form-popup__close {
	position: absolute;
	top: 10px;
	right: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #222;
	font: 400 34px/1 Arial, sans-serif;
	cursor: pointer;
}

.gato-local-form-popup__close:hover,
.gato-local-form-popup__close:focus-visible {
	background: #eef7fc;
	color: #0091db;
	outline: 2px solid #0091db;
	outline-offset: 2px;
}

/* The three approved Popup templates share this exact widget ID and their
 * Elementor Pro Custom CSS. Rebuild that known form layout only inside the
 * local fallback dialog; unrelated CF7 forms remain untouched. */
.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7 form > p {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	margin: 0;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap {
	display: block;
	box-sizing: border-box;
	width: calc((100% - 20px) / 2);
	margin-bottom: 20px;
	padding: 0 16px;
	border: 1px solid #999;
	border-radius: 8px;
	background: #fff;
	font-size: 0;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap[data-name="Message"],
.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap[data-name^="quiz-"] {
	width: 100%;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap > input:not([type="submit"]),
.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap > textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	color: #1a1a1a;
	font-size: 16px;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap > input:not([type="submit"]) {
	height: 50px;
	line-height: 50px;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap > textarea {
	height: 120px;
	padding: 16px 0;
	line-height: 28px;
	resize: vertical;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form input::placeholder,
.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form textarea::placeholder {
	color: #1a1a1a;
	opacity: 1;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap[data-name^="quiz-"] > label {
	display: flex;
	align-items: center;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap[data-name^="quiz-"] > label > .wpcf7-quiz-label {
	display: block;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #1a1a1a;
	font-size: 16px;
	font-weight: 400;
	letter-spacing: 2px;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap[data-name^="quiz-"] > label > input.wpcf7-quiz {
	flex: 1 1 auto;
	min-width: 0;
	height: 50px;
	padding: 0 2px;
	color: #1a1a1a;
	line-height: 50px;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap:focus-within {
	border-color: #0091db;
	box-shadow: 0 0 0 2px rgba(0, 145, 219, 0.18);
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form .wpcf7-form-control-wrap input:focus-visible,
.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form .wpcf7-form-control-wrap textarea:focus-visible {
	outline: none;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form input.wpcf7-submit {
	display: block;
	box-sizing: border-box;
	width: 100px !important;
	min-width: 100px;
	height: 40px !important;
	margin: 10px auto 30px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: #1a1a1a !important;
	box-shadow: none !important;
	color: #fff !important;
	font-size: 14px;
	line-height: 40px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form input.wpcf7-submit:hover,
.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form input.wpcf7-submit:focus-visible {
	background: #0091db !important;
	outline: 2px solid #0091db;
	outline-offset: 2px;
}

.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form input.wpcf7-submit:disabled {
	cursor: wait;
	opacity: 0.65;
}

@media (max-width: 880px) {
	.gato-local-form-popup__dialog {
		width: min(640px, calc(100vw - 40px));
	}
}

@media (max-width: 767px) {
	.gato-local-form-popup {
		align-items: flex-end;
		padding: 16px 0 0;
	}

	.gato-local-form-popup__dialog {
		width: 100%;
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
		border-radius: 16px 16px 0 0;
	}

	.gato-local-form-popup__close {
		top: 6px;
		right: 8px;
	}

	.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap {
		width: 100%;
		margin-bottom: 10px;
		padding: 0 12px;
		border-radius: 4px;
	}

	.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap > input:not([type="submit"]) {
		height: 46px;
		line-height: 46px;
	}

	.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap > textarea {
		height: 96px;
		padding: 8px 0;
		line-height: 22px;
	}

	.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form p > .wpcf7-form-control-wrap[data-name^="quiz-"] > label > input.wpcf7-quiz {
		height: 46px;
		line-height: 46px;
	}

	.gato-local-form-popup__content .elementor-element-5dad6c7.contact_form .wpcf7-form input.wpcf7-submit {
		width: 100% !important;
		height: 48px !important;
		margin: 0 auto !important;
		border-radius: 4px !important;
		line-height: 48px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.gato-local-form-popup__backdrop {
		animation: gato-local-popup-fade-in 160ms ease-out both;
	}

	.gato-local-form-popup__dialog {
		animation: gato-local-popup-rise-in 200ms ease-out both;
	}
}

@keyframes gato-local-popup-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes gato-local-popup-rise-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}
