/* Page « Vous référencer » : formulaire Gravity Forms en blocs titrés
   (les blocs .ivg-bloc sont posés par ivg_ref_blocs(), inc/referencement.php). */

.ivg-referencer { max-width: 54rem; margin: 0 auto; padding: var(--ivg-marge-haut, 40px) 24px var(--ivg-marge-bas, 64px); }
.ivg-referencer > h1 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; color: var(--ivg-encre); }
.ivg-referencer > p { font-size: 15px; line-height: 1.6; color: var(--ivg-gris); margin: 0 0 32px; max-width: 44rem; }

/* Couleurs du site à la place du bleu de Gravity Forms (variables posées en ligne par GF). */
.ivg-referencer .gform-theme {
	--gf-color-primary: #4251A7 !important;
	--gf-color-primary-rgb: 66, 81, 167 !important;
	--gf-color-primary-darker: #313C7D !important;
	--gf-color-primary-lighter: #7083D9 !important;
	--gf-ctrl-border-color: #CDD1E0 !important;
	--gf-radius: 6px !important;
	--gf-ctrl-btn-padding-x: 32px !important;
	--gf-ctrl-btn-size: 50px !important;
	--gf-ctrl-btn-font-size: 16px !important;
}

/* Blocs */
.ivg-referencer .gform_fields { row-gap: 24px; }
.ivg-referencer .ivg-bloc {
	grid-column: 1 / -1;
	display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px 24px;
	background: var(--ivg-blanc); border: 1px solid var(--ivg-ligne); border-radius: var(--ivg-rayon);
	box-shadow: var(--ivg-ombre); padding: 28px 32px 32px;
}
.ivg-referencer .ivg-bloc > .gfield { grid-column: span 12; min-width: 0; }
.ivg-referencer .ivg-bloc > .gfield--width-three-quarter { grid-column: span 9; }
.ivg-referencer .ivg-bloc > .gfield--width-two-thirds { grid-column: span 8; }
.ivg-referencer .ivg-bloc > .gfield--width-half { grid-column: span 6; }
.ivg-referencer .ivg-bloc > .gfield--width-third { grid-column: span 4; }
.ivg-referencer .ivg-bloc > .gfield--width-quarter { grid-column: span 3; }

/* Titre de bloc */
.ivg-referencer .ivg-bloc > .gsection {
	grid-column: 1 / -1; margin: 0; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--ivg-ligne);
}
.ivg-referencer .gsection .gsection_title { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--ivg-bleu); }
.ivg-referencer .gsection .gsection_description { margin: 4px 0 0; font-size: 13px; color: var(--ivg-gris); }

/* Libellés et aides */
.ivg-referencer .gfield_label { font-weight: 600; color: var(--ivg-encre); }
.ivg-referencer .gfield_description { color: var(--ivg-gris); }

/* Cases et boutons radio en colonnes plutôt qu'en longue liste */
.ivg-referencer .gform-theme .gfield--type-choice .gfield_checkbox {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 20px;
}
.ivg-referencer .gform-theme .gfield--type-choice .gfield_radio { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px 28px; }
.ivg-referencer .gform-theme .gfield_radio .gchoice,
.ivg-referencer .gform-theme .gfield_checkbox .gchoice { margin: 0; }

/* Bouton d'envoi */
.ivg-referencer .gform_footer { margin-top: 28px; padding: 0; }
.ivg-referencer .gform-theme.gform_wrapper .gform_footer .gform_button {
	padding: 14px 32px; height: auto; font-size: 16px; font-weight: 600; border-radius: 6px;
}

@media (max-width: 640px) {
	.ivg-referencer { padding-left: 16px; padding-right: 16px; }
	.ivg-referencer > h1 { font-size: 24px; }
	.ivg-referencer .ivg-bloc { padding: 22px 18px 24px; gap: 20px; }
	.ivg-referencer .ivg-bloc > .gfield { grid-column: 1 / -1; }
	.ivg-referencer .gform-theme.gform_wrapper .gform_footer .gform_button { width: 100%; justify-content: center; }
}

/* Fil d'étapes collant sous l'en-tête (assets/js/referencement.js, qui ajuste `top`) */
.ivg-fil {
	position: sticky; top: var(--ivg-entete); z-index: 50;
	margin: 0 -24px 24px; padding: 12px 24px 0; background: var(--ivg-fond);
}
.ivg-fil ol { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ivg-fil a {
	display: flex; align-items: center; gap: 8px; padding: 6px 0 10px;
	font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--ivg-gris); text-decoration: none;
}
.ivg-fil a:hover { color: var(--ivg-bleu); }
.ivg-fil a:focus-visible { outline: 2px solid var(--ivg-bleu); outline-offset: 2px; border-radius: 4px; }
.ivg-fil b {
	flex-shrink: 0; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
	border: 2px solid var(--ivg-ligne); background: var(--ivg-blanc); font-size: 12px; color: var(--ivg-gris);
	transition: background .2s, border-color .2s, color .2s;
}
.ivg-fil a.fait { color: var(--ivg-encre); }
.ivg-fil a.fait b { border-color: var(--ivg-bleu-clair); background: #E8EBF8; color: var(--ivg-bleu); }
.ivg-fil a.actif { color: var(--ivg-bleu); }
.ivg-fil a.actif b { border-color: var(--ivg-bleu); background: var(--ivg-bleu); color: var(--ivg-blanc); }
.ivg-fil__jauge { height: 4px; border-radius: 2px; background: var(--ivg-ligne); overflow: hidden; }
.ivg-fil__jauge i { display: block; height: 100%; width: 0; background: var(--ivg-bleu); transition: width .15s linear; }
.ivg-referencer .ivg-bloc { scroll-margin-top: 64px; } /* en plus du scroll-padding-top du thème : passe sous le fil */

@media (max-width: 640px) {
	.ivg-fil { margin: 0 -16px 20px; padding: 10px 16px 0; }
	.ivg-fil ol { display: flex; gap: 6px; }
	.ivg-fil li:has(.actif) { flex: 1; min-width: 0; }
	.ivg-fil a span { display: none; }
	.ivg-fil a.actif span { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Choix (cases, boutons radio) en encadrés : chaque question se lit comme un tout */
.ivg-referencer .ivg-bloc > .gfield--type-choice {
	padding: 14px 16px 16px; border: 1px solid var(--ivg-ligne); border-radius: 8px; background: #F8F9FD;
}
/* Gravity Forms met ces questions dans un <fieldset> : sans float, la <legend> chevauche le bord. */
.ivg-referencer .ivg-bloc > .gfield--type-choice > legend.gfield_label { float: left; width: 100%; margin: 0 0 10px; padding: 0; }
.ivg-referencer .ivg-bloc > .gfield--type-choice > legend + * { clear: both; }

/* Aide à la saisie de l'adresse */
.ivg-referencer .ivg-adr-aide { margin-top: 6px; font-size: 13px; color: var(--ivg-gris); }
.ivg-referencer .ivg-adr-aide:empty { display: none; }
.ivg-referencer .ivg-adr-aide--erreur { color: #C02B0A; }
