/* ==========================================================
   Apple Homes – Exit Intent Popup
   ========================================================== */

.ah-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ah-popup-overlay.is-visible {
	opacity: 1;
	visibility: visible;
}

/* ----------------------------------------------------------
   Modal shell
   ---------------------------------------------------------- */
.ah-popup {
	position: relative;
	display: flex;
	width: 90vw;
	max-width: 820px;
	max-height: 90vh;
	overflow: hidden;
	background: #ede8e1;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	transform: translateY(12px);
	transition: transform 0.3s ease;
}

.ah-popup-overlay.is-visible .ah-popup {
	transform: translateY(0);
}

/* ----------------------------------------------------------
   Close button
   ---------------------------------------------------------- */
.ah-popup__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #1a1a1a;
	transition: opacity 0.2s;
}

.ah-popup__close:hover {
	opacity: 0.55;
}

.ah-popup__close svg {
	width: 22px;
	height: 22px;
}

/* ----------------------------------------------------------
   Left panel — form area
   ---------------------------------------------------------- */
.ah-popup__left {
	flex: 0 0 50%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 52px 44px 52px 44px;
	box-sizing: border-box;
}

.ah-popup__headline {
	margin: 0 0 18px;
	font-family: inherit;
	font-size: clamp(1.45rem, 2.5vw, 2rem);
	font-weight: 400;
	line-height: 1.25;
	color: #1a1a1a;
	letter-spacing: -0.01em;
}

.ah-popup__subtext {
	margin: 0 0 28px;
	font-size: 0.95rem;
	line-height: 1.6;
	color: #1a1a1a;
	opacity: 0.8;
}

/* ----------------------------------------------------------
   Gravity Forms overrides inside popup
   ---------------------------------------------------------- */
.ah-popup__form .gform_wrapper,
.ah-popup__form .gform_wrapper.gravity-theme {
	margin: 0;
	padding: 0;
}

.ah-popup__form .gform_body {
	margin: 0;
}

.ah-popup__form .gfield {
	margin-bottom: 20px;
	padding: 0;
}

.ah-popup__form .gfield_label {
	display: block;
	margin-bottom: 4px;
	font-size: 0.85rem;
	color: #1a1a1a;
	letter-spacing: 0.01em;
}

/* Underline-only input style */
.ah-popup__form input[type="email"],
.ah-popup__form input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	background: transparent;
	border: none;
	border-bottom: 1px solid #1a1a1a;
	border-radius: 0;
	padding: 6px 0;
	font-size: 0.95rem;
	color: #1a1a1a;
	outline: none;
	transition: border-color 0.2s;
}

.ah-popup__form input[type="email"]:focus,
.ah-popup__form input[type="text"]:focus {
	border-bottom-color: #555;
}

.ah-popup__form input[type="email"]::placeholder,
.ah-popup__form input[type="text"]::placeholder {
	color: #1a1a1a;
	opacity: 0.45;
}

/* Submit button */
.ah-popup__form .gform_footer,
.ah-popup__form .gform_page_footer {
	margin: 0;
	padding: 0;
}

.ah-popup__form input[type="submit"],
.ah-popup__form button[type="submit"] {
	display: block;
	width: 100%;
	padding: 14px 24px;
	background: #1a1a1a;
	color: #fff;
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border: none;
	border-radius: 0;
	cursor: pointer;
	transition: background 0.2s;
}

.ah-popup__form input[type="submit"]:hover,
.ah-popup__form button[type="submit"]:hover {
	background: #333;
}

/* Validation messages */
.ah-popup__form .gfield_description,
.ah-popup__form .validation_message {
	font-size: 0.8rem;
}

/* Success message */
.ah-popup__form .gform_confirmation_wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 32px 0 0;
}

.ah-popup__form .gform_confirmation_wrapper::before {
	content: '';
	display: block;
	width: 32px;
	height: 1px;
	background: #1a1a1a;
	margin-bottom: 20px;
	opacity: 0.4;
}

.ah-popup__form .gform_confirmation_message {
	font-size: 1rem;
	line-height: 1.6;
	color: #1a1a1a;
}

/* ----------------------------------------------------------
   Right panel — image
   ---------------------------------------------------------- */
.ah-popup__right {
	flex: 0 0 50%;
	background-size: cover;
	background-position: center;
	min-height: 360px;
}

/* ----------------------------------------------------------
   Responsive — stack on small screens
   ---------------------------------------------------------- */
@media (max-width: 600px) {
	.ah-popup {
		flex-direction: column;
		width: 96vw;
		max-height: 96vh;
		overflow-y: auto;
	}

	.ah-popup__left {
		flex: none;
		padding: 44px 28px 36px;
	}

	.ah-popup__right {
		flex: none;
		height: 220px;
		min-height: 0;
	}
}
