/* ------------------ Alertas / estados -------------------- */
@layer components {
  .alert {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    overflow: visible; /* so bubble can overflow */
    background: var(--alert-bg);
  }
}

.alert.success {
  --alert-bg: #12a15a;
  --alert-splat: #0e7d45;
  --alert-bubble: #0c6839;
}

.alert.info, .alert.alert-info {
  --alert-bg: #006edf;
  --alert-splat: #005bb7;
  --alert-bubble: #0051a8;
}

.alert.warn, .alert.alert-warning {
  --alert-bg: #f37a20;
  --alert-splat: #be5a11;
  --alert-bubble: #a14707;
}

.alert.danger, .alert.alert-danger, .alert.alert-error {
  --alert-bg: #d9384e;
  --alert-splat: #a72436;
  --alert-bubble: #8a1928;
}

/* Background splat pattern for inline alerts */
.alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 90px;
  pointer-events: none;
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='xMinYMid slice'%3E%3Cpath d='M 0 0 C 35 15, 30 45, 15 65 C 5 80, 20 90, 0 100 Z' fill='rgba(0,0,0,0.15)'%3E%3C/path%3E%3Ccircle cx='15' cy='20' r='4.5' fill='rgba(0,0,0,0.15)'%3E%3C/circle%3E%3Ccircle cx='38' cy='40' r='3' fill='rgba(0,0,0,0.15)'%3E%3C/circle%3E%3Ccircle cx='28' cy='72' r='5' fill='rgba(0,0,0,0.15)'%3E%3C/circle%3E%3C/svg%3E");
  background-size: cover;
  z-index: 1;
}

/* Floating speech bubble icon for inline alerts */
.alert::after {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--alert-bubble);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.alert.success::after {
  content: '✓';
}

.alert.info::after, .alert.alert-info::after {
  content: '?';
}

.alert.warn::after, .alert.alert-warning::after {
  content: '!';
}

.alert.danger::after, .alert.alert-danger::after, .alert.alert-error::after {
  content: '✕';
}

