/* Lead forms (inc/forms.php) */
.ml-form {
	--ml-form-border: #0000001f;
	--ml-form-border-hover: #00000033;
	--ml-form-focus: #005ff9;
	--ml-form-error: #d92d20;
	--ml-form-success: #079455;
	color: var(--color-text);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

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

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

.ml-form__form {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 0;
}

.ml-form__fields {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px 16px;
}

.ml-form__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	grid-column: 1 / -1;
	min-width: 0;
}

.ml-form__field--half {
	grid-column: auto;
}

.ml-form__label {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.ml-form__required {
	color: var(--ml-form-error);
}

.ml-form .ml-form__input {
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 12px 16px;
	color: var(--color-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	background-color: #fff;
	border: 1px solid var(--ml-form-border);
	border-radius: 12px;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.ml-form textarea.ml-form__input {
	height: auto;
	min-height: 120px;
	resize: vertical;
}

.ml-form .ml-form__input:hover {
	border-color: var(--ml-form-border-hover);
}

.ml-form .ml-form__input:focus {
	border-color: var(--ml-form-focus);
	outline: 0;
	box-shadow: 0 0 0 4px #005ff91f;
}

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

.ml-form .ml-form__select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23101828' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	appearance: none;
	cursor: pointer;
}

.ml-form .is-invalid .ml-form__input {
	border-color: var(--ml-form-error);
}

.ml-form .is-invalid .ml-form__input:focus {
	box-shadow: 0 0 0 4px #d92d201f;
}

.ml-form__check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 14px;
	line-height: 1.5;
	cursor: pointer;
}

.ml-form__check input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--color-primary);
	cursor: pointer;
}

.ml-form__check a {
	color: var(--color-primary);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.ml-form .ml-form__error,
.ml-form .ml-form__status {
	margin: 0;
	color: var(--ml-form-error);
	font-size: 14px;
	line-height: 1.4;
}

.ml-form__submit {
	margin: 0;
}

.ml-form__submit .wp-block-button__link {
	border: 0;
	font-family: inherit;
	cursor: pointer;
}

.ml-form__submit .wp-block-button__link:disabled {
	opacity: .6;
	cursor: progress;
}

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

.ml-form__success {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px 24px;
	color: var(--color-text);
	font-weight: 500;
	background: #ecfdf3;
	border: 1px solid #abefc6;
	border-radius: 12px;
	outline: 0;
}

.ml-form__success .icon {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	color: var(--ml-form-success);
}

.ml-form .ml-form__success p {
	margin: 0;
}

/* Page placement */
.entry-content .ml-form-block {
	margin: 32px 0 0;
}

/* Platform check: one row, centred under the Platforms heading. */
.ml-form--domain-check {
	width: min(100%, 560px);
	margin: 0 auto;
}

.ml-form--domain-check .ml-form__form {
	gap: 12px;
}

.ml-form__inline {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.ml-form__inline .ml-form__field {
	flex: 1 1 auto;
}

.ml-form__inline .wp-block-button__link {
	min-height: 48px;
}

/* Platform check, step one: field and button in one search bar. */
.ml-form__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 8px 8px 20px;
	background: #fff;
	border: 1px solid var(--ml-form-border);
	border-radius: 20px;
	box-shadow: 0 12px 32px -12px #005ff933;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.ml-form__bar:hover {
	border-color: var(--ml-form-border-hover);
}

.ml-form__bar:focus-within {
	border-color: var(--ml-form-focus);
	box-shadow: 0 0 0 4px #005ff91f, 0 16px 40px -12px #005ff94d;
}

.ml-form .is-invalid .ml-form__bar {
	border-color: var(--ml-form-error);
}

.ml-form .is-invalid .ml-form__bar:focus-within {
	box-shadow: 0 0 0 4px #d92d201f, 0 16px 40px -12px #d92d2033;
}

.ml-form__bar-icon {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	color: var(--color-muted);
	transition: color .2s ease;
}

.ml-form__bar:focus-within .ml-form__bar-icon {
	color: var(--ml-form-focus);
}

.ml-form .ml-form__bar .ml-form__input,
.ml-form .ml-form__bar .ml-form__input:hover,
.ml-form .ml-form__bar .ml-form__input:focus,
.ml-form .is-invalid .ml-form__bar .ml-form__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.ml-form__bar .ml-form__submit {
	flex: 0 0 auto;
}

.ml-form .ml-form__bar .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0;
	min-height: 48px;
	padding: 0 20px;
	border-radius: 12px;
	white-space: nowrap;
	transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

/* The arrow slides in once the domain looks right. */
.ml-form__bar .wp-block-button__link .icon {
	width: 0;
	height: 20px;
	opacity: 0;
	transition: width .32s cubic-bezier(.16, 1, .3, 1), margin .32s cubic-bezier(.16, 1, .3, 1), opacity .2s ease;
}

.ml-form__step.is-ready .ml-form__bar .wp-block-button__link .icon {
	width: 20px;
	margin-left: 8px;
	opacity: 1;
}

.ml-form__step.is-ready .ml-form__bar .wp-block-button__link {
	box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 32%, transparent);
}

