/**
 * KickStart Lead Forms — sidebar widget + popup
 *
 * Palette matches Phase 1 CTA (brand green, post 2026-05-27 recolor):
 *   primary       #1d6f42  (brand green)
 *   primary-hover #175837  (12% darker)
 *   surface       #f5faf6  (very light green tint)
 *   text          #1f2d3d
 *   accent        #F5A623  (orange focus ring — same as Phase 1)
 */

/* =================================================================
 * No card-in-card: when the lead form sits in an Elementor sidebar
 * column that has its OWN card (white bg + border + radius + shadow,
 * e.g. the cloned condition-page sidebar), strip that outer card so
 * only the form's own green card shows. Targets just the column whose
 * direct-child widget contains the form (not the row/inner wrappers).
 * ================================================================= */

.e-con:has(> .elementor-widget .kst-lead-widget),
.elementor-element:has(> .elementor-widget .kst-lead-widget) {
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	padding: 0 !important;
}

/* =================================================================
 * Tighten + normalize form spacing. The theme forces ~28px line-height
 * on the form's <p>/text, creating loose, random-looking gaps. Override
 * to consistent, compact spacing. Applies to sidebar + popup forms.
 * ================================================================= */

.kst-lead-widget p,
.kst-lead-widget small,
.kst-lead-widget label,
.kst-lead-popup p,
.kst-lead-popup small,
.kst-lead-popup label {
	line-height: 1.45 !important;
}

.kst-lead-widget__hed {
	margin: 0 0 0.3em 0 !important;
	line-height: 1.25 !important;
}
.kst-lead-widget__body {
	margin: 0 0 0.85em 0 !important;
}
.kst-lead-widget__privacy {
	margin: 0.7em 0 0 0 !important;
}
.kst-lead-widget .wpcf7-form p,
.kst-lead-popup .wpcf7-form p {
	margin: 0 0 0.65em 0 !important;
}
.kst-lead-widget .wpcf7-form label,
.kst-lead-popup .wpcf7-form label {
	margin: 0 0 0.3em 0 !important;
}
.kst-lead-widget .wpcf7-form .wpcf7-submit,
.kst-lead-popup .wpcf7-form .wpcf7-submit {
	margin-top: 0.25em !important;
}

/* =================================================================
 * Sidebar widget (Tier A + Tier B, desktop only)
 * ================================================================= */

.kst-lead-widget {
	background: #f5faf6;
	border: none !important; /* no accent bar; !important beats the theme's blog-sidebar border */
	border-radius: 8px;
	padding: 1.25em 1.25em 1em;
	margin: 1.25em 0 0 0;
	box-shadow: none; /* flat — no drop-shadow edge */
	color: #1f2d3d;
	box-sizing: border-box;
	/* Sticky behavior — JS may flip to static via .kst-lead-widget--tall.
	 * top is small (no sticky site header to clear). */
	position: sticky;
	top: 20px;
	align-self: start;
}

.kst-lead-widget.kst-lead-widget--tall {
	position: static;
}

/* On blog posts the form sits inside the theme's .sidebar-widget, whose white
 * background overrides the tint above. Restore the green tint, and give the form
 * the same card border + soft shadow as the list card above it so they match. */
.blog-sidebar .kst-lead-widget {
	background: #f5faf6 !important;
	border: 1px solid #e2e2e2 !important;
	box-shadow: 0 0 16px 0 rgba(205, 222, 236, 0.5);
}

.kst-lead-widget__hed {
	margin: 0 0 0.4em 0;
	font-size: 1.1em;
	font-weight: 700;
	color: #1d6f42;
	line-height: 1.3;
}

.kst-lead-widget__body {
	margin: 0 0 1em 0;
	font-size: 0.95em;
	line-height: 1.55;
	color: #1f2d3d;
}

.kst-lead-widget__privacy {
	margin: 0.75em 0 0 0;
	font-size: 0.8em;
	color: #6a7585;
	line-height: 1.4;
}

