/*
 * The site's public forms (the waiting list and the contact form). Each sits in a white panel of
 * the theme (class jh-light), which already sets the text, link, button and focus colours. Every
 * colour here is a theme.json palette value. Mistakes are shown in words and with a thicker
 * border, never by colour alone.
 */

.jh-form [hidden] {
	display: none !important; /* The page's script and the server hide parts with the hidden attribute. */
}

.jh-form__form {
	display: grid;
	gap: 1.25rem;
}

.jh-form__field {
	display: grid;
	gap: 0.375rem;
}

.jh-form__field > *,
.jh-form__message > *,
.jh-form__done > * {
	margin: 0;
}

.jh-form label {
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}

.jh-form input[type="text"],
.jh-form input[type="email"],
.jh-form select,
.jh-form textarea {
	width: 100%;
	min-height: var(--wp--custom--target);
	padding: 0.625rem 0.75rem;
	border: 1.5px solid var(--wp--preset--color--line-strong);
	border-radius: var(--wp--custom--radius--control);
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.5;
}

.jh-form textarea {
	min-height: 10rem;
	resize: vertical;
}

.jh-form input[aria-invalid="true"],
.jh-form select[aria-invalid="true"],
.jh-form textarea[aria-invalid="true"] {
	border-width: 3px;
	border-color: var(--wp--preset--color--navy);
}

.jh-form__error {
	padding-left: 0.75rem;
	border-left: 4px solid var(--wp--preset--color--navy);
	color: var(--wp--preset--color--navy);
	font-weight: 600;
}

.jh-form__hint {
	color: var(--wp--preset--color--ink-2);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}

.jh-form__tick {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
}

.jh-form__tick input {
	flex: none;
	width: 1.5rem;
	height: 1.5rem;
	margin: 0.0625rem 0 0;
	accent-color: var(--wp--preset--color--navy);
}

.jh-form__tick label {
	font-weight: 400;
}

.jh-form__check:empty {
	display: none;
}

.jh-form__button {
	width: 100%;
}

.jh-form__message {
	display: grid;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	border-left: 4px solid var(--wp--preset--color--navy);
	border-radius: var(--wp--custom--radius--control);
	background-color: var(--wp--preset--color--navy-50);
	color: var(--wp--preset--color--ink);
}

.jh-form__message > p {
	font-weight: 600;
}

.jh-form__message ul {
	padding-left: 1.25rem;
}

.jh-form__done {
	display: grid;
	gap: 0.75rem;
}

.jh-form__done h3 {
	font-size: var(--wp--preset--font-size--x-large);
}

.jh-form__hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (min-width: 600px) {
	.jh-form__button {
		width: auto;
		justify-self: start;
	}
}
