* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

.container {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
}

.search-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-box h1 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    color: #2c3e50;
}

.search-box input {
    width: 100%;
    padding: 16px;
    border: 3px solid #3498db;
    border-radius: 8px;
    font-size: 18px;
    margin-bottom: 20px;
}

.search-box input:focus {
    outline: none;
    border-color: #2980b9;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.tag {
    background: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.tag:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.results {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    padding: 15px;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.result-item:hover {
    background: #3498db;
    color: white;
    transform: translateX(5px);
}

.result-item strong {
    display: block;
    font-size: 16px;
}

.result-item small {
    font-size: 13px;
    opacity: 0.8;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.popup-overlay.active {
    display: flex;
}

.popup {
    background: white;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.popup-header {
    background: #3498db;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h2 {
    font-size: 20px;
}

.popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.popup-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.alerte-flash {
    background: #ffe5e5;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 600;
}

.alerte-info {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 600;
}

.rubrique {
    margin-bottom: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    overflow: hidden;
}

.rubrique-header {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.2s;
}

.rubrique-header:hover {
    background: #e9ecef;
}

.rubrique-header h3 {
    font-size: 16px;
    color: #2c3e50;
    margin: 0;
}

.rubrique-toggle {
    font-size: 20px;
    font-weight: bold;
    color: #7f8c8d;
}

.rubrique-content {
    padding: 20px;
    display: none;
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.8;
    background: white;
}

.rubrique.active .rubrique-content {
    display: block;
}

.rubrique.active .rubrique-header {
    background: #3498db;
    color: white;
}

.rubrique.active .rubrique-header h3 {
    color: white;
}

.rubrique.active .rubrique-toggle {
    color: white;
}

.rubrique-content:empty:before {
    content: "Aucune consigne renseignée";
    color: #95a5a6;
    font-style: italic;
}

.flash {
    background: #fff3cd;
    border: 1px solid #ffecb5;
    border-left: 6px solid #f0ad4e;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.flash.hidden {
    display: none;
}

.flash-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.flash-message {
    white-space: pre-wrap;
    line-height: 1.4;
}

.flash-dates {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.75;
}

.btn-signalement {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d9534f;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    width: min(520px, 92vw);
    background: #fff;
    border-radius: 12px;
    padding: 14px;
}

.modal-title {
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-secondary,
.btn-primary {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.btn-primary {
    border-color: #0d6efd;
}

.btn-signalement {
    width: 100%;
    margin: 12px 0;
    padding: 10px;
    font-weight: 700;
    border: 1px solid #d9534f;
    background: #fff;
    border-radius: 8px;
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    padding: 14px;
    border-radius: 10px;
    width: 420px;
}

.btn-signalement {
    width: 100%;
    margin: 10px 0 14px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d9534f;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    width: min(520px, 92vw);
    background: #fff;
    border-radius: 12px;
    padding: 14px;
}

.modal-title {
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-secondary,
.btn-primary {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.btn-primary {
    border-color: #0d6efd;
}

/* =========================
   Bloc Charte + Règles clés (SECR)
   ========================= */
.charte-wrap{
  max-width: 900px;
  margin: 18px auto 8px auto;
  padding: 0 12px;
}

.charte-ocs, .regles-cles{
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.charte-ocs{
  margin-bottom: 10px;
}

.charte-ocs h2{
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.charte-ocs p{
  margin: 0;
  line-height: 1.4;
  color: #334155;
  font-size: 14px;
}

.btn-charte{
  display: inline-block;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.btn-charte:hover{
  background: #1d4ed8;
}

.regles-cles h3{
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.regles-cles ul{
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.45;
  font-size: 14px;
}

.regles-cles li{
  margin: 3px 0;
}

hr.separator{
  max-width: 900px;
  margin: 14px auto 18px auto;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* Règles clés (accordion natif) */
.regles-cles details {
    width: 100%;
}

.regles-cles summary {
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    list-style: none;
    outline: none;
}

.regles-cles summary::-webkit-details-marker {
    display: none;
}

.regles-cles summary:after {
    content: "▾";
    float: right;
    color: #334155;
}

.regles-cles details[open] summary:after {
    content: "▴";
}

.regles-cles ul {
    margin-top: 10px;
}

/* =========================
   Règles clés à retenir (mise en évidence)
   ========================= */
.regles-cles {
  background: #f3f4f6;        /* gris clair */
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 16px;
}

.regles-cles summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  color: #b91c1c;             /* rouge foncé */
  list-style: none;
  outline: none;
}

.regles-cles summary::-webkit-details-marker {
  display: none;
}

.regles-cles summary:after {
  content: "▾";
  float: right;
  color: #b91c1c;
}

.regles-cles details[open] summary:after {
  content: "▴";
}

.regles-cles ul {
  margin-top: 10px;
  padding-left: 18px;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
}

.regles-cles li {
  margin: 4px 0;
}

/* =========================
   Charte (page charte.html)
   ========================= */
.charte-page {
    max-width: 900px;
    margin: 22px auto;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    padding: 18px 18px;
}

.charte-page h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
    color: #0f172a;
}

.charte-page h2 {
    margin: 0 0 14px 0;
    font-size: 16px;
    font-weight: 600;
    color: #334155;
}

.charte-page h3 {
    margin: 18px 0 8px 0;
    font-size: 16px;
    color: #0f172a;
}

.charte-page p,
.charte-page li {
    color: #1f2937;
    font-size: 14px;
    line-height: 1.6;
}

.charte-page .key {
    font-weight: 800;
}

.charte-page .box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0;
}

.charte-page .proc {
    border-left: 4px solid #2563eb;
    padding-left: 12px;
    margin: 10px 0;
}

.charte-page .dont {
    border-left: 4px solid #b91c1c;
    padding-left: 12px;
    margin: 10px 0;
}

/* =========================
   Actions Charte
   ========================= */
.charte-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin: 10px 0 18px 0;
}

.btn-secondary{
  padding:8px 12px;
  border-radius:8px;
  background:#e5e7eb;
  color:#111827;
  text-decoration:none;
  font-weight:600;
  font-size:14px;
}

.btn-secondary:hover{
  background:#d1d5db;
}

.btn-danger{
  padding:8px 12px;
  border-radius:8px;
  background:#fee2e2;
  color:#991b1b;
  text-decoration:none;
  font-weight:700;
  font-size:14px;
  border:1px solid #fecaca;
}

.btn-danger:hover{
  background:#fecaca;
}

/* =========================
   Actions Charte (retour + signalement)
   ========================= */
.charte-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin: 10px 0 18px 0;
}

.btn-secondary{
  padding:8px 12px;
  border-radius:8px;
  background:#e5e7eb;
  color:#111827;
  text-decoration:none;
  font-weight:600;
  font-size:14px;
  border:1px solid #d1d5db;
}

.btn-secondary:hover{
  background:#d1d5db;
}

/* Assure le masquage du modal */
.hidden{ display:none !important; }

/* Si jamais popup-overlay/popup ne sont pas définis dans ce CSS,
   tu peux me le dire et je te donne le mini-style complet.
*/

/* =========================
   Modal générique (utilisé sur charte.html)
   ========================= */
.popup-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup{
  width: min(720px, calc(100% - 24px));
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 40px rgba(0,0,0,0.22);
  overflow: hidden;
}

.popup-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.popup-header h2{
  margin: 0;
  font-size: 16px;
}

.popup-close{
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.popup-body{
  padding: 14px;
}

.hidden{ display:none !important; }


/* =========================
   FIX: ne pas casser le popup FICHE (SECR)
   On annule les styles globaux si ajoutés précédemment
   ========================= */
#popup.popup-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;              /* le JS gère l’affichage */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#popup.popup-overlay.active{
  display: flex;
}
#popup .popup{
  width: min(900px, calc(100% - 24px));
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

/* =========================
   Modal CHARTE (scopé)
   ========================= */
.charte-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.charte-modal{
  width: min(720px, calc(100% - 24px));
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 40px rgba(0,0,0,0.22);
  overflow: hidden;
}

.charte-modal-overlay .popup-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.charte-modal-overlay .popup-header h2{
  margin: 0;
  font-size: 16px;
}

.charte-modal-overlay .popup-close{
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.charte-modal-overlay .popup-body{
  padding: 14px;
}

.hidden{ display:none !important; }

