/* ==========================================================================
   Référer un animal — CSS dédié (Porto/Bootstrap friendly)
   ========================================================================== */

/* ===== 0) Accessibilité / utilitaires spécifiques ===== */

/* Honeypot : visible pour bots, hors écran pour humains */
.hp-wrap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Bandeau urgence compact si Porto n’applique pas assez d'espacement */
#urgent-alert { margin-top: .5rem; }

/* Utilitaire "gap" (sans dépendre des classes gap-* BS5) */
#file-list-preview .gap-2 { gap: .5rem; }

/* ===== 1) Zone de dépôt (dropzone) ===== */

.file-dropzone {
  position: relative;
  border: 2px dashed #ddd;            /* bordure légère par défaut */
  border-radius: .5rem;
  padding: 20px 20px;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
  transition: border-color .2s ease, background .2s ease;
}

.file-dropzone.is-dragover,
.file-dropzone.border-primary {       /* état hover/drag + accent */
  border-color: #0d6efd;
  background: #f0f6ff;
}

.file-dropzone p { margin: .25rem 0; }

/* Cache proprement l'input fichier (équivalent sr-only robuste) */
.file-dropzone input[type="file"].sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ===== 2) Liste des fichiers sélectionnés ===== */

/* Ligne de fichier : lisible, claire, robuste aux noms longs */
#file-list-preview .file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

#file-list-preview .file-name {
  font-size: 1.05rem;   /* proche du label "Téléverser des documents" */
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;   /* coupe proprement les noms très longs */
}

#file-list-preview .file-size {
  display: inline-block;
  padding: .15rem .5rem;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: .25rem;
  background: #f8f9fa;
  color: #6c757d;
  font-weight: 500;
}

/* Bouton supprimer : discret mais explicite, focus-visible accessible */
#file-list-preview .file-remove {
  border: 0;
  background: transparent;
  color: #dc3545;
  padding: 0;
  line-height: 1;
  opacity: .85;
  cursor: pointer;
}

#file-list-preview .file-remove:hover,
#file-list-preview .file-remove:focus {
  opacity: 1;
  text-decoration: none;
}

#file-list-preview .file-remove:focus-visible {
  outline: 2px solid rgba(220,53,69,.3);
  outline-offset: 2px;
}

/* ===== 3) Zone d’erreur fichiers ===== */

/* Utilise d-none/d-block côté JS ; ici on s’assure du rendu */
#file-upload-error {
  margin-top: .25rem;
}

/* Panneau d'erreurs flottant façon Porto */
#form-errors {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  z-index: 1100; /* au-dessus du contenu */
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  border-radius: .5rem;
  padding: 1rem 1.25rem;
}
.field-flash { animation: fieldFlash 1.2s ease-in-out 1; }
@keyframes fieldFlash {
  0%   { box-shadow:0 0 0 0 rgba(220,53,69,.6) }
  50%  { box-shadow:0 0 0 .25rem rgba(220,53,69,.35) }
  100% { box-shadow:0 0 0 0 rgba(220,53,69,.0) }
}

/* Liste à l’intérieur du panneau */
#form-errors ul {
  margin: .5rem 0 0;      /* tu peux garder cette marge si tu l’aimes bien */
  padding-left: 1.25rem;
}

#form-errors strong {
  display: block;
  margin-bottom: .35rem;
}


/* Mini-card de progression (Porto) */
#upload-overlay {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9999;
  display: none;              /* contrôlé en JS */
  pointer-events: none;       /* la card reste cliquable, pas le "fond" */
  background: transparent;    /* plus de voile blanc */
}

#upload-card {
  pointer-events: auto;       /* permet de cliquer sur le bouton fermer si un jour tu l’ajoutes */
}


/* Focus plus visible sur les champs de formulaire */
.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
  border-color: #0088cc; /* ou var(--color-primary) si tu as ça */
  box-shadow: 0 0 0 .15rem rgba(0, 136, 204, .25);
  outline: 0;
}