/* Form-element overrides for the sidebar (compact) */
.kst-lead-widget .wpcf7-form p,
.kst-lead-widget .wpcf7-form label {
	margin: 0 0 0.6em 0;
	font-size: 0.9em;
	line-height: 1.4;
	display: block;
}

.kst-lead-widget .wpcf7-form input[type="text"],
.kst-lead-widget .wpcf7-form input[type="email"],
.kst-lead-widget .wpcf7-form input[type="tel"],
.kst-lead-widget .wpcf7-form textarea {
	width: 100%;
	padding: 0.55em 0.7em;
	border: 1px solid #c8d2dd;
	border-radius: 4px;
	font-size: 0.95em;
	font-family: inherit;
	box-sizing: border-box;
	background: #ffffff;
	color: #1f2d3d;
}

.kst-lead-widget .wpcf7-form input:focus,
.kst-lead-widget .wpcf7-form textarea:focus {
	outline: 2px solid #F5A623;
	outline-offset: 1px;
	border-color: #1d6f42;
}

.kst-lead-widget .wpcf7-form textarea {
	min-height: 4em;
	max-height: 8em;
	resize: vertical;
}

.kst-lead-widget .wpcf7-form input[type="submit"],
.kst-lead-widget .wpcf7-form .wpcf7-submit {
	width: 100%;
	background: #1d6f42;
	color: #ffffff !important;
	border: 2px solid transparent;
	padding: 0.65em 1em;
	border-radius: 4px;
	font-size: 0.95em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.kst-lead-widget .wpcf7-form input[type="submit"]:hover,
.kst-lead-widget .wpcf7-form .wpcf7-submit:hover {
	background: #175837;
	transform: translateY(-1px);
}

.kst-lead-widget .wpcf7-form input[type="submit"]:focus-visible,
.kst-lead-widget .wpcf7-form .wpcf7-submit:focus-visible {
	outline: 3px solid #F5A623;
	outline-offset: 2px;
}

/* Mobile: sidebar widget hidden. Theme moves sidebar below content; sticky
 * form would push the footer down. Phase 1 mobile bar already covers mobile. */
@media (max-width: 768px) {
	.kst-lead-widget {
		display: none !important;
	}
}

/* =================================================================
 * Popup (Tier A only)
 * ================================================================= */

.kst-lead-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1em;
	box-sizing: border-box;
}

.kst-lead-popup.kst-lead-popup--visible {
	display: flex;
}

.kst-lead-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
}

.kst-lead-popup__dialog {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 10px;
	border-top: 5px solid #1d6f42;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	padding: 1.75em 1.5em 1.5em;
	box-sizing: border-box;
	font-family: inherit;
	color: #1f2d3d;
	animation: kst-lead-popup-in 0.2s ease-out;
}

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

.kst-lead-popup__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: #4a5568;
	font-size: 1.6em;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px;
	padding: 0;
}

.kst-lead-popup__close:hover {
	background: #f1f5f9;
	color: #1d6f42;
}

.kst-lead-popup__close:focus-visible {
	outline: 3px solid #F5A623;
	outline-offset: 2px;
}

.kst-lead-popup__hed {
	margin: 0 0 0.5em 0;
	font-size: 1.3em;
	font-weight: 700;
	color: #1d6f42;
	line-height: 1.25;
}

.kst-lead-popup__body {
	margin: 0 0 1.25em 0;
	font-size: 1em;
	line-height: 1.55;
	color: #1f2d3d;
}

.kst-lead-popup__privacy {
	margin: 1em 0 0 0;
	font-size: 0.8em;
	color: #6a7585;
	line-height: 1.4;
}

.kst-lead-popup .wpcf7-form p,
.kst-lead-popup .wpcf7-form label {
	margin: 0 0 0.7em 0;
	font-size: 0.95em;
	line-height: 1.45;
	display: block;
}

