/*
 * HubSpot forms (inc/hubspot.php, assets/js/hubspot.js), dressed exactly like our own (form-section.css): HubSpot's
 * markup, our look. The box takes the place of our <form> and keeps its layout class, so HubSpot's fields sit in the
 * same two-column grid. Colours come from the component around it (--form-text and the rest).
 */
.le-hs {
	--hs-text: var(--form-text, currentColor);
	--hs-placeholder: var(--form-placeholder, var(--le-400));
	--hs-background: var(--form-background, transparent);
	--hs-hover: var(--form-hover, var(--le-100));
	--hs-muted: var(--form-muted, var(--le-600));
	--hs-error: var(--form-error, #e5483a);
	--hs-font-size: 0.6969rem;
	--hs-input-height: 1.4375rem;
	--hs-textarea-height: 5rem;

	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.125rem;
	align-items: start;
}

/* HubSpot's form steps aside, so its fields are the grid's items. */
.le-hs > form {
	display: contents;
}

.le-hs .hs-form-field {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/* Full width: long text, choices of several, files, consent, long labels, the button and messages. */
.le-hs .hs-form-field:is(.hs-fieldtype-textarea, .hs-fieldtype-file, .hs-fieldtype-booleancheckbox, .hs-richtext),
.le-hs .hs-form-field[data-le-wide],
.le-hs .hs-richtext,
.le-hs .hs_error_rollup,
.le-hs .hs-submit,
.le-hs .submitted-message,
.le-hs .le-hs__note {
	grid-column: 1 / -1;
}

/*
 * The spam check (reCAPTCHA) works unseen; its badge is hidden and its wrappers take no room in the grid. Google
 * allows that so long as the form says it's protected: hubspot.js adds that line (.le-hs__legal) above the button.
 */
.le-hs .hs-recaptcha,
.le-hs .hs-recaptcha > .input {
	display: contents;
}

.le-hs .grecaptcha-badge {
	position: absolute !important;
	visibility: hidden;
}

.le-hs__legal {
	grid-column: 1 / -1;
	margin: 0;
	font-family: var(--le-font-mono);
	font-size: 0.5625rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.03rem;
	color: var(--hs-placeholder);
	text-transform: uppercase;
}

.le-hs__legal a {
	color: inherit;
	text-decoration: underline;
}

/* Every piece of form text is the small mono capitals of the buttons. */
.le-hs .hs-input,
.le-hs .hs-form-field > label,
.le-hs .inputs-list label,
.le-hs .hs-error-msg,
.le-hs .hs-error-msgs label {
	font-family: var(--le-font-mono);
	font-size: var(--hs-font-size);
	font-weight: 500;
	line-height: 1.27;
	letter-spacing: 0.0348rem;
	color: var(--hs-text);
	text-transform: uppercase;
}

/* Text boxes and dropdowns carry their label inside (hubspot.js), so the one above is for screen readers only. */
.le-hs .hs-form-field:is(.hs-fieldtype-text, .hs-fieldtype-phonenumber, .hs-fieldtype-number, .hs-fieldtype-textarea, .hs-fieldtype-date, .hs-fieldtype-select) > label:not(.hs-error-msg) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Text boxes: a line along the top and left. */
.le-hs .hs-input:not([type="checkbox"], [type="radio"], [type="file"]) {
	display: block;
	width: 100%;
	height: var(--hs-input-height);
	margin: 0;
	padding: 0.25rem 0.5rem;
	border: 0;
	border-top: 1px solid var(--hs-text);
	border-left: 1px solid var(--hs-text);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	transition: border-color 0.2s;
}

.le-hs .hs-form-field textarea.hs-input {
	height: var(--hs-textarea-height);
	resize: vertical;
}

.le-hs .hs-input::placeholder {
	color: var(--hs-placeholder);
	opacity: 1;
}

.le-hs .hs-input:focus {
	outline: none;
	border-color: var(--le-blue);
}

.le-hs .hs-input.invalid.error:not(:focus) {
	border-color: var(--hs-error);
}

/* Dropdown: the label shows as its empty first choice, greyed like a placeholder, with a chevron at the right. */
.le-hs .hs-fieldtype-select > .input {
	position: relative;
}

.le-hs select.hs-input {
	padding-right: 1.75rem;
	appearance: none;
	cursor: pointer;
}

.le-hs select.hs-input:has(option[value=""]:checked) {
	color: var(--hs-placeholder);
}

/* The open list is drawn by the browser; keep it readable whatever the theme. */
.le-hs select.hs-input option {
	color: var(--le-black);
	background: var(--le-white);
}

.le-hs .hs-fieldtype-select > .input::after {
	content: "";
	position: absolute;
	top: calc(1px + 0.25rem);
	right: 0.5rem;
	width: 0.6692rem;
	height: 0.9375rem;
	background: var(--hs-text);
	mask: url("../images/select-chevron.svg") center / contain no-repeat;
	pointer-events: none;
}

/* Choices: a heading, then one option per line. */
.le-hs .hs-form-field:is(.hs-fieldtype-checkbox, .hs-fieldtype-radio) {
	padding-block: 0.25rem;
}

.le-hs .hs-form-field:is(.hs-fieldtype-checkbox, .hs-fieldtype-radio) > label {
	display: block;
	margin-bottom: 1.125rem;
}

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

.le-hs .inputs-list > li {
	margin: 0;
	padding: 0;
}

.le-hs .inputs-list > li + li {
	margin-top: 0.625rem;
}

.le-hs .inputs-list > li > label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
}

.le-hs .hs-fieldtype-booleancheckbox {
	padding-top: 1.5rem;
}

.le-hs .hs-fieldtype-booleancheckbox .inputs-list > li > label {
	align-items: flex-start;
}

.le-hs .inputs-list a {
	color: inherit;
	text-decoration: underline;
}

.le-hs .inputs-list em {
	font-style: normal;
}

.le-hs .hs-input:is([type="checkbox"], [type="radio"]) {
	flex: none;
	width: 1rem;
	height: 1rem;
	margin: 0;
	border: 1px solid var(--hs-text);
	border-radius: 0;
	background: transparent center / 100% no-repeat;
	appearance: none;
	cursor: pointer;
	transition: background-color 0.15s;
}

.le-hs .hs-input[type="radio"] {
	border-radius: 50%;
}

.le-hs .hs-input[type="checkbox"]:checked {
	background-color: var(--le-blue);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.74 8.43l3.2 3.05 7.32-6.95' fill='none' stroke='black' stroke-width='.82' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.le-hs .hs-input[type="radio"]:checked {
	background-color: var(--le-blue);
	box-shadow: inset 0 0 0 0.1875rem var(--hs-background);
}

.le-hs .hs-input:is([type="checkbox"], [type="radio"], [type="file"]):focus-visible {
	outline: 2px solid var(--le-blue);
	outline-offset: 2px;
}

/* File: the browser's picker, its button drawn like our Choose file button and the file's name beside it. */
.le-hs .hs-fieldtype-file > label {
	display: block;
	margin: 0 0 0.875rem;
}

.le-hs .hs-input[type="file"] {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
}

.le-hs .hs-input[type="file"]::file-selector-button {
	margin: 0 1.625rem 0 0;
	padding: 0.25rem 0.5rem;
	border: 0;
	border-top: 1px solid var(--hs-text);
	border-left: 1px solid var(--hs-text);
	border-radius: 0;
	font: inherit;
	letter-spacing: inherit;
	color: var(--hs-text);
	text-transform: uppercase;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.2s;
}

.le-hs .hs-input[type="file"]:hover::file-selector-button {
	background: var(--hs-hover);
}

/* Errors: a short line under the field, and the rollup above the button. */
.le-hs .hs-error-msgs {
	margin: 0.375rem 0 0;
	padding: 0;
	list-style: none;
}

.le-hs .hs-error-msgs label,
.le-hs .hs-error-msg {
	display: block;
	color: var(--hs-error);
	text-transform: none;
}

.le-hs .hs_error_rollup .hs-error-msgs {
	margin: 0;
}

/* The button: ours, with its arrow (hubspot.js); HubSpot's own stays hidden. */
.le-hs .hs-submit .actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	padding-top: 1.5rem;
}

