/**
 * SecGram — forms.css
 * Formulaires : Divi Contact Form, formulaire de recherche du thème,
 * et champs génériques d'autres plugins (couplage minimal via :where).
 *
 * Rappels accessibilité (voir docs/ACCESSIBILITY.md) :
 * - le placeholder n'est jamais le seul label : ajouter la classe
 *   « sg-form-labels » au module Divi Contact Form pour afficher les
 *   labels de champs au-dessus des champs ;
 * - hauteur mini 48px, focus visible, erreurs contrastées.
 */

/* ---- Champs ---------------------------------------------------------- */
:where(.et_pb_contact_form, .et_pb_newsletter_form, .sg-form, .sg-search-form)
	:where(input[type="text"], input[type="email"], input[type="tel"],
	input[type="url"], input[type="search"], input[type="number"],
	input[type="password"], textarea, select) {
	width: 100%;
	min-height: 48px;
	padding: 0.65rem 0.9rem;
	background: var(--sg-color-surface);
	color: var(--sg-color-ink);
	border: 1px solid var(--sg-color-border);
	border-radius: var(--sg-radius-sm);
	font-size: 1rem;
	line-height: 1.5;
	transition: border-color var(--sg-transition-fast), box-shadow var(--sg-transition-fast);
}

:where(.et_pb_contact_form, .et_pb_newsletter_form, .sg-form, .sg-search-form)
	:where(textarea) {
	min-height: 140px;
	resize: vertical;
}

/* Placeholder : contraste suffisant (4.6:1 sur blanc). */
:where(.et_pb_contact_form, .sg-form, .sg-search-form) :where(input, textarea)::placeholder {
	color: var(--sg-color-muted);
	opacity: 1;
}

/* Focus : anneau visible en plus de la bordure. */
:where(.et_pb_contact_form, .et_pb_newsletter_form, .sg-form, .sg-search-form)
	:where(input, textarea, select):focus {
	border-color: var(--sg-color-accent-strong);
	box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.35);
	outline: none; /* remplacé par la bordure + l'anneau ci-dessus */
}

/* ---- Labels visibles (option) ---------------------------------------- */
/* Divi masque les labels du Contact Form (placeholder seul).
   La classe « sg-form-labels » sur le module les réaffiche. */
.sg-form-labels .et_pb_contact_field .et_pb_contact_form_label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: var(--sg-text-sm);
	font-weight: 600;
	color: var(--sg-color-ink);
}

/* ---- États d'erreur et de succès (Divi Contact Form) ----------------- */
/* Champ en erreur : repère visuel net, pas seulement chromatique
   (bordure épaissie). */
.et_pb_contact_form input.et_contact_error,
.et_pb_contact_form textarea.et_contact_error,
.et_pb_contact_form select.et_contact_error {
	border: 2px solid var(--sg-color-error);
}

/* Message global (erreur ou confirmation d'envoi). */
.et-pb-contact-message {
	font-weight: 600;
	line-height: 1.5;
}

.et-pb-contact-message p {
	color: inherit;
}

/* Liste des champs manquants. */
.et-pb-contact-message ul {
	margin-block: var(--sg-space-xs) 0;
	padding-inline-start: 1.2em;
}

/* Captcha Divi : champ court aligné. */
.et_pb_contact_captcha {
	max-width: 120px;
	text-align: center;
}

/* ---- Bouton d'envoi Divi --------------------------------------------- */
.et_pb_contact_submit,
.et_pb_newsletter_button {
	cursor: pointer;
}
