/* Gravity Forms — surcharges du thème FTI */


.gform_wrapper {
	--primary-color: #3889ff;                 /* bleu FTI, aligné sur les modales FTImmo */
	--primary-color-hover: #085ab0;           /* survol : primaire assombri */
	--fti-focus: rgba(56, 137, 255, .18);     /* halo de focus clavier (rgb du primaire) */
	--fti-check-border: #9aa4b2;              /* filet des cases / radios au repos */
}

/* Gravity Forms fields */

.gform-field-label__text,
.gform-field-label,
.gfield-choice-input,
.gfield_select,
.gfield-choice-input,
.gfield_description,
.gform_button,
.gform_button_select_files,
.gform_required_legend,
.gsection_title,
.gform-datepicker,
.gform-datepicker-calendar,
.gform-datepicker-toggle,
.gform_drop_instructions,
.gfield_select,
.ginput_container input,
.ginput_container textarea {
	font-family: Aptos, Arial, Helvetica, sans-serif !important;
}

.gform-field-label__text,
.gform-field-label,
.gfield_select,
.gform-datepicker,
.gform_button,
.gform_button_select_files {
	font-size: 16px !important;
}

h3.gsection_title {
	font-size: 24px !important;
	font-weight: 700 !important;
	letter-spacing: -0.2px;
	margin-bottom: 0;
	margin-top: 30px;
}

.ginput_container input,
.ginput_container textarea {
	font-size: 16px !important;
}

