/* Clinovex Lead Popup. Picks up the theme's colours (Theme Style settings) when present. */

.cxp {
	--cxp-primary: var(--color-primary-600, #1450e6);
	--cxp-primary-dark: var(--color-primary-700, #0f3fba);
	--cxp-ink: var(--color-ink, #061436);
	--cxp-muted: var(--color-secondary-600, #475569);
	--cxp-radius: var(--cx-btn-radius, 999px);
	--cxp-line: #cdd5e4;
	--cxp-error: #b42318;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	font-family: inherit;
	line-height: 1.5;
	color: var(--cxp-ink);
	visibility: hidden;
	opacity: 0;
	transition: opacity .2s ease, visibility .2s ease;
}
.cxp[hidden] { display: none; }
.cxp.is-open { visibility: visible; opacity: 1; }
.cxp *, .cxp *::before, .cxp *::after { box-sizing: border-box; }

html.cxp-lock { overflow: hidden; }

.cxp__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 20, 54, .62);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

.cxp__dialog {
	position: relative;
	width: min(100%, 760px);
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	overflow-y: auto;
	padding: clamp(1.5rem, 4vw, 2.75rem);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 40px 90px -30px rgba(6, 20, 54, .7);
	transform: translateY(14px) scale(.98);
	transition: transform .25s ease;
}
.cxp.is-open .cxp__dialog { transform: none; }
.cxp__dialog:focus { outline: none; }

.cxp__close {
	position: absolute;
	top: .85rem;
	right: .85rem;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--cxp-ink);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 18px -6px rgba(6, 20, 54, .6);
	transition: background .2s ease, transform .2s ease;
}
.cxp__close:hover { background: var(--cxp-primary); transform: scale(1.06); }
.cxp__close:focus-visible { outline: 3px solid var(--cxp-primary); outline-offset: 2px; }

.cxp__head { margin: 0 2.5rem 1.5rem 0; }
.cxp__head[hidden] { display: none; }
.cxp__title { margin: 0 0 .4rem; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.15; color: var(--cxp-ink); }
.cxp__sub { margin: 0; color: var(--cxp-muted); }

.cxp__form[hidden], .cxp__success[hidden] { display: none; }

.cxp__grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
	.cxp__grid { grid-template-columns: 1fr 1fr; }
	.cxp__field--full { grid-column: 1 / -1; }
}

.cxp__sr {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.cxp input[type="text"],
.cxp input[type="email"],
.cxp input[type="tel"],
.cxp select,
.cxp textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: .95rem 1rem;
	border: 1.5px solid var(--cxp-line);
	border-radius: 12px;
	background: #fff;
	color: var(--cxp-ink);
	font: inherit;
	font-size: 1rem; /* 16px stops iOS zooming into the field */
	line-height: 1.4;
	box-shadow: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.cxp select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 2.6rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .9rem center;
	background-size: 18px;
}
.cxp select:invalid { color: #7a8497; } /* grey "*Specialty" until a choice is made, like the other placeholders */
.cxp select option { color: var(--cxp-ink); }
.cxp textarea { min-height: 150px; resize: vertical; }
.cxp ::placeholder { color: #7a8497; opacity: 1; }
.cxp input:focus, .cxp select:focus, .cxp textarea:focus {
	outline: none;
	border-color: var(--cxp-primary);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--cxp-primary) 18%, transparent);
}

.cxp__field.has-error input,
.cxp__field.has-error select,
.cxp__field.has-error textarea { border-color: var(--cxp-error); }
.cxp__err { display: block; min-height: 0; margin-top: .3rem; font-size: .82rem; font-weight: 600; color: var(--cxp-error); }
.cxp__err:empty { display: none; }

.cxp__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cxp__status { margin: 1rem 0 0; text-align: center; font-weight: 600; color: var(--cxp-muted); }
.cxp__status:empty { display: none; }
.cxp__status.is-error { color: var(--cxp-error); }

.cxp__actions { display: flex; justify-content: center; margin-top: 1.25rem; }
.cxp__btn {
	min-width: 200px;
	padding: .95rem 2rem;
	border: 0;
	border-radius: var(--cxp-radius);
	background: var(--cxp-primary);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--cxp-primary) 85%, transparent);
	transition: background .2s ease, transform .2s ease, opacity .2s ease;
}
.cxp__btn:hover { background: var(--cxp-primary-dark); transform: translateY(-2px); }
.cxp__btn:focus-visible { outline: 3px solid var(--cxp-ink); outline-offset: 3px; }
.cxp__btn:disabled { opacity: .65; cursor: progress; transform: none; }

.cxp__note { margin: 1rem 0 0; text-align: center; font-size: .78rem; color: var(--cxp-muted); }
.cxp__note a { color: var(--cxp-primary-dark); text-decoration: underline; }

.cxp__success { padding: 1.5rem 0 .5rem; text-align: center; }
.cxp__success:focus { outline: none; }
.cxp__tick {
	display: inline-grid;
	place-items: center;
	width: 64px; height: 64px;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: var(--cxp-primary);
	color: #fff;
}
.cxp__success-text { margin: 0 auto 1.5rem; max-width: 36ch; font-size: 1.15rem; font-weight: 600; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
	.cxp, .cxp__dialog, .cxp__btn, .cxp__close { transition: none; }
}
