/**
 * Lead Connect form styles.
 * Everything is scoped to .qelc-root so themes stay out of the way.
 */

.qelc-root {
	--qelc-accent: #2563eb;
	--qelc-ink: #0f172a;
	--qelc-body: #475569;
	--qelc-muted: #64748b;
	--qelc-line: #e2e8f0;
	--qelc-field: #cbd5e1;
	--qelc-surface: #ffffff;
	--qelc-tint: color-mix(in srgb, var(--qelc-accent) 9%, #fff);
	--qelc-danger: #dc2626;
	--qelc-radius: 12px;

	box-sizing: border-box;
	max-width: var(--qelc-max-width, 840px);
	margin: 0 auto;
	color: var(--qelc-body);
	font-size: 16px;
	line-height: 1.5;
}

.qelc-root *,
.qelc-root *::before,
.qelc-root *::after {
	box-sizing: inherit;
}

.qelc-title {
	margin: 0 0 0.5rem;
	color: var(--qelc-ink);
	font-size: 1.75rem;
	line-height: 1.2;
}

.qelc-intro {
	margin-bottom: 1.5rem;
}

.qelc-intro p:last-child {
	margin-bottom: 0;
}

/* Cards ------------------------------------------------------------------ */

.qelc-card {
	margin: 0 0 1.25rem;
	padding: 1.5rem;
	border: 1px solid var(--qelc-line);
	border-radius: var(--qelc-radius);
	background: var(--qelc-surface);
}

.qelc-card__title {
	margin: 0 0 1rem;
	padding: 0;
	border: 0;
	color: var(--qelc-ink);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
}

.qelc-card > .qelc-card__title + .qelc-help {
	margin-top: -0.5rem;
}

/* Fields ----------------------------------------------------------------- */

.qelc-field {
	margin-bottom: 1.125rem;
}

.qelc-field:last-child {
	margin-bottom: 0;
}

.qelc-fieldset {
	min-width: 0;
	margin: 0 0 1.125rem;
	padding: 0;
	border: 0;
}

.qelc-fieldset legend {
	display: block;
	width: 100%;
	margin-bottom: 0.4rem;
	padding: 0;
	color: var(--qelc-ink);
	font-size: 0.875rem;
	font-weight: 600;
}

.qelc-fieldset legend.qelc-card__title {
	font-size: 1.125rem;
	margin-bottom: 0.5rem;
}

.qelc-field label,
.qelc-field > span {
	display: block;
	margin-bottom: 0.4rem;
	color: var(--qelc-ink);
	font-size: 0.875rem;
	font-weight: 600;
}

.qelc-req {
	color: var(--qelc-danger);
	font-weight: 600;
}

.qelc-optional {
	color: var(--qelc-muted);
	font-weight: 400;
}

.qelc-help {
	margin: 0 0 0.75rem;
	color: var(--qelc-muted);
	font-size: 0.8125rem;
}

.qelc-help--muted {
	margin: 0.6rem 0 0;
	font-style: italic;
	color: #94a3b8;
}

.qelc-root input[type="text"],
.qelc-root input[type="email"],
.qelc-root input[type="tel"],
.qelc-root input[type="url"],
.qelc-root input[type="number"],
.qelc-root select,
.qelc-root textarea {
	width: 100%;
	max-width: 100%;
	padding: 0.6rem 0.7rem;
	border: 1px solid var(--qelc-field);
	border-radius: 8px;
	background-color: #fff;
	color: var(--qelc-ink);
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.qelc-root textarea {
	min-height: 6.5rem;
	resize: vertical;
}

.qelc-root input:focus,
.qelc-root select:focus,
.qelc-root textarea:focus {
	border-color: var(--qelc-accent);
	outline: 2px solid color-mix(in srgb, var(--qelc-accent) 35%, transparent);
	outline-offset: 1px;
}

.qelc-root .qelc-narrow {
	max-width: 9rem;
}

/**
 * Placeholders. Set explicitly so a theme can't restyle them into looking
 * like real values, and cleared on focus so it's obvious the field is empty
 * and ready to type in.
 */
.qelc-root input::placeholder,
.qelc-root textarea::placeholder {
	color: #94a3b8;
	opacity: 1;
	font-style: normal;
}

.qelc-root input:focus::placeholder,
.qelc-root textarea:focus::placeholder {
	color: transparent;
}

.qelc-root input::-ms-input-placeholder,
.qelc-root textarea::-ms-input-placeholder {
	color: #94a3b8;
}

.qelc-root .qelc-invalid,
.qelc-root input.qelc-invalid,
.qelc-root select.qelc-invalid {
	border-color: var(--qelc-danger);
}

.qelc-root .qelc-pills.qelc-invalid,
.qelc-root fieldset.qelc-invalid {
	border: 0;
}

.qelc-root .qelc-pills.qelc-invalid .qelc-pill span,
.qelc-root fieldset.qelc-invalid .qelc-tile__body {
	border-color: var(--qelc-danger);
}

.qelc-grid {
	display: grid;
	gap: 1rem;
}

@media (min-width: 620px) {
	.qelc-grid--2 {
		grid-template-columns: 1fr 1fr;
	}
}

.qelc-inline {
	display: flex;
	gap: 0.5rem;
}

.qelc-inline select {
	width: auto;
	flex: 0 0 auto;
}

/* Tiles (applicant type, products) --------------------------------------- */

.qelc-tiles {
	display: grid;
	gap: 0.75rem;
}

@media (min-width: 620px) {
	.qelc-tiles--2 {
		grid-template-columns: 1fr 1fr;
	}
}

.qelc-tile {
	display: block;
	margin: 0;
	cursor: pointer;
}

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

.qelc-tile__body {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	height: 100%;
	padding: 1rem;
	border: 2px solid var(--qelc-line);
	border-radius: 10px;
	background: #fff;
	transition: border-color 120ms ease, background-color 120ms ease;
}

.qelc-tiles--2 .qelc-tile:not(.qelc-tile--check) .qelc-tile__body {
	flex-direction: column;
	gap: 0.2rem;
	text-align: center;
}

.qelc-tile__label {
	color: var(--qelc-ink);
	font-size: 0.9375rem;
	font-weight: 600;
}

.qelc-tile__hint {
	color: var(--qelc-muted);
	font-size: 0.8125rem;
}

.qelc-tile:hover .qelc-tile__body {
	border-color: color-mix(in srgb, var(--qelc-accent) 45%, #fff);
}

.qelc-tile input:checked + .qelc-tile__body {
	border-color: var(--qelc-accent);
	background: var(--qelc-tint);
}

.qelc-tile input:focus-visible + .qelc-tile__body {
	outline: 2px solid var(--qelc-accent);
	outline-offset: 2px;
}

.qelc-box {
	flex: 0 0 auto;
	width: 1.125rem;
	height: 1.125rem;
	border: 2px solid var(--qelc-field);
	border-radius: 4px;
	background: #fff;
}

.qelc-tile input:checked + .qelc-tile__body .qelc-box {
	border-color: var(--qelc-accent);
	background: var(--qelc-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.8rem no-repeat;
}

/* Pills (radius, project types, yes/no) ---------------------------------- */

.qelc-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.qelc-pill {
	margin: 0;
	cursor: pointer;
}

.qelc-pill input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.qelc-pill > span {
	display: block;
	padding: 0.55rem 1.1rem;
	border: 2px solid var(--qelc-line);
	border-radius: 999px;
	background: #fff;
	color: var(--qelc-body);
	font-size: 0.875rem;
	font-weight: 500;
	white-space: nowrap;
	transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.qelc-pill:hover > span {
	border-color: color-mix(in srgb, var(--qelc-accent) 45%, #fff);
}

.qelc-pill input:checked + span {
	border-color: var(--qelc-accent);
	background: var(--qelc-tint);
	color: color-mix(in srgb, var(--qelc-accent) 80%, #000);
	font-weight: 600;
}

.qelc-pill input:focus-visible + span {
	outline: 2px solid var(--qelc-accent);
	outline-offset: 2px;
}

.qelc-pill--no input:checked + span {
	border-color: #94a3b8;
	background: #f1f5f9;
	color: var(--qelc-ink);
}

.qelc-pills[data-qelc-radius] .qelc-pill {
	flex: 1 1 5rem;
}

.qelc-pills[data-qelc-radius] .qelc-pill > span {
	text-align: center;
}

/* Yes/no statement rows -------------------------------------------------- */

.qelc-statements {
	margin-top: 0.5rem;
	border-top: 1px solid var(--qelc-line);
}

.qelc-statement {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--qelc-line);
}

.qelc-statement:last-child {
	border-bottom: 0;
}

.qelc-statement__label {
	color: var(--qelc-ink);
	font-size: 0.875rem;
	font-weight: 500;
}

.qelc-yesno {
	display: flex;
	flex: 0 0 auto;
	gap: 0.4rem;
}

.qelc-yesno .qelc-pill > span {
	padding: 0.35rem 0.9rem;
	font-size: 0.8125rem;
}

/* Submit, alerts, success ----------------------------------------------- */

.qelc-root .qelc-submit {
	display: block;
	width: 100%;
	padding: 0.95rem 1.5rem;
	border: 0;
	border-radius: 10px;
	background: var(--qelc-accent);
	color: #fff;
	font: inherit;
	font-size: 1.0625rem;
	font-weight: 600;
	cursor: pointer;
	transition: filter 120ms ease;
}

.qelc-root .qelc-submit:hover {
	filter: brightness(0.92);
}

.qelc-root .qelc-submit:focus-visible {
	outline: 2px solid var(--qelc-accent);
	outline-offset: 3px;
}

.qelc-root .qelc-submit[disabled] {
	opacity: 0.65;
	cursor: default;
}

.qelc-alert {
	margin-bottom: 1.25rem;
	padding: 0.85rem 1rem;
	border: 1px solid #fecaca;
	border-left-width: 4px;
	border-left-color: var(--qelc-danger);
	border-radius: 8px;
	background: #fef2f2;
	color: #991b1b;
	font-size: 0.9375rem;
}

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

/* Inline field errors ---------------------------------------------------- */

.qelc-error-text {
	display: flex;
	align-items: flex-start;
	gap: 0.35rem;
	margin: 0.35rem 0 0;
	color: var(--qelc-danger);
	font-size: 0.8125rem;
	line-height: 1.4;
}

.qelc-error-text::before {
	content: "!";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 1rem;
	height: 1rem;
	margin-top: 0.05rem;
	border-radius: 50%;
	background: var(--qelc-danger);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
}

.qelc-alert ul {
	margin: 0.5rem 0 0;
	padding-left: 1.15rem;
}

.qelc-alert p {
	margin: 0;
}

/* Address suggestions ---------------------------------------------------- */

.qelc-autocomplete {
	position: relative;
}

.qelc-suggestions {
	position: absolute;
	z-index: 50;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 15rem;
	margin: 0;
	padding: 0.25rem;
	overflow-y: auto;
	list-style: none;
	border: 1px solid var(--qelc-field);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.qelc-suggestion {
	margin: 0;
	padding: 0.55rem 0.65rem;
	border-radius: 6px;
	color: var(--qelc-ink);
	font-size: 0.9rem;
	line-height: 1.35;
	cursor: pointer;
}

.qelc-suggestion:hover,
.qelc-suggestion.is-active {
	background: var(--qelc-tint);
}

/* The legacy Google dropdown, nudged to match the fields. */
.pac-container {
	z-index: 100000;
	border-radius: 8px;
	font-family: inherit;
}

.qelc-success {
	padding: 3rem 2rem;
	border: 1px solid var(--qelc-line);
	border-radius: var(--qelc-radius);
	background: var(--qelc-surface);
	text-align: center;
}

.qelc-success__mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4.5rem;
	height: 4.5rem;
	margin: 0 auto 1.25rem;
	border-radius: 50%;
	background: #dcfce7;
	color: #16a34a;
}

.qelc-success__heading {
	margin: 0 0 0.75rem;
	color: var(--qelc-ink);
	font-size: 1.5rem;
	line-height: 1.25;
}

.qelc-success__body {
	margin: 0 auto;
	max-width: 34rem;
	font-size: 1.0625rem;
}

.qelc-success__body p:last-child {
	margin-bottom: 0;
}

/* Fallback for browsers without color-mix() ------------------------------- */

@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.qelc-tile:hover .qelc-tile__body,
	.qelc-pill:hover > span {
		border-color: #93b4fb;
	}

	.qelc-root input:focus,
	.qelc-root select:focus,
	.qelc-root textarea:focus {
		outline-color: #93b4fb;
	}

	.qelc-pill input:checked + span {
		color: #1d4ed8;
	}
}

@media (prefers-reduced-motion: reduce) {
	.qelc-root * {
		transition: none !important;
	}
}

/* ------------------------------------------------------------------------
 * Multi-step form
 * --------------------------------------------------------------------- */

/* Clear of Salient's sticky header when a step scrolls into view. */
.qelc-root {
	scroll-margin-top: calc(var(--header-nav-height, 90px) + 24px);
}

/* Before the script runs: only the first step, no navigation yet. */
.qelc-js .qelc-form--steps .qelc-step ~ .qelc-step {
	display: none;
}

.qelc-js .qelc-form--steps:not(.is-wizard) .qelc-actions {
	display: none;
}

/* Once the wizard owns the form: exactly one step at a time. */
.qelc-js .qelc-form--steps.is-wizard .qelc-step {
	display: none;
}

.qelc-js .qelc-form--steps.is-wizard .qelc-step.is-current {
	display: block;
	animation: qelc-step-in 220ms ease-out;
}

@keyframes qelc-step-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Progress ---------------------------------------------------------------- */

.qelc-progress {
	margin: 0 0 1.25rem;
}

.qelc-root .qelc-progress__track {
	display: flex;
	gap: 6px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	counter-reset: none;
}

.qelc-root .qelc-progress__track > * {
	flex: 1 1 0;
	display: block;
	height: 7px;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 999px;
	background: var(--qelc-line);
	list-style: none !important;
	transition: background-color 200ms ease;
}

/* Some themes add their own bullets or counters to list items. */
.qelc-root .qelc-progress__track > *::marker,
.qelc-root .qelc-progress__track > *::before,
.qelc-root .qelc-progress__track > *::after {
	content: none !important;
	display: none !important;
}

.qelc-root .qelc-progress__track > *.is-done,
.qelc-root .qelc-progress__track > *.is-current {
	background: var(--qelc-accent);
}

.qelc-root .qelc-progress__track > *.is-current {
	opacity: 0.55;
}

/* Navigation -------------------------------------------------------------- */

.qelc-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.qelc-root .qelc-actions .qelc-submit,
.qelc-root .qelc-next {
	flex: 1 1 auto;
}

.qelc-root .qelc-next {
	display: block;
	padding: 0.95rem 1.5rem;
	border: 0;
	border-radius: 10px;
	background: var(--qelc-accent);
	color: #fff;
	font: inherit;
	font-size: 1.0625rem;
	font-weight: 600;
	cursor: pointer;
	transition: filter 120ms ease;
}

.qelc-root .qelc-next:hover {
	filter: brightness(0.92);
}

.qelc-root .qelc-back {
	flex: 0 0 auto;
	padding: 0.95rem 1.4rem;
	border: 1px solid var(--qelc-field);
	border-radius: 10px;
	background: #fff;
	color: var(--qelc-ink);
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}

.qelc-root .qelc-back:hover {
	border-color: var(--qelc-muted);
}

.qelc-root .qelc-next:focus-visible,
.qelc-root .qelc-back:focus-visible {
	outline: 2px solid var(--qelc-accent);
	outline-offset: 3px;
}

.qelc-root .qelc-actions button[hidden],
.qelc-root .qelc-back[hidden],
.qelc-root .qelc-next[hidden],
.qelc-root .qelc-submit[hidden] {
	display: none !important;
}

/* The heading takes focus on each step; don't draw a ring around text. */
.qelc-card__title[tabindex="-1"]:focus {
	outline: none;
}

/* Opening question -------------------------------------------------------- */

.qelc-step--intro {
	padding: 2rem 1.5rem;
}

.qelc-root .qelc-fieldset legend.qelc-question {
	margin-bottom: 0.35rem;
	font-size: 1.375rem;
}

.qelc-tiles--big .qelc-tile__body {
	padding: 1.75rem 1.25rem;
}

.qelc-tiles--big .qelc-tile__label {
	font-size: 1.0625rem;
}

.qelc-tile__icon {
	margin-bottom: 0.4rem;
	color: var(--qelc-muted);
	transition: color 120ms ease;
}

.qelc-tile input:checked + .qelc-tile__body .qelc-tile__icon {
	color: var(--qelc-accent);
}

@media (max-width: 480px) {
	.qelc-step--intro {
		padding: 1.5rem 1.1rem;
	}

	.qelc-root .qelc-back {
		padding-left: 1rem;
		padding-right: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.qelc-js .qelc-form--steps.is-wizard .qelc-step.is-current {
		animation: none;
	}
}

/* ------------------------------------------------------------------------
 * Brand, buttons and required statements
 * --------------------------------------------------------------------- */

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

/* The theme styles submit buttons site-wide, so these win explicitly and
   keep Submit identical to Continue. */
.qelc-root .qelc-actions button.qelc-submit,
.qelc-root .qelc-actions button.qelc-next {
	display: block;
	width: auto;
	flex: 1 1 auto;
	margin: 0;
	padding: 0.95rem 1.5rem !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: var(--qelc-accent) !important;
	background-image: none !important;
	color: #fff !important;
	font-family: inherit;
	font-size: 1.0625rem !important;
	font-weight: 600 !important;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	box-shadow: none !important;
	cursor: pointer;
}

.qelc-root .qelc-actions button.qelc-submit:hover,
.qelc-root .qelc-actions button.qelc-next:hover {
	filter: brightness(1.18);
	background: var(--qelc-accent) !important;
	color: #fff !important;
}

.qelc-root .qelc-actions button.qelc-back {
	background-image: none !important;
	box-shadow: none !important;
	text-transform: none;
	letter-spacing: normal;
}

.qelc-root .qelc-actions button.qelc-submit[disabled] {
	opacity: 0.65;
	cursor: default;
}

/* An error on a yes/no row drops onto its own line. */
.qelc-statement {
	flex-wrap: wrap;
}

.qelc-statement .qelc-error-text {
	flex: 1 0 100%;
	margin-top: 0.15rem;
}

.qelc-statement.qelc-invalid .qelc-statement__label {
	color: var(--qelc-danger);
}

.qelc-help--strong {
	margin-top: 1.25rem;
	margin-bottom: 0.25rem;
	color: var(--qelc-ink);
	font-size: 0.875rem;
	font-weight: 600;
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.qelc-root {
		--qelc-tint: #f1f5f9;
	}
}
