/* --- Overlay (fond gris translucide) --- */
* {
	font-family: Calibri, sans-serif;
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;              /* masqué par défaut */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  isolation: isolate;         /* permet de superposer ::before et contenu */
}

/* état ouvert (ajoutée par JS) */
.overlay.is-open { display: flex; }

/* voile de fond gris semi-transparent */
.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 0;
}

/* --- Fenêtre modale --- */
.modal {
  position: relative;         /* pour passer au-dessus du ::before */
  z-index: 1;
  background: #fff;
  max-width: 480px;
  width: 92%;
  padding: 20px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  text-align: center;
  animation: fadeIn .22s ease-out;
}

.modal p { margin: 0 0 12px; }

/* Thèmes (optionnels) */
.modal--success #m-msg1 { color: #2e7d32; } /* vert */
.modal--error   #m-msg1 { color: #c62828; } /* rouge */

/* Actions */
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.modal-actions .btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color .2s ease;
}

.modal-actions .btn-primary { background:#1976d2; color:#fff; }
.modal-actions .btn-primary:hover { background:#1565c0; }

.modal-actions .btn-secondary { background:#2e7d32; color:#fff; }
.modal-actions .btn-secondary:hover { background:#256428; }

/* --- Animation d'apparition --- */
@keyframes fadeIn {
  from { transform: scale(.97); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

