/*
 * Gravity Forms, thème Orbital : les 9 formulaires de resc.fr sortis de leur module UABB (shortcode theme="orbital").
 * Décision de Marc (21/10/2026) : « il faut qu'on passe à Orbital, clairement, à la dernière version, et on adaptera ».
 * Les autres formulaires du site (PowerPack, codes courts) gardent le thème du site (gravity-theme) jusqu'en novembre :
 * le mu-plugin ne charge cette feuille que là où Gravity Forms a lui-même mis Orbital en file.
 *
 * Partie 1 = les variables du site (couleurs relevées le 21/10 sur les 9 modules UABB et le thème Beaver).
 * Partie 2 = les règles communes (reprises de libreneurs.com), qui ne lisent que ces variables.
 * Partie 3 = ce qui est propre à RESC : bouton sans capitales, comme les boutons du thème ; variantes par formulaire.
 *
 * Pourquoi les !important sur les variables : Gravity Forms écrit dans chaque page un bloc
 * #gform_wrapper_N[data-form-index].gform-theme { --gf-... } (sélecteur à identifiant) qui
 * reprend ses valeurs par défaut (bleu #204ce5, arrondi 3 px) et bat toute feuille de site.
 * Une variable marquée !important passe devant, quelle que soit la précision du sélecteur.
 */

/* ---------- Partie 1 : variables du site (marque RESC) ---------- */
body .gform-theme--framework {
	/* bleu des titres du site (#0296c7) : sélection, case cochée, champ actif, barre de progression */
	--gf-color-primary: #0296c7 !important;
	--gf-color-primary-rgb: 2, 150, 199 !important;
	--gf-color-primary-contrast: #ffffff !important;
	--gf-color-primary-contrast-rgb: 255, 255, 255 !important;
	--gf-color-primary-darker: #027aa3 !important;
	--gf-color-primary-lighter: #1fb0e0 !important;

	/* bouton d'envoi : vert d'accent du site, bleu au survol (réglages des modules UABB) */
	--lb-btn-bg: #62c99e !important;
	--lb-btn-bg-hover: #0296c7 !important;
	--lb-btn-color: #ffffff !important;

	/* textes et bordures (modules UABB : texte #363636, bordure #cccccc, active #bbbbbb, message d'erreur #ce0000) */
	--lb-texte: #363636 !important;
	--lb-texte-doux: #808080 !important;
	--lb-bordure: #cccccc !important;
	--lb-bordure-survol: #bbbbbb !important;
	--lb-piste: #efefef !important;
	--lb-erreur: #ce0000 !important;
	--lb-arrondi: 4px !important;
	--lb-arrondi-bouton: 4px !important;   /* btn_border_radius des modules UABB */
}

/* ---------- Partie 2 : règles communes ---------- */
body .gform-theme--framework {
	/* Gravity Forms copie le bleu dans la famille « in-ctrl-primary » : on la rebranche */
	--gf-color-in-ctrl-primary: var(--gf-color-primary) !important;
	--gf-color-in-ctrl-primary-rgb: var(--gf-color-primary-rgb) !important;
	--gf-color-in-ctrl-primary-contrast: var(--gf-color-primary-contrast) !important;
	--gf-color-in-ctrl-primary-contrast-rgb: var(--gf-color-primary-contrast-rgb) !important;
	--gf-color-in-ctrl-primary-darker: var(--gf-color-primary-darker) !important;
	--gf-color-in-ctrl-primary-lighter: var(--gf-color-primary-lighter) !important;

	--gf-color-danger: var(--lb-erreur) !important;
	--gf-color-danger-rgb: 206, 0, 0 !important;

	--gf-radius: var(--lb-arrondi) !important;
	--gf-form-gap-y: 28px !important;      /* espace entre deux questions */
	--gf-font-size-primary: 16px !important;          /* 16 px : iPhone ne zoome plus au toucher du champ */
	--gf-ctrl-size: 50px !important;
	--gf-ctrl-border-width: 1.5px !important;
	--gf-ctrl-border-color: var(--lb-bordure) !important;
	--gf-ctrl-border-color-hover: var(--lb-bordure-survol) !important;
	--gf-ctrl-border-color-focus: var(--gf-color-primary) !important;
	--gf-ctrl-outline-color-focus: rgba(var(--gf-color-primary-rgb), 0.22) !important;
	--gf-ctrl-shadow: none !important;
	--gf-ctrl-color: var(--lb-texte) !important;

	--gf-ctrl-label-color-primary: var(--lb-texte) !important;
	--gf-ctrl-label-font-size-primary: 15px !important;
	--gf-ctrl-label-font-weight-primary: 600 !important;
	--gf-ctrl-label-line-height-primary: 1.4 !important;
	--gf-ctrl-label-color-req: var(--lb-texte-doux) !important;
	--gf-ctrl-label-font-weight-req: 400 !important;
	--gf-ctrl-desc-color: var(--lb-texte-doux) !important;

	--gf-ctrl-btn-bg-color-primary: var(--lb-btn-bg) !important;
	--gf-ctrl-btn-bg-color-hover-primary: var(--lb-btn-bg-hover) !important;
	--gf-ctrl-btn-bg-color-focus-primary: var(--lb-btn-bg-hover) !important;
	--gf-ctrl-btn-border-color-primary: var(--lb-btn-bg) !important;
	--gf-ctrl-btn-border-color-hover-primary: var(--lb-btn-bg-hover) !important;
	--gf-ctrl-btn-border-color-focus-primary: var(--lb-btn-bg-hover) !important;
	--gf-ctrl-btn-color-primary: var(--lb-btn-color) !important;
	--gf-ctrl-btn-color-hover-primary: var(--lb-btn-color) !important;
	--gf-ctrl-btn-color-focus-primary: var(--lb-btn-color) !important;
	--gf-ctrl-btn-radius: var(--lb-arrondi-bouton) !important;
	--gf-ctrl-btn-font-weight: 700 !important;
	--gf-ctrl-btn-text-transform: uppercase !important;
	--gf-ctrl-btn-letter-spacing: 0.04em !important;
	--gf-ctrl-btn-size: 52px !important;
	--gf-ctrl-btn-padding-x: 28px !important;

	font-family: inherit;
}

