/* ==========================================================================
   ÓNIX · MODAL GENÉRICO
   ========================================================================== */

.onx-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
}

.onx-modal.open {
  display: block;
}

.onx-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0;
  animation: onx-fade-in .22s ease forwards;
}

@keyframes onx-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.onx-modal__dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  min-width: 320px;
  max-width: 520px;
  width: calc(100% - 40px);

  background: var(--surface);
  color: var(--texto);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 0;
  overflow: hidden;
  opacity: 0;
  animation: onx-modal-slide .24s ease forwards;
}

@keyframes onx-modal-slide {
  from {
    opacity: 0;
    transform: translate(-50%, -58%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.onx-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

/* Título: permite icono + texto en fila */
.onx-modal__title {
  margin: 0;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.onx-modal__title-text {
  display: inline-block;
}

/* Icono dentro del título (AVISO, etc.) */
.onx-modal__title-icon {
  font-size: 22px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}

.onx-modal__title-icon--warning {
  color: var(--asuetos-color);
}

.onx-modal__close {
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
}

.onx-modal__close:hover {
  background: var(--link-activo-bg);
}

.onx-modal__body {
  padding: 16px;
  font-size: 15px;
  line-height: 1.45;
}

/* Afinar el texto del mensaje */
.onx-modal__body p {
  margin: 0 0 10px;
  color: var(--muted);
}

.onx-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

/* Desactivar scroll del body cuando haya un modal abierto */
body.onx-modal-open {
  overflow: hidden;
}

/* ==========================================================================
   Botón "Eliminar" (peligro) reutilizable
   ========================================================================== */

.onx-btn--danger {
  background: var(--surface);
  color: var(--link-logout-activo);
  border: 1px solid var(--line);
  box-shadow: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.onx-btn--danger:hover,
.onx-btn--danger:focus-visible {
  background: var(--btn-logout-bg-hover);
  color: var(--link-logout-activo);
  border-color: transparent; /* sin borde gris al hover */
  outline: none;
}
