/* =================================================================
   slots-modal.css
   Styles du système modal unifié — utilisé sur tout le site.

   Couvre :
     - .modal-bg        : overlay système unifié (modal-cancel)
     - .modal-box       : corps de la modale
     - .modal-overlay   : ancien système (admin-rdv)
     - .modal           : ancien système (admin-rdv)
     - .causes-list     : causes rapides radio buttons
     - .cause-option    : carte radio button
     - .note-input      : textarea motif
     - .modal-btns      : boutons de commande
   ================================================================= */

/* ══════════════════════════════════════════════════════════════
   SYSTÈME UNIFIÉ — modal-cancel (block--modal-cancel.html.twig)
   ══════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.modal-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* État ouvert — classe .show ajoutée via JS */
.modal-bg.show {
  opacity: 1;
  visibility: visible;
}

/* ── Corps de la modale ── */
.modal-box {
  background-color: var(--surface-white);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 59, 104, 0.18);
  width: 90%;
  max-width: 520px;
  padding: 28px;
  margin: 16px;
  transform: translateY(-20px);
  transition: transform 0.25s ease;
  box-sizing: border-box;
}

.modal-bg.show .modal-box {
  transform: translateY(0);
}

/* ── En-tête ── */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Titre ── */
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin: 0;
}

/* ── Bouton fermeture (×) ── */
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.modal-close:hover {
  color: var(--status-error-text);
  background: var(--status-error-bg);
}

/* ── Texte info (membre, date, heure) ── */
#modal-cancel-text {
  background: var(--surface-default);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* ── Bannière avertissement (réservations existantes) ── */
.confirm-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: var(--status-error-bg);
  border-left: 4px solid var(--status-error-text);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
}

.confirm-banner-icon {
  color: var(--status-error-text);
  font-size: 1.1rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.confirm-banner-text {
  color: var(--status-error-text);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ── Causes rapides ── */
.causes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cause-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  padding: 12px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}

.cause-option:hover {
  border-color: var(--brand-primary);
  background: #f0f6ff;
}

.cause-option.selected {
  border-color: var(--brand-primary);
  background: #EDF2F8;
}

.cause-option input[type="radio"] {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.cause-option-title {
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 2px;
}

.cause-option-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Label champ motif ── */
.note-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

/* ── Textarea motif ── */
.note-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-subtle);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 80px;
}

.note-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 59, 104, 0.1);
}

/* ── Hint email ── */
.email-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Requis (*) ── */
.req {
  color: var(--status-error-text);
}

/* ── Boutons de commande ── */
.modal-btns {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 24px;
}

/* ── Wrap raison ── */
#modal-cancel-reason-wrap,
#slots-modal-reason-wrap {
  margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════════════════
   ANCIEN SYSTÈME — .modal-overlay (admin-rdv uniquement)
   Conservé pour compatibilité — ne pas supprimer
   ══════════════════════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.is-open,
.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface-white);
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 520px;
  margin: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  animation: modal-pop 0.25s ease both;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-btn {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}

.modal-btn-cancel {
  background: none;
  color: var(--status-error-text);
  border: 1.5px solid var(--status-error-text);
}

.modal-btn-cancel:hover {
  background: var(--status-error-text);
  color: var(--color-white);
}

.modal-btn-close {
  background: none;
  color: var(--text-muted);
  border: 1.5px solid var(--border-subtle);
}

.modal-btn-close:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .modal-box {
    padding: 16px;
    width: 95%;
  }
  .modal-btns {
    flex-direction: column;
  }
  .m-btn {
    width: 100%;
  }
}
