/* Styles de modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content.open {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
  background: #e5e7eb;
  color: #111827;
  transform: scale(1.1) rotate(90deg);
  opacity: 1;
}

.modal-close:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  opacity: 1;
}

/* Styles pour le formulaire dans le modal */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9375rem;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.modal-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Animation d'ouverture du modal */
.modal-overlay.visible {
  display: flex;
  opacity: 1;
}

.modal-content.visible {
  transform: scale(1);
}

/* Gestion du scroll du body */
body.modal-open {
  overflow: hidden;
  padding-right: 15px; /* Compense la disparition de la scrollbar */
}