/* ═══════════════════════════════════════
   ELITE CS v4 — TOASTS
   Transient notifications stacked top-right.
   Arc Final glass + variant accents.
   ═══════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: var(--s5);
  right: var(--s5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  pointer-events: none;  /* container is transparent; toasts get pointer-events */
  max-width: calc(100vw - 2 * var(--s5));
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  min-width: 280px;
  max-width: 420px;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(14,24,36,0.95), rgba(9,17,26,0.92));
  border: 1px solid var(--glass-border-hover);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow: var(--glass-inset), var(--shadow-3);
  color: var(--text-primary);
  font-size: 13px;
  position: relative;
  overflow: hidden;
  animation: slideUp var(--dur-card) var(--ease);
}

.toast.toast-leaving {
  animation: toastOut var(--dur-std) var(--ease) forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px) scale(0.96); }
}

/* ─── Icon chip (Arc Final sculpted) ─── */
.toast-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--teal-alpha-20);
  color: var(--teal);
  box-shadow: var(--chip-shadow);
}

/* ─── Body ─── */
.toast-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.toast-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-bright);
  line-height: 1.35;
}

.toast-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.toast-action {
  margin-top: var(--s2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  align-self: flex-start;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.toast-action:hover { color: #70e0ff; }

/* ─── Close ─── */
.toast-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--dur-lift) var(--ease-lift);
  margin-top: 1px;
}
.toast-close:hover {
  background: var(--danger-soft-bg);
  color: var(--danger-soft);
}

/* ─── Progress bar (auto-dismiss indicator) ─── */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--teal);
  transform-origin: left;
  animation: toastProgress linear forwards;
  opacity: 0.6;
}
@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ─── Variants ─── */
.toast-success .toast-icon {
  background: rgba(60,232,160,0.18);
  color: var(--status-live);
}
.toast-success .toast-progress { background: var(--status-live); }
.toast-success { border-color: rgba(60,232,160,0.28); }

.toast-warning .toast-icon {
  background: rgba(240,160,48,0.18);
  color: var(--amber);
}
.toast-warning .toast-progress { background: var(--amber); }
.toast-warning { border-color: rgba(240,160,48,0.28); }

.toast-error .toast-icon {
  background: var(--danger-soft-bg);
  color: var(--danger-soft);
}
.toast-error .toast-progress { background: var(--danger-soft); }
.toast-error { border-color: rgba(255,100,100,0.32); }
.toast-error .toast-title { color: var(--danger-soft); }

/* ─── Light mode ─── */
[data-theme="light"] .toast {
  background: linear-gradient(160deg, rgba(255,255,255,0.96), rgba(255,255,255,0.92));
  border-color: rgba(0,40,80,0.12);
  box-shadow: var(--shadow-3);
}

/* ─── Mobile: full-width bottom ─── */
@media (max-width: 767px) {
  .toast-container {
    top: auto;
    bottom: var(--s4);
    left: var(--s4);
    right: var(--s4);
    max-width: none;
  }
  .toast { max-width: none; }
}