.le-hs input.hs-button,
.le-hs .hs-field-desc:empty {
	display: none;
}

.le-hs .le-btn:disabled {
	opacity: 0.5;
	cursor: progress;
}

/* Thank you (HubSpot's message, once sent) and notes. */
.le-hs .submitted-message,
.le-hs .le-hs__note {
	margin: 0;
	color: var(--hs-muted);
}

.le-hs .submitted-message p {
	margin: 0;
}

.le-hs .submitted-message p + p {
	margin-top: 0.75rem;
}

.le-hs .submitted-message a {
	color: var(--hs-text);
}

/* Rich text HubSpot puts between fields, if any. */
.le-hs .hs-richtext {
	color: var(--hs-muted);
}

/* The date picker HubSpot opens under its date box. */
.le-hs .hs-dateinput {
	position: relative;
}

.le-hs .pika-single {
	position: absolute;
	z-index: 20;
	padding: 0.5rem;
	font-family: var(--le-font-mono);
	font-size: 0.6969rem;
	color: var(--le-black);
	background: var(--le-white);
	border: 1px solid var(--le-black);
}

.le-hs .pika-single.is-hidden {
	display: none;
}

.le-hs .pika-lendar {
	width: 15rem;
}

.le-hs .pika-title {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	margin-bottom: 0.5rem;
	text-transform: uppercase;
}

.le-hs .pika-label {
	position: relative;
	overflow: hidden;
}

.le-hs .pika-title select {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.le-hs .pika-prev,
.le-hs .pika-next {
	position: absolute;
	top: 0;
	width: 1.25rem;
	height: 1.25rem;
	padding: 0;
	border: 0;
	font-size: 0;
	color: transparent;
	background: none;
	cursor: pointer;
}

.le-hs .pika-prev {
	left: 0;
}

.le-hs .pika-next {
	right: 0;
}

.le-hs .pika-prev::before,
.le-hs .pika-next::before {
	content: "←";
	font-size: 0.8125rem;
	color: var(--le-black);
}

.le-hs .pika-next::before {
	content: "→";
}

.le-hs .pika-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.le-hs .pika-table th {
	padding-bottom: 0.25rem;
	font-weight: 500;
	color: var(--le-500);
}

.le-hs .pika-table abbr {
	text-decoration: none;
}

.le-hs .pika-button {
	display: block;
	width: 100%;
	padding: 0.3125rem 0;
	border: 0;
	font: inherit;
	color: inherit;
	text-align: center;
	background: none;
	cursor: pointer;
}

.le-hs .pika-button:hover,
.le-hs .is-selected .pika-button {
	background: var(--le-blue);
}

.le-hs .is-today .pika-button {
	text-decoration: underline;
}

.le-hs .is-disabled .pika-button,
.le-hs .is-outside-current-month .pika-button {
	color: var(--le-300);
}

.le-hs .pika-time-container {
	display: none;
}

/* Phones: one field per line. */
@media (max-width: 880px) {
	.le-hs {
		grid-template-columns: minmax(0, 1fr);
	}
}
