/**
 * AJC Form Guard — widget styling.
 *
 * Deliberately quiet. This is a status line on someone else's contact form, not
 * a branded badge: it should read as part of the form it sits in, inherit the
 * theme's colours, and disappear once verification is done.
 *
 * Every selector here has to clear 0,1,0. Gravity Forms' theme reset ships
 * `.gform-theme--framework :where(:not(html)...) { all: unset; display: revert }`,
 * and :where() contributes no specificity — so that rule scores 0,1,0, a tie with a
 * single class, and ties go to whichever sheet loads last. That is always Gravity
 * Forms': the field enqueues this file before the form's theme. At 0,1,0 `all: unset`
 * reverted every property below, and the widget rendered as bare body-size text with
 * no spinner. Getting past 0,1,0 beats the reset outright without !important.
 *
 * The status line gets there via [data-ajcfg-altcha] rather than a doubled class,
 * because that attribute is also what scopes it correctly. `.ajcfg-widget` is shared
 * with the hosted providers, whose markup is an empty div that hCaptcha or Turnstile
 * fills with its own iframe — and opacity cascades into an iframe, so styling those
 * containers greys out the vendor's checkbox into looking disabled. Only the ALTCHA
 * widget carries [data-ajcfg-altcha]; altcha.js selects on that same attribute.
 *
 * Classes with no such hook of their own are doubled instead.
 */

.ajcfg-widget[data-ajcfg-altcha] {
	display: flex;
	align-items: center;
	gap: 0.5em;
	font-size: 0.875em;
	line-height: 1.4;
	opacity: 0.75;
	min-height: 1.5em;
}

.ajcfg-widget[data-ajcfg-state="done"] {
	opacity: 0.55;
}

.ajcfg-spinner.ajcfg-spinner {
	width: 0.9em;
	height: 0.9em;
	flex: 0 0 auto;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	opacity: 0.6;
	animation: ajcfg-spin 0.8s linear infinite;
}

.ajcfg-widget[data-ajcfg-state="done"] .ajcfg-spinner,
.ajcfg-widget[data-ajcfg-state="unavailable"] .ajcfg-spinner {
	animation: none;
	border-right-color: currentColor;
	opacity: 0.35;
}

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

/* Respect a stated preference for less motion; the status text still updates. */
@media ( prefers-reduced-motion: reduce ) {
	.ajcfg-spinner.ajcfg-spinner {
		animation: none;
		border-right-color: currentColor;
	}
}

.ajcfg-editor-preview.ajcfg-editor-preview {
	padding: 0.75em 1em;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	color: #50575e;
	font-size: 0.875em;
}

/*
 * The honeypot.
 *
 * Positioned off the viewport rather than hidden with display:none or the hidden
 * attribute. Both of those are trivial for a spam tool to detect and skip, and
 * skipping the field is exactly what defeats the technique. Moving it out of
 * view costs an attacker actual layout computation to notice.
 *
 * The markup carries aria-hidden and tabindex="-1", so assistive technology
 * never announces it and keyboard navigation never reaches it. This rule only
 * has to keep it out of sight; the markup keeps it out of everyone's way.
 *
 * !important because form themes frequently set positioning on inputs, and a
 * honeypot that becomes visible is a field real people will fill in.
 */
.ajcfg-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}
