/**
 * The signup form.
 *
 * Sized in relative units and coloured from two custom properties, so a theme
 * can restyle it without fighting specificity. Turn the whole file off under
 * Signups if the theme would rather do it itself.
 */

.mailhouse-form {
	--mailhouse-accent: #2b6cb0;
	--mailhouse-border: #b9b9b9;
	max-width: 32rem;
	margin: 0 0 1.5rem;
}

.mailhouse-form__title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	line-height: 1.3;
}

.mailhouse-form__description {
	margin: 0 0 1rem;
}

.mailhouse-form__field {
	margin: 0 0 0.75rem;
}

.mailhouse-form__field label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.9375rem;
}

.mailhouse-form input[type="email"],
.mailhouse-form input[type="text"] {
	width: 100%;
	padding: 0.6rem 0.7rem;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 1px solid var( --mailhouse-border );
	border-radius: 0.35rem;
	box-sizing: border-box;
}

.mailhouse-form input[type="email"]:focus,
.mailhouse-form input[type="text"]:focus {
	outline: 2px solid var( --mailhouse-accent );
	outline-offset: 1px;
}

.mailhouse-form__consent {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	margin: 0 0 1rem;
	font-size: 0.875rem;
	line-height: 1.5;
}

.mailhouse-form__consent input {
	margin-top: 0.25rem;
	flex: 0 0 auto;
}

.mailhouse-form__consent a,
.mailhouse-form__legal a {
	color: var( --mailhouse-accent );
	text-decoration: underline;
}

.mailhouse-form__legal {
	margin: 0 0 1rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	opacity: 0.85;
}

.mailhouse-form__captcha label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.9375rem;
}

.mailhouse-form__captcha-question {
	margin-left: 0.25rem;
	font-size: 1.05rem;
	letter-spacing: 0.02em;
}

.mailhouse-form__captcha--builtin input[type="text"] {
	max-width: 8rem;
}

.mailhouse-form-after-content,
.mailhouse-form-footer {
	margin: 2.5rem auto 1.5rem;
	padding: 1.5rem;
	border: 1px solid var( --mailhouse-border, #b9b9b9 );
	border-radius: 0.5rem;
	max-width: 36rem;
	box-sizing: border-box;
}

.mailhouse-form-after-content .mailhouse-form,
.mailhouse-form-footer .mailhouse-form {
	margin: 0;
	max-width: none;
}

.mailhouse-form--stacked .mailhouse-form__field--name {
	display: block;
}

.mailhouse-form__submit {
	margin: 0;
}

.mailhouse-form button[type="submit"] {
	padding: 0.65rem 1.2rem;
	font: inherit;
	color: #fff;
	background: var( --mailhouse-accent );
	border: 0;
	border-radius: 0.35rem;
	cursor: pointer;
}

.mailhouse-form button[type="submit"][disabled] {
	opacity: 0.6;
	cursor: progress;
}

.mailhouse-form__message {
	margin: 0 0 1rem;
	padding: 0.7rem 0.9rem;
	border-left: 3px solid var( --mailhouse-accent );
	border-radius: 0.25rem;
	background: rgba( 0, 0, 0, 0.04 );
	font-size: 0.9375rem;
}

.mailhouse-form__message--error {
	border-left-color: #b32d2e;
}

/* The honeypot. Hidden from people, left in the DOM for anything that fills
   in every field it finds. */
.mailhouse-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Inline layout: one row on anything wider than a phone. */
@media ( min-width: 30rem ) {
	.mailhouse-form--inline .mailhouse-form__form {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
		align-items: flex-end;
	}

	.mailhouse-form--inline .mailhouse-form__field {
		flex: 1 1 12rem;
		margin: 0;
	}

	.mailhouse-form--inline .mailhouse-form__submit,
	.mailhouse-form--inline .mailhouse-form__consent {
		margin: 0;
	}

	.mailhouse-form--inline .mailhouse-form__consent {
		flex: 1 1 100%;
		margin-top: 0.5rem;
	}
}
