/*
 * TFT Forms — styles vanilla, autonomes du build Tailwind.
 *
 * Le module forms vit dans mu-plugins/tft-core/, hors du content scan Tailwind
 * (qui ne couvre que wp-content/themes/tft/). Pour rester totalement
 * autonome — et permettre la livraison du package sans coupler le mu-plugin
 * au theme — ce CSS est écrit en vanilla et enqueueé conditionnellement par
 * tft_forms_enqueue_assets() (forms.php).
 *
 * Couleurs alignées sur la charte (brand-blue #009edb, brand-navy #004987,
 * brand-yellow #fbaf17). Contrastes vérifiés ≥ 4.5:1 sur fond blanc pour les
 * textes d'erreur (rouge #b00020 sur #fff = 7.4:1 → AA large + AAA normal).
 *
 * Référence ticket GAR-466.
 */

.tft-form {
	max-width: 640px;
	margin: 0 0 2rem;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 15px;
	color: #002442;
}

.tft-form__form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.tft-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.tft-form__label {
	font-weight: 500;
	color: #002442;
	font-size: 14px;
}

.tft-form__required {
	color: #b00020;
	margin-left: 2px;
}

.tft-form__input,
.tft-form__textarea,
.tft-form__select {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 1px solid #c7d2dd;
	border-radius: 3px;
	background-color: #fff;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: #002442;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}

.tft-form__textarea {
	resize: vertical;
	min-height: 8rem;
}

.tft-form__input:focus,
.tft-form__textarea:focus,
.tft-form__select:focus {
	outline: none;
	border-color: #009edb;
	box-shadow: 0 0 0 3px rgba(0, 158, 219, 0.25);
}

.tft-form__input[aria-invalid="true"],
.tft-form__textarea[aria-invalid="true"],
.tft-form__select[aria-invalid="true"] {
	border-color: #b00020;
}

.tft-form__input[aria-invalid="true"]:focus,
.tft-form__textarea[aria-invalid="true"]:focus,
.tft-form__select[aria-invalid="true"]:focus {
	box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.25);
}

.tft-form__error {
	margin: 0;
	color: #b00020;
	font-size: 13px;
	line-height: 1.4;
}

.tft-form__help {
	margin: 0;
	color: #4d6177;
	font-size: 13px;
	line-height: 1.4;
}

.tft-form__hint {
	margin: 0.5rem 0 0;
	color: #4d6177;
	font-size: 12px;
}

.tft-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.tft-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	background-color: #009edb;
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	border: 0;
	border-radius: 3px;
	cursor: pointer;
	transition: background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.tft-form__submit:hover {
	background-color: #007fb1;
}

.tft-form__submit:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 158, 219, 0.4), 0 0 0 6px rgba(0, 36, 66, 0.2);
}

.tft-form__submit:active {
	transform: translateY(1px);
}

.tft-form__notice {
	margin: 0 0 1.25rem;
	padding: 0.875rem 1rem;
	border-radius: 3px;
	font-size: 14px;
	line-height: 1.5;
}

.tft-form__notice--success {
	background-color: #e6f4ea;
	border: 1px solid #2e7d4f;
	color: #14502b;
}

.tft-form__notice--error {
	background-color: #fdecea;
	border: 1px solid #b00020;
	color: #5a0010;
}

.tft-form__notice p {
	margin: 0;
}

.tft-form__field--consent {
	gap: 0;
}

.tft-form__consent {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	font-size: 14px;
	line-height: 1.5;
	color: #002442;
	cursor: pointer;
}

.tft-form__checkbox {
	flex: 0 0 auto;
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.15rem;
	accent-color: #009edb;
	cursor: pointer;
}

.tft-form__checkbox:focus-visible {
	outline: 2px solid #009edb;
	outline-offset: 2px;
}

.tft-form__consent-text a {
	color: #007fb1;
	text-decoration: underline;
}

.tft-form__consent-text a:hover,
.tft-form__consent-text a:focus-visible {
	color: #004987;
}

.tft-form__field--consent .tft-form__error {
	margin-top: 0.375rem;
}

.tft-form__honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (min-width: 768px) {
	.tft-form {
		font-size: 16px;
	}
	.tft-form__input,
	.tft-form__textarea,
	.tft-form__select {
		font-size: 16px;
	}
}
