/**
 * Tema unificado SweetAlert (sweetalert.js v2) — BSM / Contratista
 * Sobrescribe estilos inyectados por sweetalertupdate.js (carga después).
 */

/* —— Overlay —— */
.swal-overlay {
  background: rgba(15, 23, 42, 0.48) !important;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* —— Modal base —— */
.swal-modal.swal-theme-contratista {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  border-radius: 16px !important;
  padding: 1.75rem 1.5rem 1.35rem !important;
  max-width: min(420px, calc(100vw - 32px));
  max-height: min(90vh, calc(100dvh - 32px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.06) !important;
}

/* —— Iconos: halo suave común —— */
.swal-modal.swal-theme-contratista .swal-icon {
  width: 72px !important;
  height: 72px !important;
  margin: 8px auto 20px !important;
  border-width: 0 !important;
  animation: none !important;
}

.swal-modal.swal-theme-contratista .swal-icon:first-child {
  margin-top: 4px !important;
}

/* Error → círculo rojo + signo ! (oculta la X por defecto) */
.swal-modal.swal-theme-contratista .swal-icon--error {
  background: linear-gradient(160deg, #ef4444 0%, #dc2626 100%) !important;
  box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.14) !important;
  position: relative !important;
}

.swal-modal.swal-theme-contratista .swal-icon--error .swal-icon--error__x-mark {
  display: none !important;
}

.swal-modal.swal-theme-contratista .swal-icon--error::after {
  content: "!";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

/* Success → verde + halo */
.swal-modal.swal-theme-contratista .swal-icon--success {
  border: none !important;
  background: #22c55e !important;
  box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.2) !important;
  /* Recorta restos de la animación por defecto (rectángulos rotados que se ven como una diagonales). */
  overflow: hidden !important;
  border-radius: 50% !important;
}

/* SweetAlert inyecta ::before/::after como máscaras blancas 60×120px rotadas; si no se anulan del todo, cruza el círculo como una raya. */
.swal-modal.swal-theme-contratista .swal-icon--success::before,
.swal-modal.swal-theme-contratista .swal-icon--success::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  animation: none !important;
  -webkit-animation: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.swal-modal.swal-theme-contratista .swal-icon--success .swal-icon--success__ring {
  border-color: rgba(255, 255, 255, 0.35) !important;
}

.swal-modal.swal-theme-contratista .swal-icon--success .swal-icon--success__line {
  background-color: #fff !important;
}

.swal-modal.swal-theme-contratista .swal-icon--success .swal-icon--success__hide-corners {
  background-color: #22c55e !important;
}

/* Warning → ámbar */
.swal-modal.swal-theme-contratista .swal-icon--warning {
  border: none !important;
  background: linear-gradient(160deg, #fbbf24 0%, #f59e0b 100%) !important;
  box-shadow: 0 0 0 10px rgba(245, 158, 11, 0.18) !important;
  animation: none !important;
}

.swal-modal.swal-theme-contratista .swal-icon--warning .swal-icon--warning__body,
.swal-modal.swal-theme-contratista .swal-icon--warning .swal-icon--warning__dot {
  background-color: #fff !important;
}

/* Info → azul */
.swal-modal.swal-theme-contratista .swal-icon--info {
  border: none !important;
  background: linear-gradient(160deg, #60a5fa 0%, #3b82f6 100%) !important;
  box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.18) !important;
}

.swal-modal.swal-theme-contratista .swal-icon--info::before,
.swal-modal.swal-theme-contratista .swal-icon--info::after {
  background-color: #fff !important;
}

/* —— Título y texto —— */
.swal-modal.swal-theme-contratista .swal-title {
  color: #1e293b !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.35 !important;
  padding: 0 0.5rem !important;
  margin-top: 0 !important;
  text-align: center !important;
}

.swal-modal.swal-theme-contratista .swal-title:empty {
  display: none !important;
}

.swal-modal.swal-theme-contratista .swal-text {
  float: none !important;
  display: block !important;
  text-align: center !important;
  color: #64748b !important;
  font-size: 0.9375rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  padding: 0 0.75rem !important;
  max-width: 100% !important;
}

.swal-modal.swal-theme-contratista .swal-text:first-child {
  margin-top: 0 !important;
}

.swal-modal.swal-theme-contratista .swal-title + .swal-text {
  margin-top: 0.65rem !important;
}

/* Solo texto (sin título): primer bloque de texto */
.swal-modal.swal-theme-contratista .swal-text:first-child {
  margin-top: 0 !important;
}

/* —— Separador footer —— */
.swal-modal.swal-theme-contratista .swal-footer {
  margin-top: 1.25rem !important;
  padding: 1rem 0 0 !important;
  border-top: 1px solid #e5e7eb !important;
  text-align: center !important;
  background: transparent !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0.65rem !important;
}

.swal-modal.swal-theme-contratista .swal-button-container {
  margin: 0 !important;
  display: inline-block !important;
}

/* —— Botón principal (error / info / warning): azul —— */
.swal-modal.swal-theme-contratista .swal-button--confirm {
  background: #2563eb !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  padding: 0.6rem 1.65rem !important;
  min-width: 132px !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease !important;
}

.swal-modal.swal-theme-contratista .swal-button--confirm::before {
  content: "\2713";
  display: inline-block;
  margin-right: 0.45rem;
  font-size: 0.95em;
  opacity: 0.95;
}

.swal-modal.swal-theme-contratista .swal-button--confirm:hover:not([disabled]) {
  background: #1d4ed8 !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4) !important;
}

.swal-modal.swal-theme-contratista .swal-button--confirm:active:not([disabled]) {
  transform: scale(0.98);
}

/* —— Success: botón verde (misma forma) —— */
.swal-modal.swal-theme-contratista .swal-icon--success ~ .swal-footer .swal-button--confirm {
  background: #16a34a !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4) !important;
}

.swal-modal.swal-theme-contratista .swal-icon--success ~ .swal-footer .swal-button--confirm:hover:not([disabled]) {
  background: #15803d !important;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.45) !important;
}

.swal-modal.swal-theme-contratista .swal-button--cancel {
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  padding: 0.55rem 1.35rem !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

.swal-modal.swal-theme-contratista .swal-button--cancel:hover:not([disabled]) {
  background: #e2e8f0 !important;
}

.swal-modal.swal-theme-contratista .swal-button--danger {
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  padding: 0.6rem 1.35rem !important;
}

.swal-modal.swal-theme-contratista .swal-button--danger::before {
  content: none !important;
  display: none !important;
}

/* —— Contenido extra (ocultar cajas genéricas no usadas) —— */
.swal-modal.swal-theme-contratista .swal-content:empty {
  display: none !important;
}
