/* =============================================================================
   toast.css — Shared toast notification styles
   Works with both portal (--navy / --em / --rose CSS vars)
   and public (--p / --danger / --warning / --info CSS vars).
   Include once in each base template.
============================================================================= */

.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  min-width: 300px;
  max-width: 420px;
  padding: .9rem 1.1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
  pointer-events: all;
  cursor: default;
  position: relative;
  overflow: hidden;
  animation: toastSlideIn .3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.hiding {
  animation: toastSlideOut .25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Icon box ── */
.toast__icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast__icon svg {
  width: 16px;
  height: 16px;
}

/* ── Body ── */
.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: .8rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: .1rem;
  line-height: 1.3;
}

.toast__msg {
  font-size: .8rem;
  color: #4b5563;
  line-height: 1.55;
}

/* ── Close button ── */
.toast__close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color .15s;
}

.toast__close:hover {
  color: #374151;
}

/* ── Progress bar ── */
.toast__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  animation: toastBar var(--toast-duration, 4000ms) linear forwards;
}

/* ── Variants ── */

/* success */
.toast--ok .toast__icon { background: #ecfdf5; color: #059669; }
.toast--ok .toast__bar  { background: #10b981; }

/* error */
.toast--er .toast__icon { background: #fef2f2; color: #dc2626; }
.toast--er .toast__bar  { background: #ef4444; }

/* warning */
.toast--wa .toast__icon { background: #fffbeb; color: #d97706; }
.toast--wa .toast__bar  { background: #f59e0b; }

/* info */
.toast--in .toast__icon { background: #eff6ff; color: #2563eb; }
.toast--in .toast__bar  { background: #3b82f6; }

/* ── Animations ── */
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)      scale(1);  }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0)    scale(1);   }
  to   { opacity: 0; transform: translateY(-8px) scale(.97); }
}

@keyframes toastBar {
  from { width: 100%; }
  to   { width: 0%;   }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    min-width: unset;
    max-width: 100%;
  }
}