/* =========================================================================
 * HubSpot form (legacy v3 embed, `form.hs-form`) — design refresh styling.
 * Figma: Effectory-Website › node 4890:34612 ("form"); field border, shadow
 * and resting label follow node 108:11670 (labels-inside variant).
 *
 * Overrules both HubSpot's injected `css: true` styles and the old
 * `body .hubspot …` rules in css/base.css. Every selector is rooted at
 * `body form.hs-form` so it out-specifies both; `!important` is only used
 * where base.css itself uses it (submit hover) or HubSpot sets inline widths.
 *
 * Tweak vs. the design: labels of text inputs, textareas and selects sit
 * inside the field and float up (smaller) on focus / when filled. The
 * `.is-filled` / `.is-focused` state classes come from hubspot-form.js;
 * `:focus-within` and `:autofill` cover the same states without JS.
 * ====================================================================== */

body form.hs-form {
	--hsf-ink: var(--wp--preset--color--dark);
	--hsf-active: var(--wp--preset--color--dark); /* #2C3953 — focus / checked state */
	--hsf-muted: color-mix(in srgb, var(--wp--preset--color--dark) 60%, #fff);  /* #808898 */
	--hsf-line-strong: color-mix(in srgb, var(--wp--preset--color--dark) 40%, #fff); /* #AAB0BA */
	--hsf-line: color-mix(in srgb, var(--wp--preset--color--cloud) 60%, #fff);    /* Beige 60% #F6F3F0 */
	--hsf-error: var(--wp--preset--color--rose);
	--hsf-yellow: var(--wp--preset--color--secondary);
	--hsf-yellow-hover: #ECC02E; /* same hover tone as .is-style-effectory-filled */
	--hsf-shadow: 0 0 12px 0 rgba(44, 57, 83, 0.08);

	--hsf-field-h: 58px;
	--hsf-pad-x: 24px;
	--hsf-pad-top: 27px;   /* floated label sits at 7px, ~17px tall */
	--hsf-pad-bottom: 7px;
	--hsf-label-scale: 0.75;
	--hsf-ease: cubic-bezier(.2, .7, .2, 1);

	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 0;
	font-family: Poppins, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	color: var(--hsf-ink);
}

/* ---------- rows ---------- */
body form.hs-form fieldset {
	display: flex;
	gap: 8px;
	max-width: none !important;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

body form.hs-form fieldset:empty,
body form.hs-form fieldset:has(> .hs-form-field[style*="display: none"]:only-child) {
	display: none;
}

body form.hs-form fieldset > .hs-form-field,
body form.hs-form fieldset > div {
	flex: 1 1 0;
	min-width: 0;
	width: auto !important;
	float: none;
	padding: 0;
	margin: 0;
}

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

@media (max-width: 600px) {
	body form.hs-form fieldset.form-columns-2 {
		flex-direction: column;
		gap: 24px;
	}
}

/* ---------- field shell (input / select / textarea) ---------- */
body form.hs-form .hs-form-field {
	position: relative;
}

/* :where() keeps this at low specificity so the textarea/select/error rules below
   can refine it. The box properties are !important because HubSpot's
   `.hs-custom-style` rules target inputs with long :not() chains that would
   otherwise win (they reset the padding, so typed text lost its alignment
   with the label). */
body form.hs-form .hs-form-field .hs-input:where(:not([type="checkbox"], [type="radio"], [type="hidden"])) {
	display: block;
	width: 100% !important;
	max-width: none !important;
	height: var(--hsf-field-h) !important;
	margin: 0 !important;
	/* top padding leaves room for the floated label; left padding + 1px border
	   is where both the label and the error message start */
	padding: var(--hsf-pad-top) var(--hsf-pad-x) var(--hsf-pad-bottom) !important;
	box-sizing: border-box !important;
	font-family: Poppins, sans-serif !important;
	font-size: 16px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	color: var(--hsf-ink) !important;
	background-color: #fff !important;
	border: 1px solid var(--hsf-line) !important;
	border-radius: 50px !important;
	box-shadow: var(--hsf-shadow) !important;
	outline: none !important;
	caret-color: var(--hsf-active);
	accent-color: var(--hsf-active);
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.2s var(--hsf-ease), box-shadow 0.2s var(--hsf-ease);
}

body form.hs-form .hs-form-field .hs-input:where(:not([type="checkbox"], [type="radio"])):hover {
	border-color: var(--hsf-line-strong) !important;
}

body form.hs-form .hs-form-field .hs-input:where(:not([type="checkbox"], [type="radio"])):focus {
	border-color: var(--hsf-active) !important;
	box-shadow: var(--hsf-shadow), 0 0 0 3px color-mix(in srgb, var(--hsf-active) 10%, transparent) !important;
	outline: none !important;
}

body form.hs-form .hs-form-field .hs-input.invalid.error,
body form.hs-form .hs-form-field .hs-input.error {
	border-color: var(--hsf-error) !important;
}

/* textarea */
body form.hs-form .hs-form-field textarea.hs-input {
	height: 175px !important;
	min-height: 120px;
	padding: 34px var(--hsf-pad-x) 20px !important;
	border-radius: 24px !important;
	resize: vertical;
}

/* select: chevron from the design, placeholder text hidden (the label is the placeholder) */
body form.hs-form .hs-form-field select.hs-input {
	padding-right: calc(var(--hsf-pad-x) + 28px) !important;
	background-image: url("icons/chevron-down.svg") !important;
	background-repeat: no-repeat !important;
	background-position: right var(--hsf-pad-x) center !important;
	background-size: 16px 14.2222px !important;
	cursor: pointer;
	text-overflow: ellipsis;
}

body form.hs-form .hs-form-field select.hs-input.is-placeholder {
	color: transparent !important;
}

body form.hs-form .hs-form-field select.hs-input option {
	color: var(--hsf-ink);
}

/* ---------- floating label ---------- */
body form.hs-form .hs-form-field > label {
	position: absolute;
	top: 0;
	left: calc(var(--hsf-pad-x) + 1px); /* + border */
	z-index: 1;
	display: block;
	max-width: calc(100% - (var(--hsf-pad-x) * 2) - 2px);
	margin: 0;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	/* !important: HubSpot's injected CSS and base.css both style form labels */
	font-family: Poppins, sans-serif !important;
	font-size: 16px !important;
	font-weight: 500;
	line-height: 1.4;
	color: var(--hsf-muted) !important;
	pointer-events: none;
	transform-origin: left top;
	/* resting: vertically centred in the 54px field */
	transform: translateY(calc((var(--hsf-field-h) - 1.4em) / 2));
	transition: transform 0.2s var(--hsf-ease), color 0.2s var(--hsf-ease), max-width 0.2s var(--hsf-ease);
}

/* reset base.css `body .hubspot .hs-form-field label span` */
body form.hs-form .hs-form-field > label span {
	font: inherit;
	font-family: inherit !important;
	font-size: inherit !important;
	color: inherit !important;
	padding: 0;
}

body form.hs-form .hs-form-field > label .hs-form-required {
	margin-left: 1px;
	color: inherit;
}

/* select: keep clear of the chevron */
body form.hs-form .hs-fieldtype-select > label {
	max-width: calc(100% - (var(--hsf-pad-x) * 2) - 30px);
}

/* textarea: resting on the first text line */
body form.hs-form .hs-fieldtype-textarea > label {
	transform: translateY(24px);
}

/* floated: small, inside the top of the field.
   The no-JS fallbacks (:has / :autofill) get their own rules so a browser
   that doesn't support one of them doesn't drop the whole selector list. */
body form.hs-form .hs-form-field.is-focused > label,
body form.hs-form .hs-form-field.is-filled > label,
body form.hs-form .hs-form-field:focus-within > label {
	transform: translateY(7px) scale(var(--hsf-label-scale));
	/* scaled down, so it may use proportionally more room */
	max-width: calc((100% - (var(--hsf-pad-x) * 2) - 2px) / var(--hsf-label-scale));
}

body form.hs-form .hs-form-field:has(select.hs-input:not(.is-placeholder)) > label {
	transform: translateY(7px) scale(var(--hsf-label-scale));
}

body form.hs-form .hs-form-field:has(.hs-input:autofill) > label {
	transform: translateY(7px) scale(var(--hsf-label-scale));
}

body form.hs-form .hs-form-field:has(.hs-input:-webkit-autofill) > label {
	transform: translateY(7px) scale(var(--hsf-label-scale));
}

body form.hs-form .hs-fieldtype-textarea.is-focused > label,
body form.hs-form .hs-fieldtype-textarea.is-filled > label,
body form.hs-form .hs-fieldtype-textarea:focus-within > label {
	transform: translateY(12px) scale(var(--hsf-label-scale));
}

body form.hs-form .hs-form-field.is-focused > label,
body form.hs-form .hs-form-field:focus-within > label {
	color: var(--hsf-active) !important;
}

body form.hs-form .hs-form-field:has(.hs-input.error) > label {
	color: var(--hsf-error) !important;
}

/* field description HubSpot may render between label and input */
body form.hs-form .hs-form-field > legend.hs-field-desc {
	margin: 6px 0 0 var(--hsf-pad-x);
	font-size: 14px;
	color: var(--hsf-muted) !important;
	opacity: 1;
}

/* ---------- errors ---------- */
body form.hs-form .hs-error-msgs {
	/* aligned with the label and the typed text: padding + 1px field border */
	margin: 8px 0 0 !important;
	padding: 0 0 0 calc(var(--hsf-pad-x) + 1px) !important;
	background: none !important;
	border-radius: 0;
	list-style: none;
}

body form.hs-form .hs-error-msgs li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

body form.hs-form .hs-error-msgs li label,
body form.hs-form .hs-error-msgs .hs-error-msg {
	position: static;
	display: block;
	transform: none;
	margin: 0 !important;
	padding: 0 !important;
	font-family: Poppins, sans-serif !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	color: var(--hsf-error) !important;
}

body form.hs-form .hs_error_rollup .hs-error-msgs {
	padding: 0 !important;
}

/* ---------- consent block ---------- */
body form.hs-form .legal-consent-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

body form.hs-form .legal-consent-container .hs-form-field {
	position: static;
	padding: 0;
}

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

body form.hs-form .inputs-list li {
	margin: 0;
	list-style: none;
}

body form.hs-form .hs-form-booleancheckbox-display,
body form.hs-form .hs-form-checkbox-display,
body form.hs-form .hs-form-radio-display {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	cursor: pointer;
}

body form.hs-form .hs-form-booleancheckbox-display > span,
body form.hs-form .hs-form-checkbox-display > span,
body form.hs-form .hs-form-radio-display > span {
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--hsf-ink);
}

body form.hs-form .hs-form-booleancheckbox-display > span p,
body form.hs-form .hs-form-checkbox-display > span p {
	display: inline;
	margin: 0;
	font: inherit;
	color: inherit;
}

body form.hs-form .hs-form-field .hs-form-booleancheckbox-display span.hs-form-required {
	padding: 0;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

/* checkbox: 18px, 1px dark-blue-40% border, 2px radius */
body form.hs-form input[type="checkbox"].hs-input {
	-webkit-appearance: none;
	appearance: none;
	display: grid;
	place-content: center;
	flex: 0 0 auto;
	width: 18px !important;
	height: 18px !important;
	/* centre the box on the first 22.4px text line */
	margin: 2px 0 0;
	padding: 0;
	background-color: #fff;
	border: 1px solid var(--hsf-line-strong);
	border-radius: 2px;
	transform: none;
	cursor: pointer;
	transition: background-color 0.15s var(--hsf-ease), border-color 0.15s var(--hsf-ease);
}

body form.hs-form input[type="checkbox"].hs-input::before {
	content: "";
	width: 10px;
	height: 10px;
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
	background-color: #fff;
	box-shadow: none;
	transform: scale(0);
	transform-origin: center;
	transition: transform 0.12s ease-in-out;
}

body form.hs-form input[type="checkbox"].hs-input:checked {
	background-color: var(--hsf-active);
	border-color: var(--hsf-active);
}

body form.hs-form input[type="checkbox"].hs-input:checked::before {
	transform: scale(1);
}

body form.hs-form input[type="checkbox"].hs-input:focus-visible {
	outline: 2px solid var(--hsf-active);
	outline-offset: 2px;
}

body form.hs-form input[type="checkbox"].hs-input.error {
	border-color: var(--hsf-error);
}

/* privacy / rich text */
body form.hs-form .hs-richtext,
body form.hs-form .hs-richtext p {
	margin: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--hsf-ink);
}

body form.hs-form .hs-richtext a {
	color: var(--hsf-ink) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

body form.hs-form .hs-richtext a:hover {
	text-decoration-thickness: 2px;
}

/* ---------- submit (CTA level 1, same look as .is-style-effectory-filled) ---------- */
body form.hs-form .hs_submit {
	margin-top: 8px; /* 24px row gap + 8px = the design's 32px */
}

body form.hs-form .hs_submit .actions {
	display: flex;
	justify-content: center;
	margin: 0;
	padding: 0;
}

body form.hs-form .hs_submit .hs-button,
body form.hs-form .hs_submit .hs-button:hover,
body form.hs-form .hs_submit .hs-button:focus,
body form.hs-form .hs_submit .hs-button:active {
	float: none;
	display: inline-block;
	min-height: 64px;
	height: auto;
	margin: 0;
	/* right padding makes room for the arrow */
	padding: 16px calc(24px + 24px + 12px) 16px 24px;
	font-family: Poppins, sans-serif !important;
	font-size: clamp(0.95rem, 1.15vw, 1.25rem) !important;
	font-weight: 700;
	line-height: 1.4 !important;
	color: var(--hsf-ink) !important;
	text-transform: capitalize;
	background-color: var(--hsf-yellow) !important;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='20' viewBox='0 0 24 20' fill='none'><path d='M23.2547 8.6016L15.4042 0.60804C15.2275 0.418927 15.0155 0.267722 14.7805 0.163325C14.5455 0.0589278 14.2924 0.00344925 14.0361 0.000155225C13.7798 -0.0031388 13.5254 0.0458183 13.2879 0.144144C13.0504 0.24247 12.8347 0.388178 12.6534 0.57269C12.472 0.757201 12.3288 0.976788 12.232 1.21852C12.1353 1.46026 12.0871 1.71925 12.0901 1.98026C12.0932 2.24127 12.1475 2.49902 12.2498 2.73834C12.3522 2.97766 12.5006 3.1937 12.6862 3.37376L17.3267 8.09147L1.89324 8.09147C1.38851 8.09925 0.907026 8.30887 0.552792 8.67506C0.198558 9.04125 0 9.53462 0 10.0486C0 10.5626 0.198558 11.056 0.552792 11.4222C0.907026 11.7884 1.3885 11.998 1.89324 12.0058L17.2839 12.0058L12.6862 16.6942C12.3405 17.0642 12.1506 17.5571 12.1569 18.0678C12.1632 18.5784 12.3653 19.0663 12.7201 19.4273C13.0749 19.7883 13.5542 19.9938 14.0557 19.9999C14.5572 20.006 15.0412 19.8122 15.4043 19.4599L23.2547 11.4661C23.4338 11.2848 23.5757 11.0692 23.6723 10.8316C23.7689 10.5941 23.8182 10.3394 23.8173 10.0823C23.8182 10.0662 23.8182 10.05 23.8173 10.0339C23.8182 10.0178 23.8182 10.0017 23.8173 9.98558C23.8174 9.4666 23.615 8.96885 23.2547 8.6018Z' fill='%232C3953'/></svg>");
	background-repeat: no-repeat;
	background-position: right 24px center;
	background-size: 24px 20px;
	border: 0;
	border-radius: 100px;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: background-color 0.3s var(--hsf-ease), background-position 0.35s var(--hsf-ease), transform 0.3s var(--hsf-ease);
}

body form.hs-form .hs_submit .hs-button:hover {
	background-color: var(--hsf-yellow-hover) !important;
	background-position: right 18px center;
	transform: translateY(-1px);
}

body form.hs-form .hs_submit .hs-button:active {
	transform: translateY(0);
}

body form.hs-form .hs_submit .hs-button:focus-visible {
	outline: 2px solid var(--hsf-active);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	body form.hs-form .hs-form-field > label,
	body form.hs-form .hs-input,
	body form.hs-form .hs_submit .hs-button {
		transition: none !important;
	}

	body form.hs-form .hs_submit .hs-button:hover {
		transform: none;
		background-position: right 24px center;
	}
}
