/* ============================================================
   MODAL — sistema moderno, accesible y consistente
   ============================================================ */

/* ===== OVERLAY ===== */
.modal {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);

  display: none; /* oculto por defecto */
  align-items: center;
  justify-content: center;

  z-index: var(--z-modal, 10000);
  padding: 20px;
}

/* Mostrar modal */
.modal.is-active {
  display: flex;
}

/* ===== MODAL BOX ===== */
.modal__content {
  position: relative;

  width: 100%;
  max-width: 540px;

  background: #fff;
  padding: 28px;
  border-radius: 14px;

  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);

  animation: modalFadeIn .25s ease;
}

/* Animación */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== CLOSE BUTTON ===== */
.modal__close {
  position: absolute;
  top: 12px;
  right: 14px;

  font-size: 1.6rem;
  line-height: 1;

  color: var(--grey-600);
  background: none;
  border: none;
  padding: 6px;

  cursor: pointer;

  transition: opacity .2s ease, transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.modal__close:hover {
  opacity: 0.7;
  transform: scale(1.05);
}

.modal__close:focus-visible {
  outline: 3px solid var(--primary-400);
  outline-offset: 3px;
}

/* ===== TITLE ===== */
.modal__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--grey-900);
}

/* ===== TEXT ===== */
.modal__text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--grey-700);
  margin-bottom: 22px;
}

/* ===== ACTIONS ===== */
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.modal__actions .btn {
  min-width: 110px;
}

/* ===== BODY LOCK ===== */
body.modal-open {
  overflow: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .modal__content {
    padding: 22px 18px;
    border-radius: 12px;
  }

  .modal__title {
    font-size: 1.25rem;
  }
}

/* ===== REDUCE MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .modal__content {
    animation: none;
  }
}