.kst-lead-popup .wpcf7-form input[type="text"],
.kst-lead-popup .wpcf7-form input[type="email"],
.kst-lead-popup .wpcf7-form input[type="tel"],
.kst-lead-popup .wpcf7-form textarea {
	width: 100%;
	padding: 0.65em 0.8em;
	border: 1px solid #c8d2dd;
	border-radius: 5px;
	font-size: 1em;
	font-family: inherit;
	box-sizing: border-box;
	background: #ffffff;
	color: #1f2d3d;
}

.kst-lead-popup .wpcf7-form input:focus,
.kst-lead-popup .wpcf7-form textarea:focus {
	outline: 2px solid #F5A623;
	outline-offset: 1px;
	border-color: #1d6f42;
}

.kst-lead-popup .wpcf7-form textarea {
	min-height: 5em;
	max-height: 10em;
	resize: vertical;
}

.kst-lead-popup .wpcf7-form input[type="submit"],
.kst-lead-popup .wpcf7-form .wpcf7-submit {
	width: 100%;
	background: #1d6f42;
	color: #ffffff !important;
	border: 2px solid transparent;
	padding: 0.8em 1.2em;
	border-radius: 5px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
	margin-top: 0.25em;
}

.kst-lead-popup .wpcf7-form input[type="submit"]:hover,
.kst-lead-popup .wpcf7-form .wpcf7-submit:hover {
	background: #175837;
	transform: translateY(-1px);
}

.kst-lead-popup .wpcf7-form input[type="submit"]:focus-visible,
.kst-lead-popup .wpcf7-form .wpcf7-submit:focus-visible {
	outline: 3px solid #F5A623;
	outline-offset: 2px;
}

/* Mobile popup: full-width, full-height, no rounded corners on top */
@media (max-width: 480px) {
	.kst-lead-popup {
		padding: 0;
	}
	.kst-lead-popup__dialog {
		max-width: none;
		max-height: 100vh;
		min-height: 100vh;
		border-radius: 0;
		border-top: none;
		border-left: 5px solid #1d6f42;
		padding: 2em 1.25em 1.5em;
	}
}

/* =================================================================
 * Contextual related-services list ([kst_related_services])
 * Replaces the old generic 25-link sidebar dump.
 * ================================================================= */

.kst-related {
	margin: 0 0 1.5em 0;
	font-family: inherit;
}

.kst-related__hed {
	margin: 0 0 0.5em 0;
	font-size: 1.05em;
	font-weight: 700;
	color: #1d6f42;
	line-height: 1.3;
}

.kst-related__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.kst-related__item {
	margin: 0;
	border-bottom: 1px solid #e6ece8;
}

.kst-related__item:last-child {
	border-bottom: none;
}

.kst-related__item a {
	display: block;
	padding: 0.6em 0;
	color: #1f2d3d;
	text-decoration: none;
	font-size: 0.95em;
	line-height: 1.35;
	transition: color 0.15s ease;
}

.kst-related__item a:hover {
	color: #1d6f42;
}

.kst-related__all {
	display: inline-block;
	margin-top: 0.85em;
	font-size: 0.9em;
	font-weight: 600;
	color: #1d6f42;
	text-decoration: none;
}

.kst-related__all:hover {
	text-decoration: underline;
}

/* =================================================================
 * Service hub page — card grid ([kst_service_cards]) + hub bits
 * ================================================================= */

.kst-hub-intro {
	max-width: 820px;
	margin: 0 auto 1.75em;
	font-size: 1.05em;
	line-height: 1.65;
	color: #3a4250;
	text-align: center;
}

.kst-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 18px;
	margin: 1.5em 0 2.5em;
}

.kst-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid #e2e8e4;
	border-top: 4px solid #1d6f42;
	border-radius: 10px;
	padding: 1.3em 1.3em 1.15em;
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

