/* BOUTON FIXE ALERTE */
#alerte_bouton_fixe {
	position: fixed;
	bottom: 90px;
	right: 0;
	z-index: 150;
}

#alerte_bouton_fixe a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--cg_orange);
	color: #fff;
	text-decoration: none;
	padding: 14px 20px;
	font-size: 0.85em;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	border-radius: 2em 0 0 2em;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
	transition: background 0.3s, padding 0.35s ease, border-radius 0.35s ease;
}

#alerte_bouton_fixe a:hover {
	background: #000;
}

#alerte_bouton_icone {
	width: 33px;
	height: 33px;
	flex-shrink: 0;
	transform-origin: top center;
	animation: alerte_cloche_balance 2.5s ease-in-out infinite;
}

@keyframes alerte_cloche_balance {
	0%, 60%, 100% { transform: rotate(0deg); }
	10% { transform: rotate(-12deg); }
	20% { transform: rotate(10deg); }
	30% { transform: rotate(-8deg); }
	40% { transform: rotate(6deg); }
	50% { transform: rotate(-3deg); }
}

#alerte_bouton_texte {
	display: inline-block;
	max-width: 200px;
	white-space: nowrap;
	overflow: hidden;
	opacity: 1;
	transition: max-width 0.35s ease, opacity 0.25s ease;
}

/* Etat réduit (cf. public-alerte.js) : ne conserve que le pictogramme, pour occuper moins de place.
   Arrondi conservé uniquement à gauche (côté visible), le bouton restant collé au bord droit de l'écran. */
#alerte_bouton_fixe.reduit a {
	padding: 14px;
	gap: 0;
	justify-content: center;
}

#alerte_bouton_fixe.reduit #alerte_bouton_texte {
	max-width: 0;
	opacity: 0;
}

/* OVERLAY + POPUP */
#alerte_popup_overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.65);
	z-index: 500;
	overflow-y: auto;
	padding: 40px 15px;
}

#alerte_popup_overlay.actif {
	display: block;
}

#alerte_popup {
	position: relative;
	background: #fff;
	max-width: 480px;
	width: 100%;
	margin: 0 auto;
	border-radius: 0.3em;
	padding: 30px 25px;
	box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

#alerte_popup_fermer {
	position: absolute;
	top: 8px;
	right: 10px;
	background: none;
	border: none;
	font-size: 1.8em;
	line-height: 1;
	color: #999;
	cursor: pointer;
	padding: 5px 10px;
	transition: color 0.3s;
}

#alerte_popup_fermer:hover {
	color: var(--cg_orange);
}

#alerte_popup_icone {
	display: block;
	max-width: 70px;
	height: auto;
	margin: 0 auto 12px;
}

#alerte_popup_titre {
	margin: 0 0 8px 0;
	font-size: 1.3em;
	color: var(--cg_rose);
	text-align: center;
}

#alerte_popup_soustitre {
	margin: 0 0 20px 0;
	font-size: 0.9em;
	color: #666;
	text-align: center;
}

.alerte_champ {
	margin-bottom: 14px;
}

.alerte_champ_50 {
	display: flex;
	gap: 10px;
}

.alerte_champ_50 .alerte_champ {
	flex: 1;
	min-width: 0;
}

.alerte_champ_titre {
	font-size: 0.85em;
	margin-bottom: 4px;
	color: #333;
}

.alerte_champ_valeur input[type="text"],
.alerte_champ_valeur select {
	width: 100%;
	padding: 8px;
	border: 1px solid #CCC;
	box-sizing: border-box;
	font-size: 0.95em;
}

.alerte_mode_choix {
	display: flex;
	gap: 10px;
}

.alerte_mode_option {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 10px 14px 10px 14px;
	border: 1px solid #ccc;
	border-radius: 8px;
	font-size: 0.9em;
	color: #333;
	cursor: pointer;
	transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

/* radio natif conservé pour l'accessibilité clavier/lecteur d'écran, mais visuellement masqué */
.alerte_mode_option input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.alerte_mode_option::before {
	content: "✓";
	position: absolute;
	left: 12px;
	font-weight: bold;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.alerte_mode_option:hover {
	border-color: var(--cg_orange);
	color: var(--cg_orange);
}

.alerte_mode_option.selectionne {
	background: var(--cg_orange);
	border-color: var(--cg_orange);
	color: #fff;
}

.alerte_mode_option.selectionne::before {
	opacity: 1;
}

.alerte_mode_option:has(input:focus-visible) {
	outline: 2px solid var(--cg_orange);
	outline-offset: 2px;
}

.alerte_champ .obligatoire {
	color: var(--cg_orange);
	margin-left: 2px;
}

#alerte_popup_message:empty {
	display: none;
}

#alerte_popup_message {
	margin-bottom: 14px;
}

