/**
 * Signup form.
 *
 * The brief asks for forms that read as part of the site rather than as a
 * plugin dropped into it, so almost nothing here sets a font or a colour:
 * type, weight and link colour are inherited from the Astra child theme. What
 * is set is spacing, the rule under each input, and the states the theme has
 * no opinion about.
 */

.em-form {
	--em-rule: #dad4c8;
	--em-muted: #6c665c;
	--em-seal: #7a2e2a;
	--em-ok: #2f5233;

	font: inherit;
	max-width: 34rem;
}

.em-form *,
.em-form *::before,
.em-form *::after {
	box-sizing: border-box;
}

.em-form__heading {
	font-size: 1.25rem;
	font-weight: 400;
	letter-spacing: 0.01em;
	line-height: 1.25;
	margin: 0 0 0.4rem;
}

.em-form__body {
	color: var(--em-muted);
	font-size: 0.9375rem;
	line-height: 1.55;
	margin: 0 0 1rem;
	max-width: 32em;
}

.em-form__fields {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.em-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.em-form__label {
	color: var(--em-muted);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* A ruled line rather than a boxed field: closer to a page in a notebook,
   and it sits more quietly under gallery photography than a bordered box. */

.em-form__input {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--em-rule);
	border-radius: 0;
	color: inherit;
	font: inherit;
	padding: 0.45rem 0;
	transition: border-color 0.15s ease;
	width: 100%;
}

.em-form__input:focus {
	border-bottom-color: currentColor;
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.em-form__input:focus-visible {
	outline-color: currentColor;
	outline-offset: 4px;
}

.em-form__button {
	align-self: flex-start;
	background: var(--em-seal);
	border: 1px solid var(--em-seal);
	border-radius: 2px;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	padding: 0.6rem 1.4rem;
	transition: background 0.15s ease, color 0.15s ease;
}

.em-form__button:hover,
.em-form__button:focus {
	background: transparent;
	color: var(--em-seal);
}

.em-form__button[disabled] {
	cursor: default;
	opacity: 0.6;
}

.em-form__consent {
	color: var(--em-muted);
	font-size: 0.75rem;
	line-height: 1.5;
	margin: 0.9rem 0 0;
}

.em-form__privacy {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.em-form__message {
	font-size: 0.875rem;
	line-height: 1.5;
	margin: 0.75rem 0 0;
}

.em-form__message:empty {
	display: none;
}

.em-form__message--ok {
	color: var(--em-ok);
}

.em-form__message--error {
	color: var(--em-seal);
}

/* The honeypot. Off-screen rather than display:none, because some bots skip
   hidden fields but happily fill in one that is merely out of view. */

.em-form__trap {
	height: 1px;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.em-form--busy .em-form__button {
	cursor: progress;
	opacity: 0.6;
}

/* Compact: for a footer column, where vertical space is short. */

.em-form--compact .em-form__heading {
	font-size: 1.0625rem;
}

.em-form--compact .em-form__body {
	font-size: 0.875rem;
	margin-bottom: 0.75rem;
}

.em-form--compact .em-form__fields {
	gap: 0.6rem;
}

.em-form--compact .em-form__label {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.em-form--compact .em-form__input::placeholder {
	color: var(--em-muted);
}

/* Inline: the field and the button on one line, for a wide band. */

@media (min-width: 40em) {

	.em-form--inline {
		max-width: 44rem;
	}

	.em-form--inline .em-form__fields {
		align-items: flex-end;
		flex-direction: row;
		gap: 1rem;
	}

	.em-form--inline .em-form__field {
		flex: 1 1 auto;
	}

	.em-form--inline .em-form__button {
		flex: 0 0 auto;
	}
}

/* Notice shown after a no-JavaScript submission redirects back. */

.em-notice {
	border-left: 2px solid var(--em-rule);
	font-size: 0.9375rem;
	line-height: 1.55;
	margin: 1rem 0;
	padding: 0.5rem 0 0.5rem 0.85rem;
}

.em-notice--ok {
	border-left-color: var(--em-ok);
}

.em-notice--error {
	border-left-color: var(--em-seal);
}

@media (prefers-reduced-motion: reduce) {

	.em-form *,
	.em-form *::before,
	.em-form *::after {
		transition-duration: 0.01ms !important;
	}
}
