/* ==========================================================================
   LGI Resource Library — HubSpot download form (gated template)
   --------------------------------------------------------------------------
   Gives HubSpot's form markup the design of the reference download form
   (gated-content-template.html → .lgi-resource-library-form).

   Used in two places:
   • Injected INTO HubSpot's same-origin form iframe (.hs-form-iframe, the
     default for v2 embeds) by lgi-resource-library-gated.js — so it cannot rely
     on the page's CSS variables; values are literal.
   • Enqueued on the gated page for HubSpot forms set to "raw HTML" (rendered
     in the page). There the theme's global `form …` rules use !important, so
     contested properties are !important here too.
   Everything is scoped to `.hs-form` (and the iframe's own html/body).
   ========================================================================== */

html.lgi-rl-hubspot-frame,
html.lgi-rl-hubspot-frame body {
	margin: 0;
	padding: 0;
	background: transparent;
	font-family: "Outfit", "Helvetica Neue", Arial, sans-serif;
	color: #333842;
	-webkit-font-smoothing: antialiased;
}

.hs-form {
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	gap: 16px !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	font-family: "Outfit", "Helvetica Neue", Arial, sans-serif !important;
}

.hs-form *,
.hs-form *::before,
.hs-form *::after {
	box-sizing: border-box;
}

/* Fieldsets (HubSpot adds a 500px max-width) */
.hs-form fieldset {
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

/* Hidden-field fieldsets (UTM, language…) have no visible control but would
   still take a flex gap each; same for HubSpot's trailing hidden input and
   0px iframe. */
.hs-form fieldset:not(:has(input:not([type="hidden"]), select, textarea)),
.hs-form > input[type="hidden"],
.hs-form > iframe {
	display: none !important;
}

.hs-form fieldset.form-columns-2 {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.hs-form fieldset.form-columns-2 .hs-form-field,
.hs-form fieldset.form-columns-1 .hs-form-field {
	width: 100% !important;
	float: none !important;
	padding: 0 !important;
}

.hs-form fieldset .input {
	margin: 0 !important;
}

.hs-form .hs-form-field {
	margin: 0 !important;
	padding: 0 !important;
}

/* Labels: the design uses placeholders only ("First name*"); HubSpot labels
   are kept visible when the form has no placeholders. Empty labels collapse. */
.hs-form .hs-form-field > label {
	display: block !important;
	margin: 0 0 6px !important;
	color: #333842 !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
}

.hs-form .hs-form-field > label:empty,
.hs-form .hs-form-field > label:has(> span:only-child:empty) {
	display: none !important;   /* placeholder-only fields: HubSpot prints <label><span></span></label> */
}

.hs-form .hs-form-required {
	margin-left: 2px;
	color: #c4320a;
}

.hs-form .hs-field-desc {
	margin: 0 0 6px !important;
	color: #58595b;
	font-size: 14px !important;
	line-height: 1.4 !important;
}

/* Fields: = .lgi-resource-library-form__input */
.hs-form .hs-input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	height: 52px !important;
	min-height: 52px !important;
	padding: 12px 14px !important;
	border: 1px solid #c3d2df !important;
	border-radius: 10px !important;
	background: #fff !important;
	color: #333842 !important;
	font-family: "Outfit", "Helvetica Neue", Arial, sans-serif !important;
	font-size: 16px !important;
	line-height: 1.25 !important;
	box-shadow: none !important;
	transition: border-color 200ms ease, box-shadow 200ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.hs-form select.hs-input {
	padding-right: 40px !important;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none' stroke='%23333842' stroke-width='1.5'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 16px center !important;
}

.hs-form textarea.hs-input {
	height: auto !important;
	min-height: 104px !important;
	resize: vertical;
}

.hs-form .hs-input::placeholder {
	color: #757575 !important;
	opacity: 1;
}

.hs-form .hs-input:focus {
	outline: none !important;
	border-color: #036eff !important;
	box-shadow: 0 0 0 3px rgb(3 110 255 / 0.15) !important;
}

.hs-form .hs-input.invalid,
.hs-form .hs-input.error {
	border-color: #c4320a !important;
}

/* Errors: = .lgi-resource-library-form__error */
.hs-form .hs-error-msgs {
	margin: 6px 0 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.hs-form .hs-error-msgs label,
.hs-form .hs-error-msg,
.hs-form .hs_error_rollup .hs-main-font-element {
	display: block !important;
	margin: 0 !important;
	color: #c4320a !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.3 !important;
}

/* Consent + legal: = __consent / __legal */
.hs-form .legal-consent-container,
.hs-form .legal-consent-container :where(p, span, div, label) {
	color: #58595b !important;
	font-size: 13.5px !important;
	line-height: 17px !important;
}

.hs-form .legal-consent-container p {
	display: block !important;
	margin: 0 0 8px !important;
}

.hs-form .legal-consent-container a {
	color: #036eff !important;
	text-decoration: none !important;
}

.hs-form .legal-consent-container a:hover {
	text-decoration: underline !important;
}

.hs-form .inputs-list {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.hs-form .hs-form-booleancheckbox-display,
.hs-form .hs-form-checkbox-display,
.hs-form .hs-form-radio-display {
	display: flex !important;
	align-items: flex-start;
	gap: 10px;
	margin: 0 !important;
	color: #58595b !important;
	font-size: 15px !important;
	line-height: 21.75px !important;
	cursor: pointer;
}

.hs-form .hs-form-booleancheckbox-display > span,
.hs-form .hs-form-checkbox-display > span {
	margin: 0 !important;
	color: inherit !important;
	font-size: inherit !important;
	line-height: inherit !important;
}

.hs-form input[type="checkbox"],
.hs-form input[type="radio"] {
	flex: none;
	width: 13px !important;
	height: 13px !important;
	margin: 4px 0 0 !important;
	accent-color: #036eff;
	cursor: pointer;
}

/* Submit: = "Download Now" (.lgi-resource-library-button--solid --block) */
.hs-form .hs_submit,
.hs-form .hs_submit .actions {
	margin: 0 !important;
	padding: 0 !important;
}

.hs-form .hs-button,
.hs-form input[type="submit"] {
	display: block !important;
	width: 100% !important;
	min-height: 50px !important;
	margin: 0 !important;
	padding: 12px 24px !important;
	border: 0 !important;
	border-radius: 50px !important;
	background: rgb(3 110 255 / 0.95) !important;
	color: #fff !important;
	font-family: "Outfit", "Helvetica Neue", Arial, sans-serif !important;
	font-size: 18px !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 200ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.hs-form .hs-button:hover,
.hs-form .hs-button:focus-visible,
.hs-form input[type="submit"]:hover {
	background: #0257c9 !important;
}

.hs-form .hs-button:focus-visible {
	outline: 2px solid #036eff !important;
	outline-offset: 3px;
}

/* HubSpot's own inline thank-you (shown briefly before the success panel) */
.submitted-message {
	color: #333842;
	font-family: "Outfit", "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

@media (max-width: 480px) {
	.hs-form fieldset.form-columns-2 {
		grid-template-columns: minmax(0, 1fr);
	}
}