.gfield_required_asterisk {
	color: var(--primary-color, #2c66e2) !important;
}

/* Drop zone */

.gform_drop_area::before {
	color: var(--primary-color, #2c66e2) !important;
}


/* Gravity Forms date picker */

.gform-datepicker-calendar .monthMessage {
	display: none !important;
}

input.gform-datepicker,
input.gform-datepicker::placeholder {
	font-size: 16px !important;
}
.gform-datepicker-calendar table.calendar td span,
.gform-datepicker-calendar select {
	font-size: 16px !important;
}

.gform-datepicker-calendar table.calendar td.dayMarked span {
	background-color: var(--primary-color, #2c66e2) !important;
	border-color: var(--primary-color, #2c66e2) !important;
}

/* Gravity Forms buttons */

button.gform_button, button.gform_button_select_files {
	border-color: var(--primary-color, #2c66e2) !important;
	background-color: #fff !important;
	color: var(--primary-color, #2c66e2) !important;
}

button:hover.gform_button, button:hover.gform_button_select_files {
	background-color: var(--primary-color-hover, #1e50c0) !important;
	color: #fff !important;
}

button[type="submit"].gform_button {
	background-color: var(--primary-color, #2c66e2) !important;
	color: #fff !important;
	margin-top: 30px !important;
}

button[type="submit"]:hover.gform_button {
	background-color: var(--primary-color-hover, #1e50c0) !important;
	color: #fff !important;
}


/* -------------------------------------------------------------------------- *
 * Champs de saisie — caractéristiques reprises de FTImmo.
 * Pleine largeur, sans bordure au repos, fond blanc. La bordure de focus est RÉSERVÉE dès le repos
 * (2px transparents) et rendue en box-sizing:border-box : elle apparaît donc à l'intérieur du champ,
 * sans décaler le contenu ni déborder (pas d'outline navigateur). Hauteur/rayon par palier :
 * 60/12 (desktop) → 50/10 (tablette ≤1024) → 40/8 (mobile ≤767). Cases, radios, fichiers et boutons
 * sont exclus ; la zone de texte multiligne garde une hauteur libre.
 * -------------------------------------------------------------------------- */

.gform_wrapper .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
.gform_wrapper .gfield select,
.gform_wrapper .gfield textarea {
	box-sizing: border-box !important;
	width: 100% !important;
	border: 2px solid transparent !important;
	border-radius: 12px !important;
	background-color: #fff !important;
	outline: none !important;
	box-shadow: none !important;
	/* Transition CIBLÉE : le thème GF pose `transition: all .15s`, ce qui empêche la bordure de focus
	   d'atteindre sa couleur (elle reste bloquée transparente). On la restreint aux propriétés animées. */
	transition: border-color .15s ease, background-color .15s ease !important;
}

/* Contrôles sur une ligne : hauteur fixe + centrage vertical (padding horizontal seul). */
.gform_wrapper .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="textarea"]),
.gform_wrapper .gfield select {
	height: 60px !important;
	padding: 0 16px !important;
}

/* Centrage vertical du libellé du select : line-height = hauteur intérieure (hauteur − 2×2px de bordure).
   Posée ici, AVANT les media queries, pour que celles-ci (50/40 → 46/36) l'emportent par palier ; sinon la
   valeur desktop, définie plus bas dans le fichier, gagnerait par ordre de source sur tablette/mobile. */
.gform_wrapper .gfield select {
	line-height: 56px !important;
}

/* Zone de texte : même habillage, hauteur libre avec plancher et padding vertical. */
.gform_wrapper .gfield textarea {
	min-height: 120px !important;
	padding: 14px 16px !important;
}

/* Focus : bordure primaire, à l'intérieur du champ (aucun outline débordant).
   NB : la règle de base ci-dessus tire une forte spécificité de ses six :not([type=…]) ; on reprend la
   même chaîne ici pour que le focus l'emporte (sinon la bordure transparente de base gagnerait). */
.gform_wrapper .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):focus,
.gform_wrapper .gfield select:focus,
.gform_wrapper .gfield textarea:focus {
	border-color: var(--primary-color, #2c66e2) !important;
	background-color: #fff !important;
	outline: none !important;
	box-shadow: none !important;
}

/* Autofill Chrome : masque le fond jaune, conserve le blanc et la couleur du texte. */
.gform_wrapper .gfield input:-webkit-autofill,
.gform_wrapper .gfield input:-webkit-autofill:hover,
.gform_wrapper .gfield input:-webkit-autofill:focus,
.gform_wrapper .gfield input:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 1000px #fff inset !important;
	box-shadow: 0 0 0 1000px #fff inset !important;
	-webkit-text-fill-color: #2c3338 !important;
	caret-color: #2c3338;
}

@media (max-width: 1024px) {
	.gform_wrapper .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
	.gform_wrapper .gfield select,
	.gform_wrapper .gfield textarea {
		border-radius: 10px !important;
	}
	.gform_wrapper .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="textarea"]),
	.gform_wrapper .gfield select {
		height: 50px !important;
	}
	/* Centrage vertical du libellé du select : line-height = hauteur intérieure (50 − 4). */
	.gform_wrapper .gfield select {
		line-height: 46px !important;
	}
	/* Grille des champs : resserre l'écart vertical (40px au bureau → trop aéré en tablette). */
	.gform_wrapper .gform_fields {
		--gf-form-gap-y: 24px;
		row-gap: 24px !important;
	}
}

@media (max-width: 767px) {
	.gform_wrapper .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
	.gform_wrapper .gfield select,
	.gform_wrapper .gfield textarea {
		border-radius: 8px !important;
	}
	.gform_wrapper .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="textarea"]),
	.gform_wrapper .gfield select {
		height: 40px !important;
	}
	/* Centrage vertical du libellé du select : line-height = hauteur intérieure (40 − 4). */
	.gform_wrapper .gfield select {
		line-height: 36px !important;
	}
	/* Grille des champs : écart vertical encore réduit en mobile. */
	.gform_wrapper .gform_fields {
		--gf-form-gap-y: 16px;
		row-gap: 16px !important;
	}
}

/* -------------------------------------------------------------------------- *
 * Dropdowns, cases, radios, submit — alignés sur les modales FTImmo.
 * GF ne rend pas les span/SVG des composants FTImmo : on habille donc les contrôles NATIFS en
 * appearance:none (case, radio, caret du select) pour retrouver le même rendu.
 * -------------------------------------------------------------------------- */

/* Dropdown : flèche native retirée, caret chevron maison (24×24, gris de libellé, à 10px du bord, comme
 * les selects des modales de recherche). Hauteur et fond viennent de la règle des champs ; on redresse
 * ici le rayon (5px, propre aux selects — les champs texte restent à 12/10/8), le centrage vertical du
 * libellé (line-height normale, aucun padding vertical) et on réserve la place du caret à droite. */
.gform_wrapper .gfield select {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	padding: 0 42px 0 16px !important;
	/* Centrage vertical du libellé : la line-height (= hauteur intérieure) est gérée plus haut et par palier
	 * dans les media queries, pour que tablette/mobile restent centrés. */
	border-radius: 5px !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23606775' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
	background-size: 24px 24px !important;
}

/* Champ date : selon la variante du sélecteur de date (input à icône, wrapper posé par le script), le
 * conteneur ou l'input peut être laissé à sa largeur de contenu et ne pas occuper toute la ligne. On fixe
 * le conteneur ET l'input (variante texte à icône comme variante native) à la pleine largeur ; flex:1 1 auto
 * couvre le cas où le conteneur devient une flexbox (le bouton d'ouverture voisin ne vole alors pas d'espace). */
.gform_wrapper .gfield--type-date .ginput_container_date {
	position: relative !important; /* ancre le bouton d'ouverture (positionné en absolu ci-dessous). */
	display: block !important;
	width: 100% !important;
}
.gform_wrapper .gfield--type-date .ginput_container_date input.datepicker,
.gform_wrapper .gfield--type-date .ginput_container_date input[type="date"] {
	width: 100% !important;
	max-width: 100% !important;
	padding-right: 44px !important; /* réserve la place du bouton d'ouverture, qui vient se poser dedans. */
}
/* Bouton d'ouverture du calendrier : sorti du flux (sinon il passe à la ligne sous l'input pleine largeur)
 * et calé à droite, centré verticalement, à l'intérieur du champ. */
.gform_wrapper .gfield--type-date .ginput_container_date .gform-datepicker-toggle {
	position: absolute !important;
	top: 50% !important;
	right: 12px !important;
	transform: translateY(-50%) !important;
	margin: 0 !important;
	z-index: 2;
}

/* Exception : la fenêtre du calendrier (gform-datepicker-calendar) embarque ses propres selects natifs
 * (mois / année). À 60px ils débordent de la fenêtre ; en natif ils créent une rupture de style.
 * On y applique donc une variante COMPACTE de notre dropdown : même habillage (appearance:none + chevron +
 * rayon 5px, hérités des règles de select ci-dessus), mais 25px de haut, pleine largeur de cellule et chevron réduit.
 * Le reste du calendrier (jours, navigation, tables mois/année) passe par les classes propres du moteur, que
 * nos sélecteurs ne visent pas. Spécificité (3 classes) + placement en aval pour l'emporter sur nos règles. */
.gform_wrapper .gfield .gform-datepicker-calendar select {
	height: 25px !important;
	line-height: 23px !important; /* 25 − 2×1px de bordure : centre le libellé. */
	display: inline-block !important;
	width: 100% !important; /* occupe toute la cellule mois/année → les deux selects font la même largeur. */
	padding: 0 26px 0 8px !important;
	border: 1px solid var(--fti-check-border, #9aa4b2) !important; /* filet visible sur le fond blanc du calendrier. */
	border-radius: 5px !important;
	font-size: 14px !important;
	background-size: 16px 16px !important;
	background-position: right 6px center !important;
}
/* Inputs natifs éventuels du calendrier : retour au rendu par défaut (nos réglages de champ ne s'y appliquent pas). */
.gform_wrapper .gfield .gform-datepicker-calendar input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]) {
	all: revert !important;
}
/* Flèches de navigation (mois / année) : leur cellule est positionnée en absolu par le moteur (top:17.5px),
 * ce qui les laisse au-dessus du select compact. On abaisse le top pour les aligner verticalement avec lui. */
.gform_wrapper .gfield .gform-datepicker-calendar td.nav.btn {
	top: 28px !important;
}

/* Case à cocher / bouton radio — variante FTImmo : 20px, rayon 6 (case) ou rond (radio), filet gris ;
 * au cochage, aplat primaire + indicateur blanc (SVG en fond).
 * L'indicateur (coche ou point) est porté par le fond de l'input lui-même : le thème du moteur de
 * formulaire dessine SA propre coche via ses pseudo-éléments ::before/::after, ce qui se superposait à la
 * nôtre. On neutralise donc ses pseudo-éléments (content:none) et on n'en génère aucun de notre côté. */
.gform_wrapper .gfield input[type="checkbox"],
.gform_wrapper .gfield input[type="radio"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	flex: 0 0 auto;
	width: 20px !important;
	height: 20px !important;
	margin: 0 8px 0 0 !important;
	border: 1.5px solid var(--fti-check-border, #9aa4b2) !important;
	background-color: #fff !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color .2s ease, border-color .2s ease !important;
}
.gform_wrapper .gfield input[type="checkbox"] { border-radius: 6px !important; }
.gform_wrapper .gfield input[type="radio"] { border-radius: 50% !important; }

/* Indicateur natif du thème du moteur de formulaire retiré (évite la double coche superposée). */
.gform_wrapper .gfield input[type="checkbox"]::before,
.gform_wrapper .gfield input[type="checkbox"]::after,
.gform_wrapper .gfield input[type="radio"]::before,
.gform_wrapper .gfield input[type="radio"]::after {
	content: none !important;
	display: none !important;
	background: none !important;
}

.gform_wrapper .gfield input[type="checkbox"]:hover,
.gform_wrapper .gfield input[type="radio"]:hover {
	border-color: var(--primary-color, #3889ff) !important;
}

.gform_wrapper .gfield input[type="checkbox"]:checked,
.gform_wrapper .gfield input[type="radio"]:checked {
	background-color: var(--primary-color, #3889ff) !important;
	border-color: var(--primary-color, #3889ff) !important;
}
.gform_wrapper .gfield input[type="checkbox"]:checked {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4 10-10'/%3E%3C/svg%3E") !important;
	background-size: 14px 14px !important;
}
.gform_wrapper .gfield input[type="radio"]:checked {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='6' fill='%23fff'/%3E%3C/svg%3E") !important;
	background-size: 20px 20px !important;
}

/* Focus clavier de la case / du radio : anneau INSÉRÉ (outline à l'intérieur du bord via offset négatif).
   Un halo externe (box-shadow spread) déborderait du champ, la case étant collée au bord gauche et
   insensible aux marges/padding (item de grille GF). L'anneau inséré ne sort jamais du contrôle. */
.gform_wrapper .gfield input[type="checkbox"]:focus-visible,
.gform_wrapper .gfield input[type="radio"]:focus-visible {
	box-shadow: none !important;
	outline: 2px solid var(--primary-color, #3889ff) !important;
	outline-offset: -2px !important;
}

/* Libellé de choix (case / radio) : le moteur ajoute une marge gauche de 12px en plus de la gouttière de
 * l'input ; on la retire pour resserrer l'écart libellé/contrôle. */
.gform_wrapper .gfield .gchoice label {
	margin-left: 0 !important;
}

/* Bouton d'envoi — pilule primaire FTImmo (.fti-btn--primary). */
.gform_wrapper button[type="submit"].gform_button,
.gform_wrapper input[type="submit"].gform_button {
	background-color: var(--primary-color, #3889ff) !important;
	color: #fff !important;
	border: 1px solid transparent !important;
	border-radius: 999px !important;
	padding: 14px 30px !important;
	font-size: var(--text-body-lg, 20px) !important; /* responsive : 20/18/16 (desktop/tablette/mobile) — voir media queries. */
	font-weight: 600 !important;
	line-height: 1.2 !important;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease !important;
}
.gform_wrapper button[type="submit"].gform_button:hover,
.gform_wrapper input[type="submit"].gform_button:hover {
	background-color: var(--brand-primary, #123347) !important;
	color: #fff !important;
}
.gform_wrapper button[type="submit"].gform_button:focus-visible,
.gform_wrapper input[type="submit"].gform_button:focus-visible {
	box-shadow: 0 0 0 3px var(--fti-focus, rgba(56, 137, 255, .18)) !important;
	outline: none !important;
}

/* Taille du bouton d'envoi, responsive, alignée sur le corps du thème : 20 → 18 → 16 px. */
@media (max-width: 1024px) {
	.gform_wrapper button[type="submit"].gform_button,
	.gform_wrapper input[type="submit"].gform_button {
		font-size: var(--text-body-md, 18px) !important;
	}
}
@media (max-width: 767px) {
	.gform_wrapper button[type="submit"].gform_button,
	.gform_wrapper input[type="submit"].gform_button {
		font-size: var(--text-body-sm, 16px) !important;
	}
}

/* Placeholders : même taille que la valeur saisie (16px), explicitement, pour input, textarea et select.
   opacity:1 pour éviter le gris trop pâle appliqué par défaut par certains navigateurs. Les préfixes
   navigateurs sont séparés : un sélecteur inconnu invaliderait toute la règle groupée. */
.gform_wrapper .gfield input::placeholder,
.gform_wrapper .gfield textarea::placeholder,
.gform_wrapper .gfield select::placeholder {
	font-size: 16px !important;
	opacity: 1;
}
.gform_wrapper .gfield input::-webkit-input-placeholder,
.gform_wrapper .gfield textarea::-webkit-input-placeholder {
	font-size: 16px !important;
	opacity: 1;
}
.gform_wrapper .gfield input::-moz-placeholder,
.gform_wrapper .gfield textarea::-moz-placeholder {
	font-size: 16px !important;
	opacity: 1;
}