#alerte_popup_message .erreur_info {
	background: #FFB4B4;
	border-top: 1px solid #CC0000;
	border-bottom: 1px solid #CC0000;
	color: #CC0000;
	padding: 10px;
	font-size: 0.85em;
}

#alerte_popup_message .succes_info {
	background: #d9f2d9;
	border-top: 1px solid #2e7d32;
	border-bottom: 1px solid #2e7d32;
	color: #2e7d32;
	padding: 10px;
	font-size: 0.85em;
}

.alerte_champ .bouton_envoyer {
	width: 100%;
	border-radius: 0.2em;
	background: var(--cg_orange);
	transition: background 0.3s;
	font-size: 1em;
	padding: 14px 0;
	text-transform: uppercase;
	border: 0;
	color: #fff;
	cursor: pointer;
}

.alerte_champ .bouton_envoyer:hover {
	background: #000;
}

#alerte_popup .info_rgpd {
	font-size: 0.75em;
	color: #888;
	margin-top: 15px;
}

#alerte_popup .info_rgpd p {
	margin: 0;
}

/* Select2 : résumé texte sur une seule ligne (texte injecté par public-alerte.js) et pastilles
   masquées, cf. la copie de traitement dans template/css/public-search-bien.css. Dupliqué ici
   (scopé à #alerte_popup) car la popup d'alerte est chargée sur des pages qui ne chargent pas ce
   fichier (ex. public-contenu.php, public-contact.php, mentions légales). */
#alerte_popup .select2-container--default .select2-selection--multiple {
	border: 1px solid #ccc !important;
	border-radius: 6px !important;
	padding-bottom: 0 !important;
	overflow: hidden;
	display: flex;
	align-items: center;
	font-size: 0.9em;
}

#alerte_popup .select2-container .select2-selection--multiple {
	padding-top: 8px !important;
	min-height: 40px !important;
}

#alerte_popup .select2-container--default .select2-selection--multiple .select2-selection__rendered {
	display: block !important;
	width: 100%;
	padding-right: 25px;
	padding-left: 10px !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#alerte_popup .select2-selection__rendered li:not(:first-child) {
	display: none;
}

#alerte_popup .select2-container--default .select2-selection--multiple .select2-selection__choice {
	display: none !important;
}

/* Recherche "inline" par défaut de select2 (intégrée à la zone de sélection, au milieu des
   pastilles) : toujours masquée, elle perturberait la présentation en résumé sur une ligne
   ci-dessus. La recherche utilisée est celle du menu déroulant (cf. dropdownAdapter dans
   public-alerte.js), positionnée au-dessus des résultats, stylée juste en dessous. */
#alerte_popup .select2-search.select2-search--inline {
	display: none !important;
}

#alerte_popup .select2-search--dropdown {
	padding: 8px;
}

#alerte_popup .select2-search--dropdown .select2-search__field {
	width: 100%;
	box-sizing: border-box;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9em;
}

#alerte_popup .select2-search--dropdown .select2-search__field:focus {
	outline: none;
	border-color: var(--cg_orange);
}

#alerte_popup .select2-container--default .select2-results__option--selected {
	position: relative;
	padding-left: 20px !important;
	background-color: var(--cg_orange) !important;
	color: #FFF !important;
}

#alerte_popup .select2-results__option--selectable:hover,
#alerte_popup .select2-container--default .select2-results__option--selected:hover {
	background-color: #000;
}

#alerte_popup .select2-container--default .select2-results__option--selected::after {
	content: "✓";
	position: absolute;
	left: 6px;
	top: 50%;
	transform: translateY(-55%);
	color: #fff;
	font-size: 11px;
	font-weight: bold;
}

/* Liste déroulante ouverte : dropdownParent est #alerte_popup (cf. public-alerte.js), donc bien
   scopée ici. */
#alerte_popup .select2-dropdown {
	position: relative !important;
	min-width: 300px !important;
	border: 1px solid var(--cg_orange) !important;
	border-radius: 8px !important;
	overflow: hidden;
}

#alerte_popup .select2-container--open .select2-dropdown--above {
	bottom: 20px !important;
	border-bottom: 1px solid var(--cg_orange) !important;
	border-bottom-left-radius: 8px !important;
	border-bottom-right-radius: 8px !important;
}

#alerte_popup .select2-container--open .select2-dropdown--below {
	top: 5px !important;
	border-top: 1px solid var(--cg_orange) !important;
	border-top-left-radius: 8px !important;
	border-top-right-radius: 8px !important;
}

/* Responsive */
@media (max-width: 600px) {
	#alerte_popup {
		padding: 25px 18px;
	}

	#alerte_bouton_fixe {
		bottom: 70px;
	}

	#alerte_bouton_fixe a {
		font-size: 0.7em;
		padding: 10px 14px;
	}

	#alerte_bouton_fixe.reduit a {
		padding: 10px;
	}
}
@media (max-width: 320px) {
	.alerte_champ_50 {
		flex-direction: column;
		gap: 0;
	}
}
