/*
 * Notafacto Client — toasts pour le shell nf.
 *
 * Réplique le service toast (.toast / .toast-{type} / .toast-icon /
 * .toast-message / .toast-close) en s'appuyant UNIQUEMENT sur les tokens nf
 * (notafacto.css). Remplace toast.css (qui dépend des anciens tokens
 * --color-*, --radius-*, --shibui-*-dark absents du shell nf).
 */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--menu-elevation);
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out;
  font-family: var(--sans);
}

.toast.removing {
  animation: slideOutRight 0.3s ease-in forwards;
}

/* Variantes — fond teinté léger + filet d'accent à gauche. */
.toast-success {
  background: color-mix(in oklab, var(--success) 12%, var(--bg));
  color: var(--success-text);
  border-left: 4px solid var(--success);
}

.toast-error {
  background: color-mix(in oklab, var(--error) 12%, var(--bg));
  color: var(--error-text);
  border-left: 4px solid var(--error);
}

.toast-warning {
  background: color-mix(in oklab, var(--warning) 12%, var(--bg));
  color: var(--warning-text);
  border-left: 4px solid var(--warning);
}

.toast-info {
  background: color-mix(in oklab, var(--info) 12%, var(--bg));
  color: var(--info-text);
  border-left: 4px solid var(--info);
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
}

.toast-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: currentColor;
  opacity: 0.7;
  padding: 0;
  margin-left: 8px;
  transition: opacity 100ms ease;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(400px); opacity: 0; }
}

@media (max-width: 768px) {
  .toast-container { left: 20px; right: 20px; top: 70px; }
  .toast { min-width: auto; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.removing { animation: none; }
}
