/* ACP Portal — Toast notification component
 *
 * Vanilla CSS + JS (see toast.js). Templates trigger toasts via the global
 * `acpToast({type, text, ms})` helper instead of relying on full-page
 * reloads to convey operation outcomes (per P1 audit problem #9).
 *
 * Stack at top-right desktop, top-center mobile. 4 types: success / info /
 * warn / error. Auto-dismiss after 4s, hover pauses, click dismisses.
 */
.acp-toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.acp-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  color: var(--fg);
  line-height: 1.5;
  pointer-events: auto;
  max-width: 360px;
  cursor: pointer;
  animation: acpToastIn 200ms ease-out;
  transform-origin: top right;
}
.acp-toast.leaving {
  animation: acpToastOut 200ms ease-out forwards;
}

.acp-toast-icon {
  flex: 0 0 auto;
  font-size: var(--text-lg);
  line-height: 1.2;
  width: 1.3em;
  text-align: center;
}

.acp-toast-success { border-left: 3px solid var(--success); }
.acp-toast-success .acp-toast-icon { color: var(--success); }
.acp-toast-info { border-left: 3px solid var(--accent); }
.acp-toast-info .acp-toast-icon { color: var(--accent); }
.acp-toast-warn { border-left: 3px solid var(--warn); }
.acp-toast-warn .acp-toast-icon { color: var(--warn); }
.acp-toast-error { border-left: 3px solid var(--danger); }
.acp-toast-error .acp-toast-icon { color: var(--danger); }

@keyframes acpToastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes acpToastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

@media (max-width: 640px) {
  .acp-toast-stack {
    top: 8px;
    left: 8px;
    right: 8px;
    align-items: center;
  }
  .acp-toast {
    max-width: 100%;
    width: 100%;
  }
}
