/* ============================================================
   CREATIF PRO ERP — Module partagé
   Fichier : assets/shared/toast/toast.css
   Rôle    : notifications flottantes universelles (succès, erreur,
             info, avertissement), en remplacement des alert().
   Reprend les variables de dashboard.css / authentification.css
   (--text, --surface, --border, --radius-*, ...).
   Si ce fichier est chargé seul (sans dashboard.css), les
   valeurs de repli (fallback) ci-dessous s'appliquent.
   ============================================================ */

#toastRoot {
  --tst-text:        var(--text, #0a0a0a);
  --tst-text-sec:    var(--text-secondary, #5c5c5c);
  --tst-surface:     var(--surface, #ffffff);
  --tst-border:      var(--border, #e2e0da);
  --tst-success:     var(--success-dot, #1f9d55);
  --tst-success-light: var(--success-light, rgba(31,157,85,.12));
  --tst-danger:      var(--danger-dot, #d1495b);
  --tst-danger-light: var(--danger-light, rgba(209,73,91,.12));
  --tst-warning:     var(--warning-dot, #c98a1c);
  --tst-warning-light: var(--warning-light, rgba(201,138,28,.12));
  --tst-accent:      var(--accent, #2563eb);
  --tst-accent-light: var(--accent-light, rgba(37,99,235,.12));
  --tst-radius-md:   var(--radius-md, 12px);
  --tst-shadow-lg:   var(--shadow-lg, 0 10px 24px -6px rgba(0,0,0,.12));

  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;

  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;

  width: 100%;
  max-width: 400px;
  padding: 0 16px;

  pointer-events: none;
  font-family: 'Inter', sans-serif;
}

.tst-item {
  pointer-events: auto;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;

  background: var(--tst-surface);
  border: 1px solid var(--tst-border);
  border-radius: var(--tst-radius-md);
  box-shadow: var(--tst-shadow-lg);
  padding: 14px 16px;

  opacity: 0;
  transform: translateY(-10px) scale(.97);
  transition: opacity .2s ease, transform .2s ease;
}

.tst-item.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tst-item.hide {
  opacity: 0;
  transform: translateY(-6px) scale(.97);
}

/* --- Icône -------------------------------------------------- */
.tst-icon {
  flex: none;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tst-icon svg { width: 16px; height: 16px; }

.tst-icon-success { background: var(--tst-success-light); color: var(--tst-success); }
.tst-icon-danger  { background: var(--tst-danger-light);  color: var(--tst-danger); }
.tst-icon-warning { background: var(--tst-warning-light); color: var(--tst-warning); }
.tst-icon-info    { background: var(--tst-accent-light);  color: var(--tst-accent); }

/* --- Texte ---------------------------------------------------- */
.tst-body { flex: 1; min-width: 0; }

.tst-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--tst-text);
  letter-spacing: -.1px;
  line-height: 1.35;
}
.tst-message {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--tst-text-sec);
  margin-top: 2px;
}

/* --- Fermeture -------------------------------------------------- */
.tst-close {
  flex: none;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--tst-text-sec);
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.tst-close:hover { background: rgba(10,10,10,.06); color: var(--tst-text); }
.tst-close svg { width: 13px; height: 13px; }

.tst-close:focus-visible {
  outline: 2px solid var(--tst-text);
  outline-offset: 2px;
}

/* --- Mobile ------------------------------------------------------ */
@media (max-width: 420px) {
  #toastRoot { top: 12px; padding: 0 10px; }
  .tst-item { padding: 12px 14px; }
}
