/* =========================================================
   LYS-MOI — COMPOSANT MODALES
   ---------------------------------------------------------
   Overlay, backdrop, carte modale, header, actions.
   Ne modifie PAS les anciennes modales tant qu’on ne migre
   pas les pages manuellement.
   ========================================================= */

/* =========================================================
   WRAPPER
   ========================================================= */

.lm-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
}

.lm-modal.is-hidden,
.lm-modal.hidden {
  display: none;
}

.lm-modal__backdrop {
  position: absolute;
  inset: 0;

  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(8px);
}

/* =========================================================
   DIALOG
   ========================================================= */

.lm-modal__dialog {
  position: relative;
  z-index: 1;

  width: min(560px, 100%);
  max-height: calc(100vh - 48px);

  display: flex;
  flex-direction: column;

  padding: 28px;

  border: 1px solid var(--lm-border-gold);
  border-radius: var(--lm-radius-xl);

  color: var(--lm-text);
  background:
    radial-gradient(
      circle at top left,
      rgba(240, 198, 116, 0.10),
      transparent 12rem
    ),
    var(--lm-surface-strong);

  box-shadow: var(--lm-shadow-strong);
  overflow: auto;
}

.lm-modal__dialog--sm {
  width: min(420px, 100%);
}

.lm-modal__dialog--lg {
  width: min(760px, 100%);
}

.lm-modal__dialog--xl {
  width: min(980px, 100%);
}

/* =========================================================
   CLOSE
   ========================================================= */

.lm-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;

  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-pill);

  color: var(--lm-text);
  background: var(--lm-surface-soft);

  font-size: 1.35rem;
  line-height: 1;

  cursor: pointer;

  transition:
    transform var(--lm-transition-fast),
    background var(--lm-transition-fast),
    border-color var(--lm-transition-fast),
    opacity var(--lm-transition-fast);
}

.lm-modal__close:hover {
  transform: translateY(-1px);
  background: var(--lm-surface-medium);
  border-color: var(--lm-border-gold);
  opacity: 0.96;
}

/* =========================================================
   CONTENT
   ========================================================= */

.lm-modal__kicker {
  margin: 0 0 10px;

  color: var(--lm-accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.lm-modal__title {
  margin: 0 0 12px;

  color: var(--lm-text-title);
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.lm-modal__text {
  margin: 0 0 22px;

  color: var(--lm-text-soft);
  line-height: 1.7;
}

.lm-modal__body {
  display: grid;
  gap: 14px;
}

.lm-modal__body-scroll {
  max-height: 52vh;
  overflow: auto;
  padding-right: 6px;
}

.lm-modal__body-scroll::-webkit-scrollbar {
  width: 10px;
}

.lm-modal__body-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--lm-radius-pill);
}

.lm-modal__body-scroll::-webkit-scrollbar-thumb {
  background: rgba(240, 198, 116, 0.22);
  border-radius: var(--lm-radius-pill);
}

/* =========================================================
   ACTIONS
   ========================================================= */

.lm-modal__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;

  margin-top: 18px;
}

.lm-modal__actions--between {
  justify-content: space-between;
}

/* =========================================================
   ÉTATS
   ========================================================= */

.lm-modal__status {
  min-height: 22px;

  color: var(--lm-text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.lm-modal__status--error {
  color: var(--lm-danger-text);
}

.lm-modal__status--success {
  color: var(--lm-success);
}

/* =========================================================
   ANIMATION OPTIONNELLE
   ========================================================= */

.lm-modal:not(.is-hidden) .lm-modal__dialog {
  animation: lmModalIn 0.22s ease both;
}

@keyframes lmModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 560px) {
  .lm-modal {
    padding: 18px;
  }

  .lm-modal__dialog {
    max-height: calc(100vh - 36px);
    padding: 24px 18px;
    border-radius: var(--lm-radius-lg);
  }

  .lm-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .lm-modal__actions .lm-btn {
    width: 100%;
  }
}