/* ACF Captcha - styles de base, à surcharger dans le thème si besoin. */

.acf-captcha {
	position: relative;
}

/* Honeypot : hors écran (pas de display:none, que certains bots détectent). */
.acf-captcha .acf-captcha__hp {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.acf-captcha .acf-captcha__row {
	display: flex;
	flex-wrap: wrap;
	max-width: 160px;
	align-items: center;
	gap: 8px;
}

/* Le libellé reste sur une ligne : il donne sa largeur à la colonne dans les formulaires en ligne. */
.acf-field-captcha .acf-label label {
	white-space: nowrap;
}

.acf-captcha .acf-captcha__img-wrap {
	flex: 0 0 auto;
	line-height: 0;
}

.acf-captcha .acf-captcha__img {
	display: block;
	width: 120px;
	height: 42px;
	border-radius: 2px;
	background: #f2f2f2;
	user-select: none;
}

.acf-captcha.-loading .acf-captcha__img {
	opacity: .4;
}

.acf-captcha .acf-captcha__refresh {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.acf-captcha .acf-captcha__refresh:hover,
.acf-captcha .acf-captcha__refresh:focus-visible {
	background: rgba(0, 0, 0, .08);
}

.acf-captcha.-loading .acf-captcha__refresh svg {
	animation: acf-captcha-spin 1s linear infinite;
}

/* Spécificité élevée pour passer devant les styles génériques des thèmes (.acf-form .acf-field input[type="text"]). */
.acf-field .acf-captcha input.acf-captcha__code[type="text"] {
	/* Sur sa propre ligne, sous l'image, même largeur que image + bouton (120 + 8 + 32). */
	flex: 0 0 160px;
	box-sizing: border-box;
	width: 160px;
	max-width: 100%;
	text-transform: uppercase;
}

.acf-captcha .acf-captcha__error {
	margin: 6px 0 0;
	font-size: 13px;
	color: #c00;
}

.acf-field .acf-captcha.-error input.acf-captcha__code[type="text"] {
	border-color: #c00 !important;
}

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

@media (prefers-reduced-motion: reduce) {
	.acf-captcha.-loading .acf-captcha__refresh svg {
		animation: none;
	}
}