.ml-form__step.is-ready .ml-form__bar .wp-block-button__link:hover {
	transform: translateY(-1px);
}

/* Platform check, done: what was checked and where the answer goes. */
.ml-form .ml-form__done {
	flex-direction: column;
	gap: 8px;
	padding: 32px;
	text-align: center;
	background: var(--color-primary-tint);
	border: 1px solid #e4ecfb;
	border-radius: 24px;
	box-shadow: 0 12px 48px #045ef822, 0 4px 12px rgba(16, 24, 40, .04);
}

.ml-form__done-mark {
	width: 56px;
	height: 56px;
	margin-bottom: 8px;
	color: var(--ml-form-success);
	border-radius: 50%;
	animation: ml-form-done-ping 1s .8s ease-out both;
}

.ml-form__done-mark circle {
	stroke-dasharray: 164;
	animation: ml-form-draw .6s cubic-bezier(.65, 0, .35, 1) both;
}

.ml-form__done-mark path {
	--ml-dash: 34;
	stroke-dasharray: 34;
	animation: ml-form-draw .4s .48s cubic-bezier(.65, 0, .35, 1) both;
}

.ml-form .ml-form__done .ml-form__done-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	animation: ml-form-rise .48s .2s cubic-bezier(.16, 1, .3, 1) both;
}

.ml-form .ml-form__done .ml-form__done-text {
	color: var(--color-muted);
	font-weight: 400;
	overflow-wrap: anywhere;
	animation: ml-form-rise .48s .28s cubic-bezier(.16, 1, .3, 1) both;
}

.ml-form__done-text strong {
	color: var(--color-text);
	font-weight: 600;
}

.ml-form .ml-form__again {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding: 8px 16px;
	color: var(--color-primary);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	background: #fff;
	border: 1px solid #e4ecfb;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
	animation: ml-form-rise .48s .36s cubic-bezier(.16, 1, .3, 1) both;
}

.ml-form .ml-form__again:hover {
	background: var(--color-primary-soft);
	border-color: #c8d9fb;
	transform: translateY(-1px);
}

.ml-form .ml-form__again .icon {
	width: 16px;
	height: 16px;
	color: currentColor;
}

.ml-form .ml-form__step-title {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}

.ml-form .ml-form__step-text {
	margin: -8px 0 0;
	color: var(--color-muted);
	text-align: center;
}

/* Platform check, step two: a card over a dimmed page. */
.ml-form--domain-check {
	position: relative;
}

.ml-landing-block__inner:has(.ml-form.is-spotlit) {
	/* Above the sticky header, so the dim covers it too. */
	z-index: 10001;
}

html.ml-form-locked {
	overflow: hidden;
	scrollbar-gutter: stable;
}

.ml-form__backdrop {
	position: fixed;
	inset: 0;
	z-index: 1;
	background: rgba(6, 20, 46, .56);
	backdrop-filter: blur(4px);
	animation: ml-form-fade-in .3s ease both;
}

