/* =============================================================================
   recherche-formation.css — permis-de-exploitation.com
   Samy 13/09/2026 : module « Rechercher sa formation » (recherche_formation.php), v2.
   Trois habillages du meme formulaire : .rf-carte (colonne de droite), .rf-bandeau (accueil),
   .rf-menu (bouton de la barre du menu ; plein ecran sur telephone). Style du site : cartes
   blanches 12 px, titre en capitales grises, rouge de marque. Prefixe rf- verifie libre.
   Les regles d'element nues de theme.css / bootstrap (label float + bordures, legend,
   fieldset, input) sont neutralisees sous .rf.
   ============================================================================= */
.rf, .rf *, .rf *::before, .rf *::after { box-sizing: border-box; float: none; }
.rf { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #111827; text-align: left; line-height: 1.4; }
.rf .rf-masque { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rf .rf-titre { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7A8496; margin: 0 0 12px; padding: 0; }
.rf .rf-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }

/* Libelles (theme.css : label{float:left;font-weight:bold;border…}) */
.rf label, .rf legend { float: none; width: auto; margin: 0; padding: 0; border: 0; background: none; text-decoration: none; }
.rf label:hover { text-decoration: none; }
.rf .rf-libelle { display: block; margin: 0 0 5px; font-size: 12px; font-weight: 600; line-height: 1.3; color: #4B5566; }

/* Champ ville */
.rf .rf-champ { position: relative; margin: 0; padding: 0; }
.rf .rf-saisie { position: relative; display: block; }
.rf .rf-pin { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #e62117; pointer-events: none; }
.rf input[type="text"] { display: block; width: 100%; height: 46px; margin: 0; padding: 0 40px 0 38px; font: inherit; font-size: 16px; color: #111827; background: #fff; border: 1px solid #DDE1E8; border-radius: 10px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); outline: 0; -webkit-appearance: none; appearance: none; transition: border-color .15s ease, box-shadow .15s ease; }
.rf input[type="text"]::placeholder { color: #9AA3B2; }
.rf input[type="text"]:focus { border-color: #e62117; box-shadow: 0 0 0 3px rgba(230, 33, 23, .12); }
.rf input[type="text"].rf-erreur { border-color: #e62117; }
.rf .rf-effacer { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; margin: 0; border: 0; border-radius: 8px; background: transparent; color: #7A8496; cursor: pointer; }
.rf .rf-effacer:hover { background: #F3F4F7; color: #111827; }
.rf .rf-effacer[hidden], .rf .rf-charge[hidden] { display: none; }
.rf .rf-charge { position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 2px solid #E3E6EC; border-top-color: #e62117; border-radius: 50%; animation: rf-tourne .7s linear infinite; }
@keyframes rf-tourne { to { transform: rotate(360deg); } }
.rf .rf-aide { margin: 5px 0 0; font-size: 12.5px; line-height: 1.35; color: #c81b12; }
.rf .rf-aide:empty { display: none; }

/* Suggestions */
.rf .rf-suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; margin: 4px 0 0; padding: 5px; list-style: none; background: #fff; border: 1px solid #E8EAF0; border-radius: 12px; box-shadow: 0 14px 34px rgba(17, 24, 39, .16); max-height: min(360px, 55vh); overflow-y: auto; overscroll-behavior: contain; }
.rf .rf-suggestions[hidden] { display: none; }
.rf .rf-suggestions li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nom centre" "info centre"; align-items: center; column-gap: 8px; margin: 0; padding: 8px 10px; list-style: none; border: 0; border-radius: 8px; cursor: pointer; min-height: 44px; }
.rf .rf-suggestions li[aria-selected="true"], .rf .rf-suggestions li[role="option"]:hover { background: #FDF0EE; }
.rf .rf-s-nom { grid-area: nom; font-size: 15px; font-weight: 600; color: #111827; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf .rf-s-nom mark { background: none; color: #c81b12; padding: 0; }
.rf .rf-s-info { grid-area: info; font-size: 12px; color: #7A8496; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf .rf-s-centre { grid-area: centre; font-size: 11px; font-weight: 700; color: #0F7B4B; background: #E8F5EE; border-radius: 999px; padding: 3px 8px; }
.rf .rf-suggestions li.rf-s-titre { display: block; min-height: 0; padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9AA3B2; cursor: default; background: none; }

/* Formations en pastilles (bootstrap : fieldset/legend) */
.rf .rf-formations { margin: 0; padding: 0; border: 0; min-width: 0; }
.rf legend.rf-libelle { font-size: 12px; margin-bottom: 5px; border: 0; color: #4B5566; font-weight: 600; line-height: 1.3; }
.rf .rf-puces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rf label.rf-puce { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 6px 10px; margin: 0; background: #fff; border: 1px solid #DDE1E8; border-radius: 10px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.rf label.rf-puce:hover { border-color: #C3C9D4; }
.rf .rf-puce input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.rf .rf-puce-nom { font-size: 14px; font-weight: 700; line-height: 1.2; color: #111827; }
.rf .rf-puce-duree { font-size: 12px; font-weight: 500; line-height: 1.2; color: #7A8496; }
.rf label.rf-puce:has(input:checked) { border-color: #e62117; background: #FDF0EE; box-shadow: inset 0 0 0 1px #e62117; }
.rf label.rf-puce:has(input:checked) .rf-puce-nom, .rf label.rf-puce:has(input:checked) .rf-puce-duree { color: #c81b12; }
.rf label.rf-puce:has(input:focus-visible) { outline: 2px solid #111827; outline-offset: 2px; }

/* Bouton */
.rf .rf-bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; margin: 0; padding: 0 18px; font: inherit; font-size: 15px; font-weight: 700; color: #fff; background: #e62117; border: 0; border-radius: 10px; box-shadow: 0 4px 12px rgba(230, 33, 23, .22); cursor: pointer; transition: background .15s ease; }
.rf .rf-bouton:hover { background: #c81b12; }
.rf .rf-bouton:focus-visible { outline: 2px solid #111827; outline-offset: 2px; }

/* ---- Carte (colonne de droite) ---- */
.rf-carte { background: #fff; border: 1px solid #E8EAF0; border-radius: 12px; box-shadow: 0 1px 2px rgba(17, 24, 39, .05); padding: 18px 18px; margin: 0 0 14px; }

/* ---- Bandeau (accueil) : ville + bouton sur une ligne, formations dessous ---- */
.rf-bandeau { clear: both; background: #fff; border: 1px solid #E8EAF0; border-radius: 14px; box-shadow: 0 1px 2px rgba(17, 24, 39, .05); padding: 18px 20px; margin: 14px 0 6px; }
.rf-bandeau .rf-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ville bouton" "formations formations"; column-gap: 10px; row-gap: 12px; align-items: end; }
.rf-bandeau .rf-champ-ville { grid-area: ville; }
.rf-bandeau .rf-formations { grid-area: formations; }
.rf-bandeau .rf-bouton { grid-area: bouton; width: auto; height: 46px; }
.rf-bandeau .rf-puces { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rf-bandeau .rf-aide { position: absolute; }

/* ---- Barre du menu ---- */
.rf-nav { list-style: none; }
.rf-menu { position: relative; display: inline-block; }
.rf-menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s ease; -webkit-tap-highlight-color: transparent; }
.rf-menu > summary::-webkit-details-marker { display: none; }
.rf-menu > summary:hover, .rf-menu[open] > summary { background: rgba(255, 255, 255, .28); }
.rf-menu > summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rf-menu > summary svg { width: 20px; height: 20px; }
.rf-menu .rf-panneau { position: absolute; right: 0; top: calc(100% + 12px); z-index: 1000; width: 380px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid #E8EAF0; border-radius: 14px; box-shadow: 0 18px 44px rgba(17, 24, 39, .20); padding: 16px 18px 18px; color: #111827; }
.rf-menu .rf-panneau-tete { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.rf-menu .rf-panneau-tete .rf-titre { margin: 0; }
.rf-menu .rf-fermer { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; margin: -6px -8px -6px 0; border: 0; border-radius: 10px; background: transparent; color: #4B5566; cursor: pointer; }
.rf-menu .rf-fermer:hover { background: #F3F4F7; }

/* Ordinateur : pastille loupe a droite de la barre (la barre est pleine), libelle lu par les lecteurs d'ecran. */
@media (min-width: 768px) {
	.navbar-inverse .rf-nav { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); margin: 0; z-index: 5; }
	.navbar-inverse .rf-menu > summary { width: 40px; padding: 0; gap: 0; }
	.navbar-inverse .rf-menu-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Tablette et telephone */
@media (max-width: 991px) {
	.rf-bandeau .rf-puces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.rf-bandeau { padding: 16px; }
	.rf-bandeau .rf-form { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ville" "formations" "bouton"; }
	.rf-bandeau .rf-bouton { width: 100%; }
	.rf-bandeau .rf-aide { position: static; }
	/* Bouton « Rechercher » toujours visible a cote du bouton menu (dans .navbar-header). */
	.navbar-inverse .navbar-header:has(.rf-nav) { display: flex; align-items: center; justify-content: flex-end; }
	.navbar-inverse .navbar-header:has(.rf-nav) .navbar-toggle { order: 2; float: none; }
	.navbar-header .rf-nav { order: 1; float: right; margin: 8px 10px 8px 0; }
	.rf-menu > summary { height: 36px; padding: 0 12px; font-size: 14px; background: rgba(255, 255, 255, .18); }
	/* Panneau plein ecran : clavier, suggestions et bouton tiennent dans l'ecran. */
	.rf-menu .rf-panneau { position: fixed; inset: 0; width: auto; max-width: none; height: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 0 16px 24px; overflow-y: auto; z-index: 2147483000; }
	.rf-menu .rf-panneau-tete { position: sticky; top: 0; background: #fff; padding: 12px 0 10px; margin: 0 0 12px; z-index: 2; border-bottom: 1px solid #EEF0F4; }
	.rf-menu .rf-panneau-tete .rf-titre { font-size: 13px; }
	.rf-menu .rf-fermer { display: inline-flex; }
	.rf-menu .rf-suggestions { position: static; margin: 6px 0 0; box-shadow: none; max-height: none; }
	.rf-carte .rf-suggestions { max-height: 45vh; }
	html.rf-plein-ecran, html.rf-plein-ecran body { overflow: hidden; }
	html.rf-plein-ecran .agJsWidget { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { .rf .rf-charge { animation-duration: 2s; } }
