/* ==========================================================================
   Design System Formulaires Seblod — UIkit 3 (jl-*) + Seblod + Chosen
   ud-form.css — CSS mutualis pour tous les formulaires front-office
   2025-03 — e-consultech
   ========================================================================== */

/* --- Layout global --- */
.ud-form {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
}

/* ==========================================================================
   SECTIONS (cards)
   ========================================================================== */
.ud-form-section {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 12px 15px;
	margin-bottom: 10px;
	overflow: visible;
}
.ud-form-section::after {
	content: "";
	display: table;
	clear: both;
}
.ud-form-section-title {
	margin: 0 0 10px;
	padding: 0 0 6px;
	border-bottom: 2px solid #f0f0f0;
	font-size: 15px;
	font-weight: 600;
	color: #333;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}
.ud-form-section-title::before {
	display: none;
}
.ud-form-section-title [jl-icon] {
	color: #999;
}

/* Sous-titres dans les sections */
.ud-form h5 {
	color: #333;
	font-size: 1rem;
	font-weight: 600;
	margin-top: 1.5rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #e5e5e5;
}
.ud-form h5:first-child {
	margin-top: 0;
}
.ud-form h6 {
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

/* ==========================================================================
   CHAMPS SEBLOD — reset & harmonisation (renderfield)
   ========================================================================== */

/* ==========================================================================
   RESET SEBLOD via classe d'enveloppe "ud-ff"
   Configuree dans le template Seblod : Classe d'enveloppe = ud-ff
   Variation de position = aucun
   Structure HTML generee :
     <div class="cck_forms ... ud-ff">
       <div class="cck_label ..."><label>...</label></div>
       <div class="cck_form cck_form_* ..."><input|select|textarea ...></div>
     </div>
   ========================================================================== */

/* Wrapper externe : block pleine largeur */
.ud-ff {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin-bottom: 8px;
}

/* Label */
.ud-ff .cck_label {
	width: 100%;
	float: none;
	line-height: 22px;
	margin-bottom: 4px;
}
.ud-ff .cck_label label {
	width: 100%;
	line-height: 22px;
	margin-left: 0;
	font-size: 13px;
	font-weight: 500;
	color: #555;
}
.ud-ff span.star,
.ud-form span.star {
	color: #fe0000;
}

/* Wrapper champ */
.ud-ff .cck_form {
	width: 100%;
	float: none;
	box-sizing: border-box;
	overflow: visible;
}
/* Clearfix : Seblod laisse parfois des floats non resolus */
.ud-ff::after {
	content: "";
	display: table;
	clear: both;
}

/* Elements de formulaire Seblod : cibles par .inputbox / .file / fieldset.radios
   (ne PAS cibler input[type="text"] generique — casse la barre WYSIWYG) */
.ud-ff input.inputbox,
.ud-ff input.text,
.ud-ff select.inputbox,
.ud-ff input.file {
	width: 100%;
	max-width: 100%;
	height: 38px;
	padding: 0 10px;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	font-size: 14px;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.ud-ff input.file {
	height: auto;
	padding: 6px 10px;
	background: #fafafa;
	border-style: dashed;
}
.ud-ff textarea.inputbox {
	width: 100%;
	max-width: 100%;
	height: auto;
	padding: 8px 10px;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	font-size: 14px;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.ud-ff input.inputbox:focus,
.ud-ff input.text:focus,
.ud-ff select.inputbox:focus,
.ud-ff textarea.inputbox:focus {
	border-color: #1e87f0;
	box-shadow: 0 0 0 3px rgba(30, 135, 240, 0.1);
	outline: none;
}

/* collection-group-form (Group X conteneur) */
.ud-ff div.collection-group-form {
	width: 100%;
}

/* ==========================================================================
   CHAMPS via ->label + ->form (classe .ud-field)
   ========================================================================== */
.ud-form .ud-field label,
.ud-form .ud-field-ajax > label,
.ud-form .ud-field .cck_label label {
	display: block;
	width: 100%;
	font-size: 13px;
	font-weight: 500;
	color: #555;
	line-height: 22px;
	margin: 0 0 4px;
}

/* Inputs bruts (hors wrapper cck_form_*) */
.ud-form .ud-field input[type="text"],
.ud-form .ud-field input[type="number"],
.ud-form .ud-field input[type="url"],
.ud-form .ud-field input[type="email"],
.ud-form .ud-field input[type="password"] {
	width: 100%;
	height: 38px;
	padding: 0 10px;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}
.ud-form .ud-field input[type="text"]:focus,
.ud-form .ud-field input[type="number"]:focus,
.ud-form .ud-field input[type="url"]:focus,
.ud-form .ud-field input[type="email"]:focus,
.ud-form .ud-field input[type="password"]:focus {
	border-color: #1e87f0;
	box-shadow: 0 0 0 3px rgba(30, 135, 240, 0.1);
	outline: none;
}
.ud-form .ud-field textarea {
	width: 100%;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	padding: 8px 10px;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}
.ud-form .ud-field textarea:focus {
	border-color: #1e87f0;
	box-shadow: 0 0 0 3px rgba(30, 135, 240, 0.1);
	outline: none;
}
.ud-form .ud-field select {
	width: 100%;
	height: 38px;
	padding: 0 10px;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	font-size: 14px;
	background: #fff;
	box-sizing: border-box;
}

/* ==========================================================================
   INPUTS SEBLOD (wrappers cck_form_*)
   ========================================================================== */

/* Texte, password, liens */
.ud-form div.cck_form_text,
.ud-form div.cck_form_password,
.ud-form div.cck_form_link,
.ud-form div.cck_form_link_link {
	width: 100% !important;
}
.ud-form .cck_form_text input[type="text"],
.ud-form .cck_form_link_link input[type="text"],
.ud-form .cck_form_password input[type="password"] {
	width: 100% !important;
	height: 38px;
	padding: 0 10px;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}
.ud-form .cck_form_text input[type="text"]:focus,
.ud-form .cck_form_link_link input[type="text"]:focus,
.ud-form .cck_form_password input[type="password"]:focus {
	border-color: #1e87f0;
	box-shadow: 0 0 0 3px rgba(30, 135, 240, 0.1);
	outline: none;
}

/* Select simples & dynamiques */
.ud-form div.cck_form_select_simple,
.ud-form div.cck_form_select_dynamic {
	width: 100% !important;
}
.ud-form .cck_form_select_simple select,
.ud-form .cck_form_select_dynamic select {
	width: 100%;
	height: 38px;
	padding: 0 10px;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	font-size: 14px;
	background: #fff;
	box-sizing: border-box;
}

/* Textarea Seblod */
.ud-form div.cck_form_textarea {
	width: 100% !important;
}
.ud-form .cck_form_textarea textarea {
	width: 100% !important;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	padding: 8px 10px;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}
.ud-form .cck_form_textarea textarea:focus {
	border-color: #1e87f0;
	box-shadow: 0 0 0 3px rgba(30, 135, 240, 0.1);
	outline: none;
}

/* Calendrier */
.ud-form div.cck_form_calendar {
	width: 100% !important;
}
.ud-form .cck_form_calendar.input-append input {
	border: 1px solid #e5e5e5 !important;
	height: 38px;
	border-radius: 3px;
}

/* ==========================================================================
   UPLOAD image / fichier
   ========================================================================== */
.ud-form div.cck_form_upload_image,
.ud-form div.cck_form_upload_file {
	width: 100% !important;
}
.ud-form .cck_form_upload_image span.hasTooltip,
.ud-form .cck_form_upload_file span.hasTooltip {
	display: inline-block;
	width: 100%;
	background-color: #fafafa;
	border: 1px dashed #ddd;
	border-radius: 3px;
	margin: 6px 0;
	padding: 6px 8px;
	box-sizing: border-box;
}
.ud-form .cck_form_upload_image span.hasTooltip::after,
.ud-form .cck_form_upload_file span.hasTooltip::after {
	content: " Supprimer ce fichier apres la sauvegarde.";
	font-size: 10px;
	color: #999;
	margin-left: 4px;
}
.ud-form .cck_form_upload_file input[type="text"] {
	width: 220px !important;
}

/* Apercu d'image upload */
.ud-form .cck_form_upload_image img {
	max-width: 120px;
	max-height: 120px;
	width: auto;
	height: auto;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #e5e5e5;
	margin-top: 0.5rem;
}

/* ==========================================================================
   SECTION CONDITIONNELLE (renderfield complet pour conditions Seblod)
   ========================================================================== */
.ud-form-fields--cond div.cck_form_select_simple,
.ud-form-fields--cond div.cck_form_select_dynamic,
.ud-form-fields--cond div.cck_form_text,
.ud-form-fields--cond div.cck_form_textarea,
.ud-form-fields--cond div.cck_form_checkbox {
	width: 100% !important;
}
.ud-form-fields--cond div.cck_label {
	width: 100% !important;
	margin-bottom: 4px;
}
.ud-form-fields--cond .cck_label label {
	font-size: 13px;
	font-weight: 500;
	color: #555;
	width: 100%;
	margin-left: 0;
}

/* ==========================================================================
   GROUP X (champs repetables)
   ========================================================================== */
.ud-form div.cck_form_group_x {
	width: 100% !important;
}
.ud-form .vertical_gx div.cck_form_group_x {
	border-bottom: 1px solid #e5e5e5;
	padding-top: 8px;
}
.ud-form div.collection-group-form {
	width: 100%;
}

/* ==========================================================================
   RADIOS & CHECKBOXES — pilules cliquables
   Seblod genere <fieldset class="radios"> / <fieldset class="checkboxes">
   ========================================================================== */
.ud-form fieldset.radios,
.ud-form fieldset.checkboxes {
	border: 0;
	margin: 0;
	padding: 0;
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
}
.ud-form fieldset.radios.vertical,
.ud-form fieldset.checkboxes.vertical {
	flex-direction: column;
	gap: 6px;
}
.ud-form fieldset.radios label,
.ud-form fieldset.checkboxes label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 4px;
	padding: 5px 10px;
	font-size: 13px;
	font-weight: 400;
	color: #444;
	background: #f8f8f8;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
}
.ud-form fieldset.radios label:hover,
.ud-form fieldset.checkboxes label:hover {
	background: #eef5ff;
	border-color: #c8ddf5;
}
/* Label actif (radio/checkbox coche) */
.ud-form fieldset.radios input[type="radio"]:checked + label,
.ud-form fieldset.checkboxes input[type="checkbox"]:checked + label {
	background: #e8f1fd;
	border-color: #1e87f0;
	color: #1e6fd0;
	font-weight: 500;
}
/* Masquer les inputs natifs — le label fait office de bouton */
.ud-form fieldset.radios input[type="radio"],
.ud-form fieldset.checkboxes input[type="checkbox"] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
/* Seblod multi-column divs */
.ud-form fieldset.radios .cck-fl,
.ud-form fieldset.checkboxes .cck-fl {
	display: inline-flex;
	align-items: center;
}

/* ==========================================================================
   SELECTS AJAX (Chosen)
   ========================================================================== */
.ud-form .ud-field-ajax {
	margin-bottom: 0;
	min-width: 0;
}
.ud-form .ud-field-ajax label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #555;
	margin-bottom: 4px;
}

/* Harmoniser Chosen avec le design */
.ud-form .ud-field-ajax select {
	width: 100% !important;
	max-width: 100%;
	box-sizing: border-box;
}
.ud-form .chzn-container {
	width: 100% !important;
	max-width: 100%;
	box-sizing: border-box;
}
.ud-form .chzn-container .chzn-choices {
	min-height: 38px;
	border: 1px solid #e5e5e5 !important;
	border-radius: 3px;
	background: #fff !important;
	padding: 3px 5px;
	box-shadow: none !important;
}
.ud-form .chzn-container .chzn-choices:focus-within,
.ud-form .chzn-container-active .chzn-choices {
	border-color: #1e87f0 !important;
}
.ud-form .chzn-container .chzn-choices li.search-choice {
	background: #f0f7ff;
	border: 1px solid #c8ddf5;
	border-radius: 3px;
	padding: 4px 20px 4px 8px;
	margin: 2px 4px 2px 0;
	font-size: 12px;
	color: #333;
}
.ud-form .chzn-container .chzn-choices li.search-choice .search-choice-close {
	top: 5px;
}
.ud-form .chzn-container .chzn-choices li.search-field input {
	height: 28px;
	font-size: 13px;
}
.ud-form .chzn-container .chzn-drop {
	border: 1px solid #e5e5e5;
	border-radius: 0 0 3px 3px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.ud-form .chzn-container .chzn-results li.highlighted {
	background: #1e87f0;
}

/* Chosen single select */
.ud-form .chzn-container-single .chzn-single {
	height: 38px;
	line-height: 36px;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	background: #fff;
	box-shadow: none;
	padding: 0 10px;
	font-size: 14px;
	color: #333;
}
.ud-form .chzn-container-single .chzn-single div b {
	background-position: 0 6px;
}
.ud-form .chzn-container-active.chzn-with-drop .chzn-single {
	border-color: #1e87f0;
}

/* Champ Seblod cache (synchro AJAX) — masquer le renderfield, garder le select AJAX visible */
.ud-form .ud-field-ajax > div[class^="cck_"],
.ud-form .ud-field-ajax > div[class*=" cck_"] {
	position: absolute;
	left: -9999px;
	height: 0;
	overflow: hidden;
}

/* ==========================================================================
   MULTISELECTS NATIFS (organisateurs, etc.)
   ========================================================================== */
.ud-form .ud-field-multiselect label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #555;
	margin-bottom: 4px;
}
.ud-form .ud-field-multiselect select.inputbox {
	width: 100% !important;
	min-height: 140px;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
	font-size: 13px;
	padding: 4px;
	background: #fff;
	box-sizing: border-box;
}
.ud-form .ud-field-multiselect select.inputbox:focus {
	border-color: #1e87f0;
	outline: none;
}
.ud-form .ud-field-multiselect select.inputbox optgroup {
	font-weight: 600;
	font-size: 12px;
	color: #1e6fd0;
	padding: 4px 0;
}
.ud-form .ud-field-multiselect select.inputbox option {
	font-weight: 400;
	font-size: 12px;
	color: #333;
	padding: 2px 6px;
}
.ud-form .ud-field-multiselect select.inputbox option:checked {
	background: #e8f1fd;
	color: #1e6fd0;
}

/* ==========================================================================
   ESPACEMENT ENTRE CHAMPS
   ========================================================================== */
.ud-form-fields > div {
	margin-bottom: 8px;
	max-width: 100%;
	overflow: visible;
}
.ud-form-fields > div:last-child {
	margin-bottom: 0;
}

/* Champs caches (synchro hidden) */
.ud-form-hidden {
	position: absolute;
	left: -9999px;
	height: 0;
	overflow: hidden;
}

/* ==========================================================================
   ALERTE INFO
   ========================================================================== */
.ud-form-info {
	background: #f0f7ff;
	border: 1px solid #c8ddf5;
	border-radius: 4px;
	padding: 8px 12px;
	margin-bottom: 10px;
	font-size: 13px;
	color: #1e6fd0;
	line-height: 1.5;
}

/* ==========================================================================
   AIDE CONTEXTUELLE (tooltips sous les champs)
   ========================================================================== */
.ud-form-help {
	font-size: 12px;
	color: #999;
	margin-top: 2px;
	line-height: 1.4;
}

/* ==========================================================================
   BARRE D'ACTIONS (boutons save/cancel)
   ========================================================================== */
.ud-form .barre_admin {
	margin-top: 15px;
	padding: 10px 0;
	text-align: right;
}
.ud-form .barre_admin.is-sticky {
	position: fixed;
	bottom: 20px;
	right: 30px;
	z-index: 100;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 10px 15px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.ud-form-buttons {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}
.ud-form .button-admin button,
.ud-form .button-admin input[type="submit"],
.ud-form .button-admin .btn {
	height: 38px;
	padding: 0 20px;
	border-radius: 3px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	border: 1px solid #e5e5e5;
	background: #f8f8f8;
	color: #333;
}
.ud-form .button-admin button:hover,
.ud-form .button-admin input[type="submit"]:hover,
.ud-form .button-admin .btn:hover {
	background: #1e87f0;
	border-color: #1e87f0;
	color: #fff;
}

/* Boutons Seblod (renderfield button_save / button_cancel)
   Cibler uniquement les boutons dans cck_form_button_* — pas les boutons WYSIWYG (.tox-tbtn) */
.ud-form div[class*="cck_button"] button,
.ud-form div[class*="cck_button"] input[type="submit"],
.ud-form .ud-form-buttons button,
.ud-form .ec-form-actions button {
	height: 38px;
	padding: 0 20px;
	border-radius: 3px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	border: 1px solid #e5e5e5;
	background: #f8f8f8;
	color: #333;
}
.ud-form div[class*="cck_button"] button:hover,
.ud-form div[class*="cck_button"] input[type="submit"]:hover,
.ud-form .ud-form-buttons button:hover,
.ud-form .ec-form-actions button:hover {
	background: #1e87f0;
	border-color: #1e87f0;
	color: #fff;
}
/* Bouton primaire (sauvegarde) */
.ud-form div[class*="cck_button"] button.validate,
.ud-form div[class*="cck_button"] input[type="submit"].validate {
	background: #1e87f0;
	border-color: #1e87f0;
	color: #fff;
}
.ud-form div[class*="cck_button"] button.validate:hover,
.ud-form div[class*="cck_button"] input[type="submit"].validate:hover {
	background: #0f6ecd;
	border-color: #0f6ecd;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 959px) {
	.ud-form-section {
		padding: 10px 12px;
	}
}
@media (max-width: 639px) {
	.ud-form-section {
		padding: 8px 10px;
		margin-bottom: 8px;
	}
	.ud-form-section-title {
		font-size: 13px;
		margin-bottom: 15px;
	}
	.ud-form .chzn-container .chzn-choices li.search-choice {
		font-size: 11px;
	}
	.ud-form .ud-field-multiselect select.inputbox {
		min-height: 120px;
	}
	.ud-form .barre_admin.is-sticky {
		right: 10px;
		bottom: 10px;
	}
}