/* la mention « (Nécessaire) » : discrète, plus d'alarme rouge */
body .gform-theme--framework .gfield_required {
	font-size: 12px;
	font-weight: 400;
}

/* aide sous le champ */
body .gform-theme--framework .gfield_description {
	font-size: 13px;
	line-height: 1.5;
}

/* barre de progression : couleur principale partout, quel que soit le réglage du formulaire */
body .gform-theme--framework .gf_progressbar {
	background: var(--lb-piste);
	border-radius: 999px;
}
body .gform-theme--framework .gf_progressbar_percentage {
	background: var(--gf-color-primary) !important;
	border-radius: 999px;
}
body .gform-theme--framework .gf_progressbar_title {
	color: var(--lb-texte-doux);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* choix en images : carte arrondie, carte choisie bordée de la couleur principale */
body .gform-theme--framework .gfield--type-image_choice .gchoice {
	border-radius: var(--lb-arrondi);
	border-color: var(--lb-bordure);
	transition: border-color .15s, box-shadow .15s;
}
body .gform-theme--framework .gfield--type-image_choice .gchoice:hover {
	border-color: var(--lb-bordure-survol);
}
body .gform-theme--framework .gfield--type-image_choice .gchoice:has(input:checked) {
	border-color: var(--gf-color-primary);
	box-shadow: 0 0 0 3px rgba(var(--gf-color-primary-rgb), 0.22);
}

/* bouton : pleine largeur sur téléphone. Sélecteur renforcé le 28/10/2026 : la 1re version (body .gform-theme--framework
   .gform_footer .gform_button) ne s'appliquait jamais, Orbital pose la largeur du bouton par une règle plus spécifique
   (.gform-theme.gform-theme--framework.gform_wrapper .button, --gf-local-width: auto). Boutons de 117 px sur 310 sur
   Demande praticien, Demande d'accès, Liste d'attente et l'Enquête besoins depuis le 21/10. */
@media (max-width: 640px) {
	body .gform-theme.gform-theme--framework.gform_wrapper .gform_footer .gform_button,
	body .gform-theme.gform-theme--framework.gform_wrapper .gform_page_footer .button {
		inline-size: 100%;
	}
	/* liste moyenne en pleine largeur sur téléphone, comme l'ancien thème (Etablissement 9 : « Formation choisie »
	   tronquée à 167 px sous Orbital). Les champs texte moyens, eux, restaient à la moitié : on n'y touche pas. */
	body .gform-theme--framework .gfield .ginput_container > select.medium {
		inline-size: 100%;
	}
}

/* ---------- Partie 3 : propre à RESC ---------- */
/* bouton comme ceux du thème Beaver du site (16 px, interligne 1.2, sans capitales) */
body .gform-theme--framework {
	--gf-ctrl-btn-font-weight: 400 !important;
	--gf-ctrl-btn-text-transform: none !important;
	--gf-ctrl-btn-letter-spacing: 0 !important;
	--gf-ctrl-btn-font-size: 16px !important;
}

/* titre de la barre de progression comme avant (« Étape 1 sur 5 – Informations générales ») : les capitales de la règle
   commune donnaient « ETAPE », accents illisibles à cette taille (essai de l'Enquête besoins, 21/10) */
body .gform-theme--framework .gf_progressbar_title {
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

/* variantes de bouton reprises des modules UABB : orange (#e88761, vert au survol) sur Correction Mémoires (83),
   bleu (vert au survol) sur l'Enquête besoins des praticiens (87) */
body #gform_wrapper_83.gform-theme--framework {
	--lb-btn-bg: #e88761 !important;
	--lb-btn-bg-hover: #62c99e !important;
}
body #gform_wrapper_87.gform-theme--framework {
	--lb-btn-bg: #0296c7 !important;
	--lb-btn-bg-hover: #62c99e !important;
}