/* Theme underlines all <a> text; the card is a link, so kill it on card content. */
.kst-card,
.kst-card:hover,
.kst-card .kst-card__title,
.kst-card .kst-card__desc,
.kst-card .kst-card__more {
	text-decoration: none !important;
}

.kst-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 26px rgba(29, 111, 66, 0.13);
}

.kst-card__title {
	font-weight: 700;
	color: #1d6f42;
	font-size: 1.08em;
	line-height: 1.3;
	margin-bottom: 0.45em;
}

.kst-card__desc {
	color: #4a5568;
	font-size: 0.92em;
	line-height: 1.5;
	flex: 1 1 auto;
}

.kst-card__more {
	margin-top: 0.95em;
	color: #1d6f42;
	font-weight: 600;
	font-size: 0.9em;
}

/* Hub CTA band wrapping the lead form (neutral, so the green form card pops) */
.kst-hub-cta {
	background: #f5f7f9;
	border-radius: 12px;
	padding: 2em 1.5em 2.25em;
	margin: 1.5em 0 0;
}

.kst-hub-cta__hed {
	text-align: center;
	margin: 0 0 0.3em;
	font-size: 1.4em;
	font-weight: 700;
	color: #1d6f42;
}

.kst-hub-cta__sub {
	text-align: center;
	margin: 0 auto 1.25em;
	max-width: 560px;
	color: #3a4250;
	line-height: 1.55;
}

.kst-hub-cta .kst-lead-widget {
	max-width: 560px;
	margin: 0 auto;
	position: static; /* not sticky on the hub CTA */
}

/* =================================================================
 * Placeholder fix — the theme styles textarea::placeholder at 18px
 * (and input at 14px) in Montserrat, overriding the field's own size,
 * so the textarea hint rendered huge/loud. Force placeholders to match
 * the field. Applies to every lead form (sidebar + popup).
 * ================================================================= */

.kst-lead-widget .wpcf7-form input::placeholder,
.kst-lead-widget .wpcf7-form textarea::placeholder,
.kst-lead-popup .wpcf7-form input::placeholder,
.kst-lead-popup .wpcf7-form textarea::placeholder {
	font-size: inherit !important;
	font-family: inherit !important;
	color: #8a93a0 !important;
	opacity: 1 !important;
	font-weight: 400 !important;
}

.kst-lead-widget .wpcf7-form input::-webkit-input-placeholder,
.kst-lead-widget .wpcf7-form textarea::-webkit-input-placeholder,
.kst-lead-popup .wpcf7-form input::-webkit-input-placeholder,
.kst-lead-popup .wpcf7-form textarea::-webkit-input-placeholder {
	font-size: inherit !important;
	font-family: inherit !important;
	color: #8a93a0 !important;
	opacity: 1 !important;
	font-weight: 400 !important;
}

/* =================================================================
 * Hub page 2-column layout: cards (left) + sticky form (right),
 * matching the rest of the site.
 * ================================================================= */

.kst-hub-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 36px;
	align-items: start;
	margin: 0 0 1em;
}

.kst-hub-layout .kst-hub-intro {
	text-align: left;
	max-width: none;
	margin: 0 0 1.25em;
}

.kst-hub-aside {
	position: sticky;
	top: 20px;
	align-self: start;
}

.kst-hub-aside .kst-lead-widget {
	position: static;
	margin-top: 0;
}

.kst-hub-faq {
	margin-top: 2.25em;
}
.kst-hub-faq > h2 {
	font-size: 1.45em;
	font-weight: 700;
	color: #1d6f42;
	margin: 0 0 0.6em;
}
.kst-hub-faq h3 {
	font-size: 1.05em;
	font-weight: 700;
	color: #1f2d3d;
	margin: 1.15em 0 0.3em;
}
.kst-hub-faq p {
	margin: 0 0 0.7em;
	line-height: 1.6;
	color: #3a4250;
}

@media (max-width: 980px) {
	.kst-hub-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}
	.kst-hub-aside {
		position: static;
	}
}
