/**
 * Overrides visuales de Konix Asesores y Consultores sobre AlertifyJS.
 * No modifica alertify.css (base de la librería); se enlaza después de ese archivo.
 *
 * Paleta (extraída de img/logo2.png, sin variables CSS globales para evitar
 * choques con las variables --bs-* de Bootstrap 5 ya cargadas en la página):
 *   #176AA6  azul oscuro   - texto "konix" del logo
 *   #2085CB  azul medio    - trazo diagonal del logo
 *   #35ADFD  azul claro    - texto "asesores" del logo
 *   #A3C600  verde lima    - brazo del check/"K" del logo
 *   #6EA300  verde lima (oscurecido) - variante de #A3C600 para fondos sólidos con texto blanco (contraste AA)
 *   #c0392b  rojo error    - no proviene del logo; único tono semántico de error disponible
 *   #212529  texto base
 */

/* ---------------------------------------------------------------------- */
/* Diálogo (alertify.alert / .ajs-ok / .ajs-cancel)                       */
/* ---------------------------------------------------------------------- */

.alertify .ajs-dialog {
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(23, 106, 166, 0.25);
  overflow: hidden;
}

.alertify .ajs-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #176aa6;
  color: #fff;
  font-family: "Roboto Slab", serif;
  font-size: 18px;
  font-weight: 600;
}

.alertify .ajs-header::before {
  content: "";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

.alertify .ajs-commands button.ajs-close {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
}

.alertify .ajs-body .ajs-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #212529;
}

.alertify .ajs-footer {
  background-color: #fff;
}

.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok {
  border: none;
  border-radius: 999px;
  background-color: #6ea300;
  color: #fff;
  font-weight: 600;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok:hover {
  background-color: #5c8a00;
  box-shadow: 0 4px 12px rgba(110, 163, 0, 0.4);
}

.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok:focus-visible {
  outline: 2px solid #176aa6;
  outline-offset: 2px;
  box-shadow: 0 4px 12px rgba(110, 163, 0, 0.4);
}

.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-cancel:focus-visible {
  outline: 2px solid #176aa6;
  outline-offset: 2px;
}

.alertify .ajs-dimmer {
  background-color: rgba(23, 106, 166, 0.55);
  opacity: 1;
}

/* ---------------------------------------------------------------------- */
/* Notificaciones (alertify.success / .error / .warning)                  */
/* ---------------------------------------------------------------------- */

.alertify-notifier .ajs-message {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.alertify-notifier .ajs-message::before {
  content: "";
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.alertify-notifier .ajs-message.ajs-success {
  background: #6ea300;
}

.alertify-notifier .ajs-message.ajs-success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

.alertify-notifier .ajs-message.ajs-error {
  background: #c0392b;
}

.alertify-notifier .ajs-message.ajs-error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

.alertify-notifier .ajs-message.ajs-warning {
  /* Ámbar oscurecido (~#9c6500) para cumplir contraste AA con texto blanco */
  background: #9c6500;
}

.alertify-notifier .ajs-message.ajs-warning::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'%3E%3C/path%3E%3Cline x1='12' y1='9' x2='12' y2='13'%3E%3C/line%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* ---------------------------------------------------------------------- */
/* prefers-reduced-motion                                                 */
/* ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .alertify-notifier .ajs-message,
  .alertify-notifier .ajs-message.ajs-visible {
    transition-duration: 0.01ms;
  }
}
