/*
 * Overrides for HubSpot's raw-HTML form markup (works only with "Set as raw
 * HTML form" turned on per-form in HubSpot — otherwise forms render inside
 * an iframe and none of this can reach them at all). Matches the same look
 * as .cusal-lead-form (the pre-HubSpot placeholder markup this replaced).
 *
 * fieldset { max-width: ... !important } is a known, necessary HubSpot
 * quirk: their JS sets an inline max-width style on every <fieldset> at
 * runtime. An external !important rule is the only thing that beats a
 * plain (non-important) inline style, so this isn't optional.
 */

.cusal-hubspot-form .hs-form {
	font-family: 'Inter', sans-serif;
}

.cusal-hubspot-form fieldset {
	max-width: 100% !important;
	border: none;
	margin: 0 0 18px;
	padding: 0;
}

.cusal-hubspot-form .form-columns-2 {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.cusal-hubspot-form .form-columns-2 > .hs-form-field {
	flex: 1 1 200px;
	min-width: 0;
}

.cusal-hubspot-form .input {
	margin: 0 !important; /* HubSpot's default .input wrapper adds its own margin */
}

.cusal-hubspot-form .hs-form-field {
	margin-bottom: 0;
}

.cusal-hubspot-form label:not(.hs-error-msg) {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 13px;
	color: #00263f;
	display: block;
	margin-bottom: 8px;
}

.cusal-hubspot-form label .hs-form-required {
	color: #ff1111;
}

.cusal-hubspot-form input[type="text"],
.cusal-hubspot-form input[type="email"],
.cusal-hubspot-form input[type="tel"],
.cusal-hubspot-form input[type="number"],
.cusal-hubspot-form select,
.cusal-hubspot-form textarea {
	font-family: 'Inter', sans-serif;
	font-size: 14.5px;
	color: #00263f;
	background: #ffffff;
	border: 1px solid #cfd8e2;
	border-radius: 8px;
	padding: 14px;
	width: 100%;
	box-sizing: border-box;
	outline: none;
	appearance: none;
}

.cusal-hubspot-form input:focus,
.cusal-hubspot-form select:focus,
.cusal-hubspot-form textarea:focus {
	border-color: #1a61c6;
}

.cusal-hubspot-form textarea {
	resize: vertical;
	min-height: 120px;
}

/* Checkbox/radio groups — "I'm interested in" (Get Involved), "Tier of interest" (Sponsor). */
.cusal-hubspot-form .hs-fieldtype-checkbox .inputs-list,
.cusal-hubspot-form .hs-fieldtype-radio .inputs-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cusal-hubspot-form .hs-fieldtype-checkbox li,
.cusal-hubspot-form .hs-fieldtype-radio li {
	margin: 0;
}

.cusal-hubspot-form .hs-fieldtype-checkbox label,
.cusal-hubspot-form .hs-fieldtype-radio label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 400;
	font-size: 14.5px;
	color: #404359;
	cursor: pointer;
}

.cusal-hubspot-form .hs-fieldtype-checkbox input,
.cusal-hubspot-form .hs-fieldtype-radio input {
	width: 18px;
	height: 18px;
	accent-color: #1a61c6;
	margin: 0;
	flex-shrink: 0;
}

/* Validation errors */
.cusal-hubspot-form .hs-error-msgs {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
}

.cusal-hubspot-form .hs-error-msg,
.cusal-hubspot-form label.hs-error-msg {
	color: #ff1111;
	font-size: 12.5px;
	font-weight: 500;
}

.cusal-hubspot-form input.error,
.cusal-hubspot-form select.error,
.cusal-hubspot-form textarea.error {
	border-color: #ff1111;
}

/* Submit button */
.cusal-hubspot-form .hs_submit {
	margin-top: 8px;
}

.cusal-hubspot-form .hs-button {
	background: #1a61c6;
	color: #ffffff;
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 15px;
	padding: 15px 30px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
}

.cusal-hubspot-form .hs-button:hover {
	background: #1a6fe8;
}

/* Post-submit success message replaces the whole form. */
.cusal-hubspot-form .submitted-message {
	font-family: 'Newsreader', Georgia, serif;
	font-size: 24px;
	color: #00263f;
	line-height: 1.3;
}

/*
 * The "newsletter" HubSpot form is embedded compactly (input + button side
 * by side, no visible label) via cusal_article_subscribe_band() and
 * cusal_event_newsletter() in inc/template-helpers.php — both wrap it in
 * .cusal-inline-hs-form. (The subscribe *card* on the Home lending-brief
 * teaser is a plain link to Get Involved, not a HubSpot form, matching the
 * original — no override needed there.)
 */
.cusal-inline-hs-form .hs-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: flex-start;
}
.cusal-inline-hs-form fieldset {
	margin: 0;
	flex: 1 1 auto;
}
.cusal-inline-hs-form .hs_submit {
	margin: 0;
}
.cusal-inline-hs-form label {
	display: none; /* the "Enter your email" placeholder covers the label's job in these compact inline widgets — the submit button stays visible */
}
.cusal-inline-hs-form input[type="email"] {
	width: 340px;
	max-width: 100%;
}
.cusal-inline-hs-form .hs-button {
	white-space: nowrap;
}
