/*
 * Monster Forms on the page.
 *
 * Colours mix with the page's own text colour, so the form reads on light and dark themes.
 * A theme can change them: .mf-form { --mf-accent: #8a1c1c; }
 * The button colour is also set in Monster Forms > Settings.
 */
.mf-form {
	--mf-accent: #2271b1;
	--mf-accent-text: #fff;
	--mf-border: color-mix(in srgb, currentColor 32%, transparent);
	--mf-soft: color-mix(in srgb, currentColor 6%, transparent);
	--mf-muted: color-mix(in srgb, currentColor 72%, transparent);
	--mf-error: #d63638;
	--mf-stop: #d63638;
	--mf-done: #00a32a;
	--mf-radius: 6px;
	position: relative;
	max-width: 720px;
	margin: 0 0 2em;
	scroll-margin-top: 120px;
}

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

.mf-form [hidden] {
	display: none !important;
}

.mf-form:not(.mf-js) .mf-js-only {
	display: none !important;
}

/* Steps and progress */
.mf-progress {
	display: flex;
	gap: 6px;
	list-style: none;
	margin: 0 0 1.75em;
	padding: 0;
	counter-reset: mf-step;
}

.mf-progress li {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	padding: 8px 0 0;
	border-top: 4px solid var(--mf-border);
	color: var(--mf-muted);
	font-size: .85em;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	counter-increment: mf-step;
}

.mf-progress li::before {
	content: counter(mf-step) ". ";
}

.mf-progress li.is-done {
	border-top-color: var(--mf-accent);
}

.mf-progress li.is-current {
	border-top-color: var(--mf-accent);
	color: inherit;
	font-weight: 600;
}

.mf-step:focus {
	outline: none;
}

.mf-step__title {
	margin: 0 0 .5em;
}

.mf-step__intro {
	margin: 0 0 1.5em;
}

.mf-step__intro > :last-child {
	margin-bottom: 0;
}

/* Fields */
.mf-field {
	margin: 0 0 1.4em;
}

.mf-label {
	display: block;
	margin: 0 0 .4em;
	font-weight: 600;
	line-height: 1.35;
}

.mf-required {
	margin-left: .2em;
	color: var(--mf-error);
}

.mf-help {
	margin: -.1em 0 .6em;
	color: var(--mf-muted);
	font-size: .92em;
}

.mf-form .mf-input {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.mf-input {
	padding: .65em .8em;
	border: 1px solid var(--mf-border);
	border-radius: var(--mf-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.4;
}

select.mf-input option {
	color: #1d2327;
	background: #fff;
}

.mf-input:focus {
	outline: 2px solid var(--mf-accent);
	outline-offset: 1px;
}

textarea.mf-input {
	min-height: 8em;
	resize: vertical;
}

.mf-choices {
	display: grid;
	gap: .45em;
}

.mf-form .mf-choice {
	display: flex;
	align-items: flex-start;
	gap: .65em;
	margin: 0;
	padding: .6em .8em;
	border: 1px solid var(--mf-border);
	border-radius: var(--mf-radius);
	font-weight: normal;
	line-height: 1.4;
	cursor: pointer;
}

.mf-form .mf-choice input {
	flex: none;
	width: 1.15em;
	height: 1.15em;
	margin: .15em 0 0;
	accent-color: var(--mf-accent);
}

.mf-form .mf-choice:has(input:checked) {
	border-color: var(--mf-accent);
	box-shadow: inset 0 0 0 1px var(--mf-accent);
}

.mf-form .mf-choice:has(input:focus-visible) {
	outline: 2px solid var(--mf-accent);
	outline-offset: 1px;
}

.mf-form .mf-consent {
	padding: 0;
	border: 0;
	box-shadow: none !important;
}

.mf-content {
	margin: 0 0 .75em;
}

/* A sign-up form's words above its button (1.0.0). */
.mf-form .mf-signup-note {
	margin: 0 0 .75em;
	font-size: .9em;
	opacity: .85;
}

.mf-content > :last-child {
	margin-bottom: 0;
}

/* Problems */
.mf-has-error .mf-input,
.mf-has-error .mf-choice {
	border-color: var(--mf-error);
}

.mf-error {
	margin: .45em 0 0;
	color: var(--mf-error);
	font-size: .92em;
	font-weight: 600;
}

.mf-stop,
.mf-alert {
	margin: .7em 0 0;
	padding: .8em 1em;
	border-left: 4px solid var(--mf-stop);
	border-radius: 0 var(--mf-radius) var(--mf-radius) 0;
	background: color-mix(in srgb, var(--mf-stop) 12%, transparent);
}

.mf-alert {
	margin: 0 0 1.4em;
}

.mf-stop p,
.mf-alert p {
	margin: 0 0 .45em;
}

.mf-stop p:last-child,
.mf-alert p:last-child {
	margin-bottom: 0;
}

/* Buttons */
.mf-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75em;
	margin-top: 1.75em;
}

.mf-form .mf-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin: 0;
	padding: .6em 1.5em;
	border: 2px solid var(--mf-accent);
	border-radius: var(--mf-radius);
	background: var(--mf-accent);
	color: var(--mf-accent-text);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.mf-form .mf-button:hover {
	filter: brightness(1.08);
}

.mf-form .mf-button:focus-visible {
	outline: 2px solid var(--mf-accent);
	outline-offset: 3px;
}

.mf-form .mf-button:disabled {
	opacity: .45;
	cursor: not-allowed;
	filter: none;
}

.mf-form .mf-button--back {
	border-color: var(--mf-border);
	background: transparent;
	color: inherit;
}

.mf-nav [data-mf-next],
.mf-nav .mf-button--send {
	margin-left: auto;
}

.mf-form.is-sending .mf-button--send {
	cursor: progress;
}

.mf-link {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: normal;
	text-decoration: underline;
	cursor: pointer;
}

/* Check your answers */
.mf-summary__step {
	margin: 0 0 1em;
	padding: .8em 1em;
	border: 1px solid var(--mf-border);
	border-radius: var(--mf-radius);
}

.mf-summary__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	margin: 0 0 .6em;
	font-weight: 600;
}

.mf-summary dl {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: .4em 1em;
	margin: 0;
}

.mf-summary dt {
	margin: 0;
	color: var(--mf-muted);
}

.mf-summary dd {
	margin: 0;
	overflow-wrap: anywhere;
}

/* After sending, and when closed */
.mf-done,
.mf-closed {
	padding: 1.1em 1.4em;
	border-left: 4px solid var(--mf-done);
	border-radius: 0 var(--mf-radius) var(--mf-radius) 0;
	background: color-mix(in srgb, var(--mf-done) 12%, transparent);
}

.mf-closed {
	border-left-color: var(--mf-border);
	background: var(--mf-soft);
}

.mf-done:focus {
	outline: none;
}

.mf-done__title {
	margin-top: 0;
}

.mf-done > :last-child,
.mf-closed > :last-child {
	margin-bottom: 0;
}

/* Hidden from people: the spam trap, and text for screen readers only */
.mf-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mf-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 600px) {
	.mf-progress li:not(.is-current) {
		font-size: 0;
	}

	.mf-progress li:not(.is-current)::before {
		content: none;
	}

	.mf-progress li.is-current {
		flex-grow: 4;
	}

	.mf-summary dl {
		grid-template-columns: 1fr;
		gap: .1em;
	}

	.mf-summary dd {
		margin-bottom: .6em;
	}

	.mf-nav .mf-button {
		flex: 1 1 auto;
	}
}
