/*
 * Pippin HubSpot forms: one look for every HubSpot form on the site (Contact widget, order, newsletter, careers,
 * conference and lead-magnet forms, popups). Loaded on every page. HubSpot draws its forms as plain HTML; the Kit's
 * custom CSS also styles `.hbspt-form` (some rules with !important), so these rules use !important where they have to
 * win over those. Fields added in HubSpot are styled with no site change: text, email, phone, number, dropdown, date,
 * message, checkbox and radio lists (chips), a single agree box, phone with country code, file upload, text blocks,
 * rows of 1–3 fields.
 * Outside the Contact widget the form sits on its own white card, so it reads on a photo, a dark band or in a popup.
 */
:is(.hbspt-form, .pt-contact) {
	--pt-c-text: var(--e-global-color-text, #22294e);
	--pt-c-muted: var(--e-global-color-e4427e8, #757575);
	--pt-c-border: var(--e-global-color-b0de001, #d9d9d9);
	--pt-c-accent: var(--e-global-color-accent, #d83040);
	--pt-c-accent-hover: var(--e-global-color-e7ce58e, #b8202f);
	--pt-c-surface: var(--e-global-color-5f0ace0, #fff);
	--pt-c-tint: var(--e-global-color-5ec0003, #f5fbfe);
	--pt-c-blue-100: var(--e-global-color-2c7a47e, #e4f6fe);
	--pt-c-blue-400: var(--e-global-color-b65e592, #76d0f4);
	--pt-c-focus: var(--e-global-color-primary, #37aada);
}

/* The card (forms outside the Contact widget, which has its own) */
.hbspt-form > form.hs-form,
.hbspt-form > .submitted-message {
	box-sizing: border-box;
	padding: clamp(20px, 3vw, 28px);
	border: 1px solid rgba(15, 19, 40, 0.06);
	border-radius: 16px;
	background: var(--pt-c-surface);
	box-shadow: 0 20px 48px rgba(15, 19, 40, 0.14);
	color: var(--pt-c-text);
}
.pt-contact .hbspt-form > form.hs-form {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}
.hbspt-form > .submitted-message {
	font-size: 1rem;
	line-height: 1.55;
	text-align: center;
}

/* Fields */
.pt-contact .hbspt-form,
:is(.hbspt-form, .pt-contact) .hs-form {
	color: var(--pt-c-text);
	font-family: inherit;
	text-align: left;
}
:is(.hbspt-form, .pt-contact) .hs-form fieldset {
	display: grid;
	gap: 20px;
	max-width: none !important;
	margin: 0 0 20px !important;
	padding: 0;
	border: 0;
}
:is(.hbspt-form, .pt-contact) .hs-form fieldset.form-columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	width: 100% !important;
}
:is(.hbspt-form, .pt-contact) .hs-form fieldset.form-columns-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	width: 100% !important;
}
:is(.hbspt-form, .pt-contact) .hs-form fieldset .hs-form-field {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
}
:is(.hbspt-form, .pt-contact) .hs-form fieldset .input {
	margin: 0 !important;
}
/* Forms whose fields sit straight in the form, with no fieldset rows (the Contact form is one): the same 20px
   between fields that the fieldset rows get. */
:is(.hbspt-form, .pt-contact) .hs-form > .hs-form-field {
	float: none !important;
	width: auto !important;
	margin: 0 0 20px !important;
}
:is(.hbspt-form, .pt-contact) .hs-form > .hs-form-field .input {
	margin: 0 !important;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-form-field > label {
	display: block;
	margin: 0 0 8px !important;
	color: var(--pt-c-text);
	font-size: 0.8125rem !important;
	font-weight: 600;
	line-height: 1.4;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-form-required {
	margin-left: 2px;
	color: var(--pt-c-accent);
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
	box-sizing: border-box;
	width: 100% !important;
	height: 48px !important;
	margin: 0 !important;
	padding: 0 14px !important;
	border: 1.5px solid var(--pt-c-border) !important;
	border-radius: 12px !important;
	outline: 0;
	background-color: var(--pt-c-surface) !important;
	box-shadow: none;
	color: var(--pt-c-text);
	font: inherit;
	font-size: 1rem;
	font-weight: 400;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
:is(.hbspt-form, .pt-contact) .hs-form textarea.hs-input {
	height: auto !important;
	min-height: 104px;
	padding: 12px 14px !important;
	line-height: 1.5;
	resize: vertical;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover {
	border-color: #b9c3cc !important;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus {
	border-color: var(--pt-c-focus) !important;
	background-color: var(--pt-c-surface) !important;
	box-shadow: 0 0 0 4px rgba(55, 170, 218, 0.15);
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-input.error:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
:is(.hbspt-form, .pt-contact) .hs-form .hs-input.invalid:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
	border-color: var(--pt-c-accent) !important;
	background-color: #fff8f8 !important;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-error-msgs {
	margin: 6px 0 0 !important;
	padding: 0 !important;
	list-style: none;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-error-msgs label,
:is(.hbspt-form, .pt-contact) .hs-form .hs-error-msg {
	margin: 0 !important;
	color: var(--pt-c-accent);
	font-size: 0.8125rem !important;
	font-weight: 500;
	line-height: 1.4;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs_error_rollup,
:is(.hbspt-form, .pt-contact) .hs-form .hs_recaptcha {
	display: none;
}

/* "How did you hear about us?" and other checkbox and radio lists: chips (a single "I agree" box stays a checkbox) */
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 2px 0 0 !important;
	padding: 0 !important;
	list-style: none;
}
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list li {
	margin: 0 !important;
	padding: 0;
}
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list label:not(.hs-form-booleancheckbox-display) {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	padding: 8px 14px;
	border: 1.5px solid var(--pt-c-border);
	border-radius: 999px;
	background: var(--pt-c-surface);
	color: var(--pt-c-text);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list label:not(.hs-form-booleancheckbox-display):hover {
	border-color: var(--pt-c-blue-400);
}
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list li:not(.hs-form-booleancheckbox) input.hs-input {
	position: absolute;
	width: 1px !important;
	height: 1px;
	margin: 0 !important;
	opacity: 0;
}
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list label:not(.hs-form-booleancheckbox-display)::before {
	content: "+";
	width: 0.75em;
	color: var(--pt-c-muted);
	font-weight: 600;
	text-align: center;
}
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list label:not(.hs-form-booleancheckbox-display):has(input:checked) {
	border-color: var(--pt-c-focus);
	background: var(--pt-c-blue-100);
}
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list label:not(.hs-form-booleancheckbox-display):has(input:checked)::before {
	content: "✓";
	color: var(--e-global-color-primary, #147298);
}
:is(.hbspt-form, .pt-contact) .hs-form .inputs-list label:not(.hs-form-booleancheckbox-display):has(input:focus-visible) {
	outline: 2px solid var(--pt-c-focus);
	outline-offset: 2px;
}
/* Text blocks added in HubSpot's form editor: headings read as small headings, paragraphs as notes. */
:is(.hbspt-form, .pt-contact) .hs-form .hs-richtext {
	color: var(--pt-c-muted);
	font-size: 0.875rem;
	line-height: 1.55;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-richtext :is(h1, h2, h3, h4, h5, h6) {
	margin: 8px 0 4px;
	color: var(--pt-c-text);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.4;
	text-transform: none;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-richtext p {
	margin: 0 0 8px;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-richtext a,
:is(.hbspt-form, .pt-contact) .hs-form .legal-consent-container a {
	color: var(--e-global-color-primary, #147298);
}
:is(.hbspt-form, .pt-contact) .hs-form .legal-consent-container {
	color: var(--pt-c-muted);
	font-size: 0.8125rem;
	line-height: 1.5;
}

/* A single "I agree…" checkbox (and HubSpot's consent boxes): a real checkbox with its text beside it. */
:is(.hbspt-form, .pt-contact) .hs-form .hs-form-booleancheckbox-display {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 !important;
	color: var(--pt-c-text);
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.5;
	cursor: pointer;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-form-booleancheckbox-display input.hs-input {
	flex: none;
	width: 18px !important;
	height: 18px;
	margin: 2px 0 0 !important;
	accent-color: var(--pt-c-focus);
	cursor: pointer;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-form-booleancheckbox-display > span {
	margin: 0 !important;
}

/* Dropdowns: the brand chevron in place of the browser's arrow. */
:is(.hbspt-form, .pt-contact) .hs-form select.hs-input {
	padding-right: 40px !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2322294e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-position: right 14px center;
	background-repeat: no-repeat;
	background-size: 16px;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

/* Phone with a country code: the country list and the number side by side. */
:is(.hbspt-form, .pt-contact) .hs-form .hs-fieldtype-intl-phone .input {
	display: flex;
	gap: 8px;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-fieldtype-intl-phone .input .hs-input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
	flex: 1 1 auto;
	width: auto !important;
	min-width: 0;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs-fieldtype-intl-phone .input select.hs-input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
	flex: 0 0 auto;
	max-width: 45%;
}

/* File upload: a dashed drop box with a pill button. */
:is(.hbspt-form, .pt-contact) .hs-form input[type="file"].hs-input {
	box-sizing: border-box;
	width: 100% !important;
	margin: 0 !important;
	padding: 12px !important;
	border: 1.5px dashed var(--pt-c-border) !important;
	border-radius: 12px !important;
	background-color: var(--pt-c-tint) !important;
	color: var(--pt-c-muted);
	font: inherit;
	font-size: 0.875rem;
	cursor: pointer;
}
:is(.hbspt-form, .pt-contact) .hs-form input[type="file"].hs-input:hover,
:is(.hbspt-form, .pt-contact) .hs-form input[type="file"].hs-input:focus {
	border-color: var(--pt-c-focus) !important;
}
:is(.hbspt-form, .pt-contact) .hs-form input[type="file"].hs-input::file-selector-button {
	margin-right: 12px;
	padding: 8px 16px;
	border: 1.5px solid var(--pt-c-border);
	border-radius: 999px;
	background: var(--pt-c-surface);
	color: var(--pt-c-text);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}

/* Button */
:is(.hbspt-form, .pt-contact) .hs-form .hs_submit {
	margin-top: 8px;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs_submit .actions {
	margin: 0;
	padding: 0;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs_submit input[type="submit"],
:is(.hbspt-form, .pt-contact) .hs-form .hs_submit .actions input[type="submit"] {
	width: 100%;
	height: 54px;
	margin: 0 !important;
	padding: 0 24px;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--pt-c-accent) !important;
	box-shadow: 0 10px 24px rgba(216, 48, 64, 0.22);
	color: #fff !important;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
:is(.hbspt-form, .pt-contact) .hs-form .hs_submit .actions input[type="submit"]:hover {
	background: var(--pt-c-accent-hover) !important;
	transform: translateY(-1px);
}
:is(.hbspt-form, .pt-contact) .hs-form .hs_submit .actions input[type="submit"]:focus-visible {
	outline: 2px solid var(--pt-c-focus);
	outline-offset: 3px;
}

/* Phone: one column of fields. */
@media (max-width: 767px) {
	:is(.hbspt-form, .pt-contact) .hs-form fieldset.form-columns-2,
	:is(.hbspt-form, .pt-contact) .hs-form fieldset.form-columns-3 {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	:is(.hbspt-form, .pt-contact) .hs-form .hs_submit .actions input[type="submit"] {
		transition: none;
	}
}
