/* Central Huron Forms — front-end form */
.chf-form-wrap {
	--chf-accent: #0170B9;
	--chf-ink: #2b2b2b;
	--chf-muted: #6b7684;
	--chf-line: #dfe5ec;
	--chf-error: #c0392b;
	max-width: 760px;
	margin: 0 auto;
	font-family: inherit;
	color: var(--chf-ink);
}

/* Seamless by default so the form flows with the host page and its colours.
   (No white card, border or shadow — it inherits the page background.) */
.chf-form {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

/* Header */
.chf-form-header {
	display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
	padding-bottom: 18px; margin-bottom: 22px;
	border-bottom: 3px solid var(--chf-accent);
}
.chf-form-logo { height: 46px; width: auto; }
.chf-form-title { margin: 0; font-size: 24px; line-height: 1.25; color: var(--chf-ink); font-weight: 700; }
.chf-form-desc { margin-top: 8px; color: var(--chf-muted); font-size: 15px; line-height: 1.6; }
.chf-form-desc p { margin: 0 0 8px; }
.chf-form-desc p:last-child { margin-bottom: 0; }

/* Field grid */
.chf-fields { display: flex; flex-wrap: wrap; gap: 18px; }
.chf-field { flex: 1 1 100%; min-width: 0; }
.chf-field.chf-w-half { flex: 1 1 calc(50% - 9px); }
.chf-field.chf-w-third { flex: 1 1 calc(33.333% - 12px); }
.chf-field.chf-field-hidden { display: none !important; }

.chf-label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; color: var(--chf-ink); }
.chf-req { color: var(--chf-error); margin-left: 2px; }
.chf-help { display: block; font-size: 12.5px; color: var(--chf-muted); margin-top: 5px; }

/* Inputs */
.chf-input {
	width: 100%; padding: 11px 13px; font-size: 15px; color: var(--chf-ink);
	border: 1px solid #cfd8e2; border-radius: 9px; background: #fff;
	transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.chf-input::placeholder { color: #9aa4b2; }
.chf-input:focus {
	outline: none; border-color: var(--chf-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--chf-accent) 22%, transparent);
}
textarea.chf-input { resize: vertical; min-height: 120px; }
select.chf-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7684' d='M6 8 0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* Choices */
.chf-choices { display: flex; flex-direction: column; gap: 9px; }
.chf-choice { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; line-height: 1.4; }
.chf-choice input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--chf-accent); flex: none; }
.chf-consent { background: #f6f9fc; border: 1px solid var(--chf-line); border-radius: 9px; padding: 12px 14px; }

/* Number / calculation affixes */
.chf-calc-wrap { display: flex; align-items: stretch; }
.chf-affix {
	display: flex; align-items: center; padding: 0 12px; background: #f2f5f7;
	border: 1px solid #cfd8e2; color: var(--chf-muted); font-weight: 600;
}
.chf-affix:first-child { border-right: 0; border-radius: 9px 0 0 9px; }
.chf-affix:last-child { border-left: 0; border-radius: 0 9px 9px 0; }
.chf-calc-wrap .chf-input { border-radius: 0; }
.chf-calc-wrap .chf-affix:first-child + .chf-input { border-radius: 0; }
.chf-calc { background: #f8fafc; font-weight: 700; color: var(--chf-accent); }
.chf-calc-wrap .chf-input:only-child { border-radius: 9px; }

/* File */
.chf-file { padding: 9px 12px; background: #f8fafc; cursor: pointer; }
.chf-file::file-selector-button {
	margin-right: 12px; border: 0; background: var(--chf-accent); color: #fff;
	padding: 8px 14px; border-radius: 7px; cursor: pointer; font-weight: 600;
}

/* Layout blocks */
.chf-heading { margin: 6px 0 0; color: var(--chf-ink); line-height: 1.3; }
.chf-paragraph { color: var(--chf-muted); font-size: 15px; line-height: 1.6; }
.chf-paragraph p { margin: 0 0 8px; }
.chf-divider { border: 0; border-top: 1px solid var(--chf-line); margin: 4px 0; }

/* Errors */
.chf-field.has-error .chf-input,
.chf-field.has-error .chf-choices { border-color: var(--chf-error) !important; box-shadow: 0 0 0 3px rgba(192,57,43,.12); border-radius: 9px; }
.chf-field-error { display: block; color: var(--chf-error); font-size: 12.5px; margin-top: 5px; font-weight: 600; }
.chf-field-error:empty { display: none; }
.chf-alert { border-radius: 9px; padding: 12px 15px; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.chf-alert-error { background: #fdecea; border: 1px solid #f5c6cb; color: var(--chf-error); }

/* Actions */
.chf-actions { margin-top: 26px; }
.chf-submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	background: var(--chf-accent); color: #fff; border: 0; border-radius: 10px;
	padding: 13px 30px; font-size: 16px; font-weight: 700; cursor: pointer;
	transition: filter .15s, transform .05s; font-family: inherit;
}
.chf-submit:hover { filter: brightness(.92); }
.chf-submit:active { transform: translateY(1px); }
.chf-submit:disabled { opacity: .75; cursor: default; }
.chf-spinner { display: none; width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: chf-spin .7s linear infinite; }
.chf-submit.is-loading .chf-spinner { display: inline-block; }
@keyframes chf-spin { to { transform: rotate(360deg); } }

/* Honeypot — hidden from humans */
.chf-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Success */
.chf-success {
	background: #f2f5f7; border: 1px solid var(--chf-line);
	border-radius: 14px; padding: 40px 30px; text-align: center;
	box-shadow: inset 0 4px 0 #109347;
}
.chf-success-icon {
	width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%;
	background: #109347; color: #fff; font-size: 30px; line-height: 58px; font-weight: 700;
}
.chf-success-msg { font-size: 17px; color: var(--chf-ink); line-height: 1.6; }
.chf-success-msg p { margin: 0 0 8px; }

.chf-missing { padding: 20px; background: #fff8e5; border: 1px solid #f5e2a3; border-radius: 9px; color: #8a6d0b; }

/* ------------------------------------------------------------------ */
/* Host-page tidy-up (form pages only, via the .chf-page body class).  */
/* Central Huron's Elementor theme-builder template renders a large    */
/* page-title hero band + prev/next nav on every page. With no         */
/* featured image it shows as empty dark space above the form, so we    */
/* collapse that whole band and the prev/next nav on form pages only.   */
/* ------------------------------------------------------------------ */
.chf-page .elementor-widget-theme-post-title,
.chf-page .elementor-widget-post-navigation { display: none !important; }

/* Collapse the entire container that holds the page-title (new flex
   containers + legacy sections). :has() is supported in all current
   browsers; a JS fallback in forms.js covers anything older. */
.chf-page .e-con.e-parent:has(.elementor-widget-theme-post-title),
.chf-page .elementor-top-section:has(.elementor-widget-theme-post-title),
.chf-page .elementor-section:has(.elementor-widget-theme-post-title) { display: none !important; }

@media (max-width: 600px) {
	.chf-form { padding: 20px 18px 24px; }
	.chf-field.chf-w-half, .chf-field.chf-w-third { flex: 1 1 100%; }
	.chf-form-title { font-size: 20px; }
	.chf-submit { width: 100%; }
}
