/**
 * Gravity Forms Mailgun Validation - front end.
 *
 * Errors themselves reuse Gravity Forms' own .gfield_error and
 * .gfield_validation_message classes, so they inherit the active theme.
 * Only the states GF has no equivalent for are styled here.
 */

/* The "checking address..." hint shown while a lookup is in flight. */
.gfmv-status {
	display: flex;
	align-items: center;
	gap: 0.5em;
	opacity: 0.75;
	font-style: italic;
}

/* Spinner lives inside the status message, not on the input container. */
.gfmv-status::before {
	content: "";
	flex: 0 0 auto;
	width: 0.85em;
	height: 0.85em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: gfmv-spin 0.7s linear infinite;
}

@keyframes gfmv-spin {
	to {
		transform: rotate( 360deg );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.gfmv-status::before {
		animation: none;
		opacity: 0.5;
	}
}

/*
 * Submission controls show a busy state while a check is outstanding. They are
 * deliberately NOT disabled: blur fires during mousedown, so disabling here
 * would swallow the very click that started the check. The script queues the
 * press instead and replays it once the answer arrives.
 */
.gfmv-form-busy [aria-busy="true"] {
	cursor: progress;
	opacity: 0.7;
}

/* The clickable "did you mean" correction inside a validation message. */
button.gfmv-suggestion {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

button.gfmv-suggestion:hover,
button.gfmv-suggestion:focus {
	text-decoration: none;
}

/* "This address is correct, use it anyway" confirmation. */
.gfmv-override {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	margin-top: 0.5em;
	font-style: normal;
	font-weight: 400;
}

.gfmv-override input[type="checkbox"] {
	flex: 0 0 auto;
	margin-top: 0.15em;
}

.gfmv-override label {
	cursor: pointer;
}
