/* ===== Messages (flash) du site, refonte SEPQ-32 : même présentation que les formulaires admin modernisés (.frm-alerte,
   public/style/formulairesAdmin.css) : fond clair, bordure, coins arrondis, icône, texte en gras.
   Icônes en SVG intégré (pas de dépendance à Font Awesome).
   S'applique aux messages Bootstrap existants (.alert-success, .alert-danger, .alert-warning, .alert-info), sans toucher
   aux templates. Chargé par les mises en page (baseAdmin, base, modelClub, modelSeniors). ===== */

.alert.alert-success,
.alert.alert-danger,
.alert.alert-warning,
.alert.alert-info {
  align-items: center;
  border-radius: 12px;
  border-style: solid;
  border-width: 1px;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 10px;
  line-height: 1.4;
  margin: 0 auto 18px;
  max-width: 1040px;
  padding: 12px 14px;
  text-align: left;
}

/* Icône devant le message : SVG intégré (Font Awesome n'est pas chargé sur toutes les pages), couleur du texte */
.alert.alert-success::before,
.alert.alert-danger::before,
.alert.alert-warning::before,
.alert.alert-info::before {
  background: currentColor;
  content: "";
  flex: 0 0 18px;
  height: 18px;
  -webkit-mask: var(--alerte-icone) center / contain no-repeat;
  mask: var(--alerte-icone) center / contain no-repeat;
  width: 18px;
}

.alert.alert-success {
  background: #ecfdf3;
  border-color: #b7ebc9;
  color: #067647;
}
.alert.alert-success {
  --alerte-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E"); /* circle-check */
}

.alert.alert-danger {
  background: #fdecec;
  border-color: #f6c5c5;
  color: #b42318;
}
.alert.alert-danger {
  --alerte-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-2h2zm0-4h-2V7h2z'/%3E%3C/svg%3E"); /* circle-exclamation */
}

.alert.alert-warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.alert.alert-warning {
  --alerte-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z'/%3E%3C/svg%3E"); /* triangle-exclamation */
}

.alert.alert-info {
  background: #eef4fb;
  border-color: #dce7f5;
  color: #1e5fa8;
}
.alert.alert-info {
  --alerte-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2zm0-8h-2V7h2z'/%3E%3C/svg%3E"); /* circle-info */
}

/* Beaucoup de pages entourent leurs messages de <br> : on les masque, l'espacement vient de la marge du message.
   Évite les sauts de ligne entre deux messages et le grand vide laissé quand le message disparaît (5 s). */
.alert.alert-success + br,
.alert.alert-danger + br,
.alert.alert-warning + br,
.alert.alert-info + br,
br:has(+ .alert.alert-success),
br:has(+ .alert.alert-danger),
br:has(+ .alert.alert-warning),
br:has(+ .alert.alert-info) {
  display: none;
}

/* ===== Thème sombre (SEPQ-36) : voile coloré sur fond sombre, texte clair de la même couleur ===== */
[data-theme="dark"] .alert.alert-success {
  background: rgba(22, 163, 74, .16);
  border-color: rgba(22, 163, 74, .4);
  color: #4ade80;
}
[data-theme="dark"] .alert.alert-danger {
  background: rgba(220, 38, 38, .16);
  border-color: rgba(220, 38, 38, .4);
  color: #fca5a5;
}
[data-theme="dark"] .alert.alert-warning {
  background: rgba(245, 158, 11, .16);
  border-color: rgba(245, 158, 11, .4);
  color: #fcd34d;
}
[data-theme="dark"] .alert.alert-info {
  background: rgba(76, 155, 232, .16);
  border-color: rgba(76, 155, 232, .4);
  color: #7db8f0;
}
