/* ── Flash / Toast Notifications ─────────────────────────────────────────
   These appear as fixed toasts in the top-right corner, slide in, hold for
   ~3 s, then fade out. Driven entirely by CSS — no JS required.
   ──────────────────────────────────────────────────────────────────────── */

.flash-message {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;

  /* Size & shape */
  padding: 11px 16px;
  border-radius: 10px;
  min-width: 200px;
  max-width: 320px;

  /* Typography */
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;

  /* Visual */
  background: white;
  border-left: 4px solid transparent;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.12),
    0 1px 6px  rgba(0, 0, 0, 0.06);

  /* Layout */
  display: flex;
  align-items: center;
  gap: 10px;

  /* Lifecycle animation: slide in → hold → slide out → gone */
  animation: toastLifecycle 3.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stack a second message below the first */
.flash-message + .flash-message {
  top: 78px;
}

/* ── Variants ── */
.flash-message.success {
  border-left-color: #22c55e;
  color: #166534;
}

.flash-message.success::before {
  content: '✓';
  font-size: 1rem;
  font-weight: 700;
  color: #22c55e;
  flex-shrink: 0;
}

.flash-message.error {
  border-left-color: #ef4444;
  color: #991b1b;
}

.flash-message.error::before {
  content: '✕';
  font-size: 0.95rem;
  font-weight: 700;
  color: #ef4444;
  flex-shrink: 0;
}

/* ── Keyframes ──
   0 %  →  8 %  : slide in from right  (~0.3 s)
   8 %  → 84 %  : hold visible         (~2.9 s)
   84 % → 100 % : slide out to right   (~0.6 s)
   visibility: hidden at end so the invisible element
   can no longer block clicks.
   ───────────────────────────────────────────────── */
@keyframes toastLifecycle {
  0%  { opacity: 0; transform: translateX(22px); }
  8%  { opacity: 1; transform: translateX(0);    }
  84% { opacity: 1; transform: translateX(0);    }
  100%{ opacity: 0; transform: translateX(22px); visibility: hidden; }
}