/* bouton pleine largeur là où le module UABB l'était (btn_width=full) : congrès 2022 (24), établissement (71),
   pièces justificatives (7) ; et là où le module PowerPack l'était (28/10, button_width=true) : Réclamation (21),
   Attentes et Adaptations (16) */
body :is(#gform_wrapper_24, #gform_wrapper_71, #gform_wrapper_7, #gform_wrapper_21, #gform_wrapper_16).gform-theme--framework .gform_footer .gform_button {
	width: 100%;
}

/* champ de taille « moyenne » rangé dans une COLONNE PARTIELLE (demi, tiers...) : toute la largeur de sa colonne
   (28/10/2026, sortie de PowerPack). L'ancien thème le faisait (classes gf_left_half, gf_right_third...), Orbital le
   laisse à la moitié de sa colonne : Ville et Structure de Réclamation (21) à 167 px sur 350 au téléphone. Un champ
   moyen qui occupe TOUTE la ligne reste à la moitié, comme avant (Attentes et Adaptations 16, Etablissement 9, et les
   villes de 7 et 10 et « Vous travaillez en ? » de 6, validés ainsi le 21/10). Première version du même jour, sans la
   condition de colonne : elle élargissait ces champs pleine ligne, corrigée dans l'heure. Les dates (datepicker)
   gardent leur largeur. ⚠️ Une liste enrichie (Chosen) prend sa largeur au chargement : la mesurer avec la règle
   injectée AVANT les scripts, jamais après. */
body .gform-theme--framework .gfield[class*="gfield--width-"]:not(.gfield--width-full) .ginput_container > input.medium:not(.datepicker),
body .gform-theme--framework .gfield[class*="gfield--width-"]:not(.gfield--width-full) .ginput_container > select.medium,
body .gform-theme--framework .gfield[class*="gfield--width-"]:not(.gfield--width-full) .ginput_container > textarea.medium {
	inline-size: 100%;
}

/* WebKit (Safari, donc tout iPhone) : la liste d'origine que la recherche avancée (Tom Select, Populate Anything) masque
   garde la largeur de ses options et élargit la page (formulaire 83, leçon 20385 : 1 023 px au lieu de 399, 21/10/2026).
   Chromium ne la compte pas. Le formulaire porte novalidate et la liste aria-required seulement : la cacher ne bloque
   pas l'envoi. Limité aux formulaires passés en Orbital. */
.gform-theme--orbital select.ts-hidden-accessible {
	display: none !important;
}

/* Supervision en ligne (90, page de vente) : réglages du module PowerPack repris à l'identique (28/10/2026, mesurés
   avant/après : intitulés bleus #0296c7, bouton pleine largeur, capitales, gras 600, survol orange #e88761) */
body #gform_wrapper_90.gform-theme--framework {
	--lb-btn-bg-hover: #e88761 !important;
	--gf-ctrl-btn-text-transform: uppercase !important;
	--gf-ctrl-btn-font-weight: 600 !important;
}
body #gform_wrapper_90.gform-theme--framework .gfield_label,
body #gform_wrapper_90.gform-theme--framework .gform-field-label--type-sub {
	color: #0296c7;
}
body #gform_wrapper_90.gform-theme--framework .gform_footer .gform_button {
	width: 100%;
}

/* champ Liste sur téléphone : un cadre par ligne, barre grise « + − » dessous, comme l'ancien thème (28/10/2026, validé
   par Marc). Orbital empile les colonnes sans rien entre deux lignes : avec 3 élèves, on ne voit plus où l'un finit.
   Touche les champs Liste visibles en Orbital : Liste des élèves (79, DU-IFSI), Participants (9, Etablissement),
   Témoin(s) à indiquer (21, Réclamation). Le bureau (tableau en colonnes) n'est pas touché. ⚠️ Mesuré au pixel : sans
   margin-inline 0, Orbital laisse la ligne déborder de 6 px de chaque côté du champ (bordure droite coupée) ; la barre
   d'icônes prend la largeur de son contenu, d'où le calc pour qu'elle couvre le cadre de bord à bord. */
@media (max-width: 640px) {
	body .gform-theme--orbital .gfield--type-list .gfield_list_group {
		border: 1px solid #d9d9d9;
		border-radius: 4px;
		padding: 12px 12px 0;
		margin-block-end: 12px;
		margin-inline: 0 !important;
		overflow: hidden;
	}
	body .gform-theme--orbital .gfield--type-list .gfield_list_icons {
		justify-content: center;
		background: #eeeeee;
		margin: 12px -12px 0;
		inline-size: calc(100% + 24px) !important;
		padding: 8px 0;
	}
}