/* Pinned to the middle of the viewport, not to the row it opens from. */
.ml-form .ml-form__card {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: min(100vw - 32px, 520px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	gap: 16px;
	padding: 32px;
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 24px 64px rgba(6, 20, 46, .32), 0 4px 12px rgba(6, 20, 46, .08);
	translate: -50% -50%;
	animation: ml-form-card-in .48s cubic-bezier(.16, 1, .3, 1) both;
}

.ml-form.is-closing .ml-form__backdrop {
	animation: ml-form-fade-out .2s ease both;
}

.ml-form.is-closing .ml-form__card {
	animation: ml-form-card-out .2s ease both;
}

/* Close and "Change" both take the visitor back to the domain. */
.ml-form .ml-form__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: var(--color-muted);
	background: transparent;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.ml-form .ml-form__close:hover {
	color: var(--color-text);
	background: var(--color-surface-soft);
}

.ml-form__close .icon {
	width: 20px;
	height: 20px;
}

/* The domain being checked, with a scanning line under it. */
.ml-form__scan {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	align-self: center;
	max-width: calc(100% - 64px);
	padding: 8px 8px 8px 12px;
	overflow: hidden;
	background: var(--color-primary-tint);
	border: 1px solid #e4ecfb;
	border-radius: 999px;
	animation: ml-form-rise .48s .08s cubic-bezier(.16, 1, .3, 1) both;
}

.ml-form__scan-icon {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	color: var(--color-primary);
}

.ml-form__scan-icon .icon {
	width: 20px;
	height: 20px;
}

.ml-form__scan-domain {
	min-width: 0;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ml-form .ml-form__change {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	color: var(--color-primary);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	background: #fff;
	border: 1px solid #e4ecfb;
	border-radius: 999px;
	cursor: pointer;
	transition: border-color .2s ease, background-color .2s ease;
}

.ml-form .ml-form__change:hover {
	background: var(--color-primary-soft);
	border-color: #c8d9fb;
}

.ml-form__change .icon {
	width: 12px;
	height: 12px;
}

.ml-form__scan-bar {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 2px;
	overflow: hidden;
}

.ml-form__scan-bar::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 40%;
	background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-accent), transparent);
	animation: ml-form-scan 1.6s ease-in-out infinite;
}

.ml-form__card .ml-form__step-title,
.ml-form__card .ml-form__step-text {
	animation: ml-form-rise .48s .12s cubic-bezier(.16, 1, .3, 1) both;
}

.ml-form__stack {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 8px;
	animation: ml-form-rise .48s .16s cubic-bezier(.16, 1, .3, 1) both;
}

.ml-form__control {
	position: relative;
}

.ml-form .ml-form__control .ml-form__input {
	padding-left: 44px;
}

.ml-form__control-icon {
	position: absolute;
	top: 50%;
	left: 16px;
	width: 20px;
	height: 20px;
	color: var(--color-muted);
	pointer-events: none;
	translate: 0 -50%;
	transition: color .2s ease;
}

.ml-form__control:focus-within .ml-form__control-icon {
	color: var(--ml-form-focus);
}

/* Draw the eye to the field the answer is waiting on. */
.ml-form__card .ml-form__control .ml-form__input {
	animation: ml-form-ping 1.2s .56s ease-out 2;
}

.ml-form__card .ml-form__submit .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}

.ml-form__card .ml-form__submit .icon {
	width: 20px;
	height: 20px;
	transition: transform .2s ease;
}

.ml-form__card:not(.is-ready) .ml-form__submit .wp-block-button__link:not(:disabled) {
	opacity: .72;
}

.ml-form__card.is-ready .ml-form__submit .wp-block-button__link {
	box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 32%, transparent);
}

.ml-form__card.is-ready .ml-form__submit .wp-block-button__link:hover {
	transform: translateY(-1px);
}

.ml-form__card.is-ready .ml-form__submit .wp-block-button__link:hover .icon {
	transform: translateX(4px);
}

