/* Colors follow the surrounding text, so the form sits on light or dark.
   On wider screens the fields pair up; the consent and button span both. */
.lead-form {
	display: grid;
	gap: var(--s-xs);
	width: 100%;
	margin-top: var(--s-sm);
	text-align: left;

	@media (min-width: 768px) {
		grid-template-columns: 1fr 1fr;

		> :is(button, output, small, p, fieldset, label:has(> [type="checkbox"])) {
			grid-column: 1 / -1;
		}
	}

	> label {
		display: flex;
		flex-direction: column;
		gap: var(--s);
		font-family: var(--f-l);
		font-size: 0.8rem;
		font-weight: bold;
		letter-spacing: 1px;
		text-transform: uppercase;

		> input {
			padding: var(--s-xs);
			border: 1px solid currentColor;
			border-radius: var(--s-xs);
			font-family: var(--f-b);
			font-size: 1rem;
			font-weight: normal;
			letter-spacing: normal;
			text-transform: none;
			color: inherit;

			&:focus-visible {
				outline: 2px solid var(--c-blue-lt);
			}
		}
	}

	/* Checkboxes (the options and the SMS consent) sit beside their text. */
	label:has(> [type="checkbox"]) {
		display: flex;
		flex-direction: row;
		align-items: flex-start;
		gap: var(--s-xs);
		font-family: var(--f-b);
		font-size: 0.75rem;
		font-weight: normal;
		line-height: 1.4;
		letter-spacing: normal;
		text-transform: none;

		> input {
			flex-shrink: 0;
			padding: 0;
			border: 1px solid currentColor;
			border-radius: 3px;
			color: inherit;

			&:checked {
				background-color: var(--c-blue-lt);
			}
		}
	}

	/* The options: a heading like the field labels over a grid of boxes. */
	> fieldset {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
		gap: var(--s-xs);
		margin: 0;
		padding: 0;
		border: 0;

		> legend {
			margin-bottom: var(--s);
			padding: 0;
			font-family: var(--f-l);
			font-size: 0.8rem;
			font-weight: bold;
			letter-spacing: 1px;
			text-transform: uppercase;
		}

		> label:has(> input) {
			font-size: 0.9rem;
		}
	}

	> button {
		justify-self: center;
		margin-top: var(--s-xs);
	}

	/* The honeypot: off screen rather than display: none, which some bots skip. */
	> label:has(> [name="company"]) {
		position: absolute;
		left: -9999px;
	}

	/* Errors from the endpoint, and the thank-you that replaces the fields. */
	> output:not(:empty) {
		font-size: 0.85rem;
		text-align: center;
	}

	> small {
		font-size: 0.7rem;
		text-align: center;
		opacity: 0.75;

		> a {
			color: inherit;
		}
	}

	> p {
		font-size: 1.1rem;
		text-align: center;
	}
}

/* Google's floating badge would sit on the chat button; the form carries the
   notice Google requires in its place. */
.grecaptcha-badge {
	visibility: hidden;
}
