.message-container {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
}

.message {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  animation: messageIn 0.25s ease forwards;
  overflow: hidden;
}

.message.closing {
  animation: messageOut 0.22s ease forwards;
}

.message-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 800;
}

.message-content {
  flex: 1;
  padding-right: 8px;
}

.message-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 3px;
}

.message-text {
  font-size: 14px;
  color: #475569;
  line-height: 1.4;
}

.message-close {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  width: 22px;
  height: 22px;
  border-radius: 8px;
}

.message-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.message-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  animation-name: progressBar;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

/* Tipos */
.message.success .message-icon {
  color: #166534;
  background: #dcfce7;
}

.message.success .message-progress {
  background: #22c55e;
}

.message.error .message-icon {
  color: #991b1b;
  background: #fee2e2;
}

.message.error .message-progress {
  background: #ef4444;
}

.message.warning .message-icon {
  color: #92400e;
  background: #fef3c7;
}

.message.warning .message-progress {
  background: #f59e0b;
}

.message.info .message-icon {
  color: #1d4ed8;
  background: #dbeafe;
}

.message.info .message-progress {
  background: #2563eb;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes messageOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
  }
}

@keyframes progressBar {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

@media (max-width: 480px) {
  .message-container {
    top: 14px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .message {
    padding: 14px;
    border-radius: 16px;
  }
}