.ml-form .ml-form__note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	color: var(--color-muted);
	font-size: 12px;
	line-height: 1.4;
	animation: ml-form-rise .48s .2s cubic-bezier(.16, 1, .3, 1) both;
}

.ml-form__note .icon {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
}

.ml-form--domain-check .ml-form__success {
	animation: ml-form-rise .48s cubic-bezier(.16, 1, .3, 1) both;
}

/* An invalid submit nudges the field that needs fixing. */
.ml-form .is-shaking {
	animation: ml-form-shake .4s ease;
}

@keyframes ml-form-fade-in {
	from {
		opacity: 0;
	}
}

@keyframes ml-form-fade-out {
	to {
		opacity: 0;
	}
}

@keyframes ml-form-card-in {
	from {
		opacity: 0;
		scale: .92;
		translate: -50% calc(-50% + 24px);
	}
}

@keyframes ml-form-card-out {
	to {
		opacity: 0;
		scale: .96;
		translate: -50% calc(-50% + 12px);
	}
}

@keyframes ml-form-rise {
	from {
		opacity: 0;
		translate: 0 12px;
	}
}

@keyframes ml-form-scan {
	from {
		translate: -100% 0;
	}

	to {
		translate: 250% 0;
	}
}

@keyframes ml-form-draw {
	from {
		stroke-dashoffset: var(--ml-dash, 164);
	}

	to {
		stroke-dashoffset: 0;
	}
}

@keyframes ml-form-done-ping {
	from {
		box-shadow: 0 0 0 0 #07945566;
	}

	to {
		box-shadow: 0 0 0 16px #07945500;
	}
}

@keyframes ml-form-ping {
	from {
		box-shadow: 0 0 0 0 #005ff966;
	}

	to {
		box-shadow: 0 0 0 12px #005ff900;
	}
}

@keyframes ml-form-shake {
	0%,
	100% {
		translate: 0 0;
	}

	20%,
	60% {
		translate: -8px 0;
	}

	40%,
	80% {
		translate: 8px 0;
	}
}

.ml-platforms__check {
	margin: 24px 0 32px;
}

@media (max-width: 599px) {
	.ml-form__fields {
		grid-template-columns: minmax(0, 1fr);
	}

	.ml-form__field--half {
		grid-column: 1 / -1;
	}

	.ml-form__inline {
		flex-direction: column;
		align-items: stretch;
	}

	.ml-form__inline .wp-block-button__link {
		width: 100%;
	}

	.ml-form__card .ml-form__submit .wp-block-button__link {
		justify-content: center;
	}

	.ml-form .ml-form__card {
		padding: 24px 16px 16px;
	}

	.ml-form__bar {
		padding-left: 12px;
	}

	.ml-form .ml-form__bar .wp-block-button__link {
		padding: 0 16px;
	}

	.ml-form .ml-form__done {
		padding: 24px 16px;
	}

	.ml-form .ml-form__step-title {
		padding: 0 24px;
		font-size: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ml-form__backdrop,
	.ml-form .ml-form__card,
	.ml-form__scan,
	.ml-form__scan-bar::after,
	.ml-form__card .ml-form__step-title,
	.ml-form__card .ml-form__step-text,
	.ml-form__stack,
	.ml-form__card .ml-form__control .ml-form__input,
	.ml-form .ml-form__note,
	.ml-form--domain-check .ml-form__success,
	.ml-form__done-mark,
	.ml-form__done-mark circle,
	.ml-form__done-mark path,
	.ml-form .ml-form__done .ml-form__done-title,
	.ml-form .ml-form__done .ml-form__done-text,
	.ml-form .ml-form__again,
	.ml-form .is-shaking {
		animation: none;
	}

	.ml-form__card.is-ready .ml-form__submit .wp-block-button__link:hover,
	.ml-form__card.is-ready .ml-form__submit .wp-block-button__link:hover .icon,
	.ml-form__step.is-ready .ml-form__bar .wp-block-button__link:hover,
	.ml-form .ml-form__again:hover {
		transform: none;
	}

	.ml-form__bar .wp-block-button__link .icon {
		transition: none;
	}
}
