/*
 * Avisos (.alert) de toda la herramienta.
 *
 * Soft UI pinta los avisos con degradados saturados (el de éxito es verde lima, el de error rojo
 * intenso...) que no encajan con la paleta de Zoddak. Aquí se sustituyen por superficies suaves
 * con la paleta de la plataforma: fondo tintado, borde fino, texto oscuro legible e icono de estado.
 * Se carga después de soft-ui-dashboard.css en las plantillas default, public y blank.
 */
html .alert {
  --za-fg: #365c6b;
  --za-bg: #eef4f5;
  --za-bd: #d6e4e6;
  --za-ac: #7a9fa5;
  --za-icon: 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.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
  position: relative;
  padding: .8rem 1rem .8rem 3.1rem;
  border: 1px solid var(--za-bd);
  border-radius: 12px;
  background: var(--za-bg);
  background-image: none;
  box-shadow: none;
  color: var(--za-fg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
html .alert::before {
  content: "";
  position: absolute;
  top: 50%;
  left: .9rem;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--za-ac) var(--za-icon) center / 13px no-repeat;
}
/* Los avisos que ya traen su propio icono (p. ej. el de "Cargando…") no llevan el del estado */
html .alert:has(> .alert-icon),
html .alert:has(> i:first-child) { padding-left: 1rem; }
html .alert:has(> .alert-icon)::before,
html .alert:has(> i:first-child)::before { content: none; }

html .alert-success {
  --za-fg: #146f5d;
  --za-bg: #e8f6f2;
  --za-bd: #bfe5da;
  --za-ac: #27b093;
  --za-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
html .alert-danger {
  --za-fg: #a4423f;
  --za-bg: #fdeeed;
  --za-bd: #f3c9c5;
  --za-ac: #d65c4f;
  --za-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E");
}
html .alert-warning {
  --za-fg: #8a5f12;
  --za-bg: #fff6e4;
  --za-bd: #f1d9a2;
  --za-ac: #e0a23b;
  --za-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E");
}
html .alert-info {
  --za-fg: #2f5f6d;
  --za-bg: #e9f4f7;
  --za-bd: #c3dfe7;
  --za-ac: #4a9bb0;
}
html .alert-primary {
  --za-fg: #146f5d;
  --za-bg: #eaf7f4;
  --za-bd: #c4e6dd;
  --za-ac: #27b093;
}
html .alert-secondary,
html .alert-light,
html .alert-dark,
html .alert-white {
  --za-fg: #365c6b;
  --za-bg: #f3f7f8;
  --za-bd: #dde8ea;
  --za-ac: #7a9fa5;
}

/* Algunas vistas añaden .text-white esperando el fondo saturado de Soft UI: sobre el fondo suave no se leería */
html .alert.text-white,
html .alert .text-white { color: var(--za-fg) !important; }

html .alert strong,
html .alert b { font-weight: 800; }
html .alert .alert-text { font-weight: inherit; }
html .alert a:not(.btn) { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
html .alert .alert-link { color: inherit; }
html .alert ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* Botón de cierre */
html .alert-dismissible { padding-right: 2.9rem; }
html .alert-dismissible .btn-close {
  position: absolute;
  top: 50%;
  right: .55rem;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent none;
  color: var(--za-fg);
  font-size: 19px;
  line-height: 1;
  opacity: .55;
  transition: opacity .15s ease, background-color .15s ease;
}
html .alert-dismissible .btn-close span { display: block; margin-top: -2px; }
html .alert-dismissible .btn-close:hover { background-color: rgba(43, 66, 74, .08); opacity: 1; }
html .alert-dismissible .btn-close:focus-visible { outline: 2px solid var(--za-ac); outline-offset: 1px; box-shadow: none; opacity: 1; }

@media (max-width: 575.98px) {
  html .alert { padding: .75rem .85rem .75rem 2.85rem; font-size: 12.5px; }
  html .alert::before { left: .75rem; width: 20px; height: 20px; background-size: 12px; }
  html .alert-dismissible { padding-right: 2.6rem; }
}
