/* Agntix Forms — front-end.
 * The form reuses the theme's .contact-form / .contact-field / .btn-arrow styles
 * when present. These rules only add layout + plugin-specific bits, and use
 * :where() for any input fallback so the theme always wins on specificity. */

.agntix-form__grid {
	display: grid;
	gap: 0 2rem;
}

@media ( min-width: 640px ) {
	.agntix-form__grid {
		grid-template-columns: 1fr 1fr;
	}
	.agntix-form .af-half {
		grid-column: span 1;
	}
}

.agntix-form .af-full {
	grid-column: 1 / -1;
}

/* Honeypot — visually and physically removed for humans. */
.agntix-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Status message. */
.agntix-form__message {
	display: none;
	margin: 1rem 0 0;
	padding: 0.85rem 1.1rem;
	border-radius: 10px;
	font-size: 0.95rem;
	line-height: 1.45;
}
.agntix-form__message.is-success {
	background: rgba( 46, 160, 67, 0.12 );
	border: 1px solid rgba( 46, 160, 67, 0.45 );
	color: #2ea043;
}
.agntix-form__message.is-error {
	background: rgba( 220, 53, 69, 0.12 );
	border: 1px solid rgba( 220, 53, 69, 0.45 );
	color: #ff6b6b;
}

/* Field error highlight. */
.agntix-form .agntix-field.has-error :where( input, textarea, select ) {
	border-color: #ff6b6b !important;
	box-shadow: 0 0 0 1px #ff6b6b;
}

/* Inline per-field error message. */
.agntix-form .agntix-field__error {
	display: block;
	margin-top: 0.35rem;
	color: #ff6b6b;
	font-size: 0.85rem;
	line-height: 1.4;
}
.agntix-form .agntix-field__error:empty {
	display: none;
}

.agntix-form.is-submitting {
	opacity: 0.7;
	pointer-events: none;
}

.agntix-form__recaptcha {
	margin: 1.25rem 0 0.25rem;
}

/* International phone widget — make the intl-tel-input wrapper fill the field. */
.agntix-form .iti {
	display: block;
	width: 100%;
}
.agntix-form .iti .agntix-tel {
	width: 100%;
}

.agntix-field__check {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
}
.agntix-field__check input {
	margin-top: 0.25rem;
}

/* Low-specificity fallback styling for contexts WITHOUT the Agntix theme
 * (e.g. a default theme). :where() keeps specificity at 0 so the theme overrides. */
:where( .agntix-form .contact-field ) {
	margin-bottom: 1.25rem;
}
:where( .agntix-form .contact-field-label ) {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.95rem;
}
:where( .agntix-form input, .agntix-form textarea, .agntix-form select ) {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid currentColor;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
}
