/* Flash alerts & toast notifications */

.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.app-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-alert .alert-icon {
  font-size: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.app-alert .alert-message {
  flex: 1;
  line-height: 1.5;
}

.app-alert .alert-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  padding: 0 4px;
  color: inherit;
}

.app-alert .alert-close:hover {
  opacity: 1;
}

.success-alert {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.success-alert .alert-icon {
  color: #059669;
}

.error-alert {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.error-alert .alert-icon {
  color: #dc2626;
}

.warning-alert {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.warning-alert .alert-icon {
  color: #d97706;
}

/* Toast stack (fixed, for JS-triggered messages) */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-stack .app-alert {
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  margin-bottom: 0;
}

.toast-stack .app-alert.is-hiding {
  animation: alertFadeOut 0.25s ease forwards;
}

@keyframes alertFadeOut {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}

/* Auth pages */
.auth-alerts-wrap {
  width: 100%;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .toast-stack {
    left: 16px;
    right: 16px;
    top: 16px;
    max-width: none;
  }
}
