/* ClearVue resource gate — inline form modal (preloaded, hidden until needed) */
.cv-gate-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.8);
	/* Parked hidden but still laid out so the Pipedrive iframe preloads + sizes
	   itself off-screen. Revealing it later is instant — no fetch, no grow. */
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cv-gate-modal.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

/* Lock background scroll while the modal is open. */
html.cv-gate-open {
	overflow: hidden;
}

.cv-gate-card {
	position: relative;
	width: 100%;
	max-width: 470px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 28px 28px 24px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	text-align: center;
}

.cv-gate-title {
	margin: 0 0 8px;
	font-family: 'Inter', sans-serif;
	font-weight: 800;
	font-size: 30px;
	line-height: 1.2;
	color: #08173a;
}

.cv-gate-sub {
	margin: 0 auto 16px;
	max-width: 416px; /* line up with the Pipedrive form's fixed field width */
	font-family: 'Inter', sans-serif;
	font-weight: 300;
	font-size: 16px;
	line-height: 1.5;
	color: #5a6472;
}

/* Form area: spinner sits behind the iframe; iframe covers it once mounted. */
.cv-gate-form {
	position: relative;
	min-height: 120px;
}

.cv-gate-form .pipedriveWebForms,
.cv-gate-form .pipedriveWebForms iframe {
	width: 100% !important;
	max-width: 100% !important;
	position: relative;
	z-index: 1;
}

.cv-gate-spinner {
	position: absolute;
	top: 40px;
	left: 50%;
	margin-left: -22px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid rgba(8, 23, 58, 0.15);
	border-top-color: #5BC4BF;
	animation: cv-spin 0.8s linear infinite;
	z-index: 0;
}

/* Once the form has reported a height it's rendered — drop the spinner. */
.cv-gate-modal.cv-form-ready .cv-gate-spinner {
	display: none;
}

.cv-gate-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 32px;
	height: 32px;
	padding: 0;
	background: none !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: #08173a !important;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.5;
}

.cv-gate-close:hover {
	background: none !important;
	opacity: 1;
}

@keyframes cv-spin {
	to { transform: rotate(360deg); }
}
