/* ── Django messagess ─────────────────────────── */
.messages {
  list-style: none;
  margin-bottom: 1.5rem;
}

.message {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid var(--success);
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid var(--danger);
}

.message.warning {
  background: #fff3cd;
  color: #856404;
  border-left: 4px solid var(--warning);
}

.message.info {
  background: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid var(--info);
}

/* Dark mode: messages necesitan colores que mantengan contraste */
[data-theme="dark"] .message.success { background: rgba(38, 137, 13, 0.15); color: #86efac; border-color: #4ade80; }
[data-theme="dark"] .message.error   { background: rgba(226, 27, 60, 0.15);  color: #fca5a5; border-color: #f87171; }
[data-theme="dark"] .message.warning { background: rgba(255, 166, 2, 0.15);  color: #fcd34d; border-color: #fbbf24; }
[data-theme="dark"] .message.info    { background: rgba(19, 104, 206, 0.15); color: #93c5fd; border-color: #60a5fa; }

/* ── Custom toast notifications ─────────────────────────── */
#pp-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.pp-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 240px;
  max-width: 340px;
  padding: 0.7rem 1rem 0.7rem 0.85rem;
  border-radius: 12px;
  background: rgba(20, 22, 46, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.3);
  color: #eef2ff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  animation: pp-toast-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pp-toast--leaving {
  animation: pp-toast-out 0.22s ease-in forwards;
}

.pp-toast__icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  line-height: 1;
}

.pp-toast__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 12px 12px;
  animation: pp-toast-bar linear forwards;
}

.pp-toast {
  position: relative;
  overflow: hidden;
}

.pp-toast--success .pp-toast__bar {
  background: #26890d;
}

.pp-toast--warning .pp-toast__bar {
  background: #f59e0b;
}

.pp-toast--info .pp-toast__bar {
  background: #46178f;
}

@keyframes pp-toast-in {
  from {
    opacity: 0;
    transform: translateX(60px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes pp-toast-out {
  to {
    opacity: 0;
    transform: translateX(60px);
  }
}

@keyframes pp-toast-bar {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}
