/* Alerts, flash messages and the toast popup. Success and info use the accent. */
.alert {
  border: 1px solid transparent;
  border-radius: var(--lb-radius-lg);
}

.alert-success,
.alert-info,
.alert-primary {
  color: var(--lb-accent-ink);
  background: var(--lb-accent-soft);
  border-color: var(--bs-success-border-subtle);
}

/* Flash messages: toasts stacked at the top right, over the page (shared/_flash). */
.flash-stack {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.flash-message {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem 0.85rem 1rem;
  font-weight: 500;
  color: var(--lb-ink);
  background: var(--lb-surface);
  border: 1px solid var(--lb-border-soft);
  border-left: 4px solid var(--lb-accent);
  border-radius: var(--lb-radius);
  box-shadow: var(--lb-shadow-lg);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s var(--lb-ease), transform 0.3s var(--lb-ease);
}

.flash-message.is-visible { opacity: 1; transform: none; }
.flash-message.alert-danger { border-left-color: var(--lb-danger); }

.flash-icon { font-size: 1.1rem; line-height: 1.3; color: var(--lb-accent); }
.alert-danger .flash-icon { color: var(--lb-danger); }
.flash-text { flex: 1; padding-top: 0.05rem; }
.flash-message .btn-close { flex-shrink: 0; font-size: 0.7rem; margin-top: 0.2rem; }

/* Signed-out pages have no header, so the toasts sit higher. */
body:not(:has(.app-shell)) .flash-stack { top: 20px; }

@media (max-width: 576px) {
  .flash-stack { top: 72px; right: 16px; }
}

/* Toast: slides in at the top right, leaves after a few seconds (toast_controller.js). */
.lb-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: min(380px, calc(100vw - 32px));
  padding: 0.9rem 1rem;
  background: var(--lb-surface);
  border: 1px solid var(--lb-border);
  border-left: 4px solid var(--lb-accent);
  border-radius: var(--lb-radius);
  box-shadow: var(--lb-shadow-lg);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lb-toast.is-visible {
  opacity: 1;
  transform: none;
}

.lb-toast-icon {
  font-size: 1.25rem;
  color: var(--lb-accent);
}

.lb-toast-body { flex: 1; }

.lb-toast-body a {
  font-weight: 600;
  color: var(--lb-accent-ink);
}

@media (max-width: 576px) {
  .lb-toast { top: 72px; right: 16px; }
}
