/* Toast — Modern 2026 — glass, oklch, motion */
@layer tokens, components;
@layer components {
  .toast-container {
    position: fixed; inset: 16px 16px auto auto;
    z-index: 10000; pointer-events: none;
    display: flex; flex-direction: column; gap: 10px;
    width: min(380px, calc(100vw - 24px));
  }
  .toast {
    pointer-events: auto; display: grid; gap: 0;
    border-radius: 16px; overflow: hidden;
    background: linear-gradient(180deg, rgba(26,26,30,0.92), rgba(14,14,16,0.96));
    backdrop-filter: blur(16px) saturate(1.15);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06) inset;
    transform: translateY(-6px) scale(0.98); opacity: 0;
    transition: transform .38s cubic-bezier(0.34,1.56,0.64,1), opacity .28s, border-color .22s;
  }
  .toast.toast-show { transform: none; opacity: 1; }
  .toast.toast-hide { transform: translateY(-6px) scale(0.98); opacity: 0; }

  .toast-content { display: grid; grid-template-columns: 36px 1fr 28px; gap: 10px; align-items: center; padding: 12px; }
  .toast-icon {
    width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.10);
    color: white;
  }
  .toast.toast-success .toast-icon { background: linear-gradient(180deg, color-mix(in oklch, #20c55a 85%, white 15%), #149a42); }
  .toast.toast-error .toast-icon { background: linear-gradient(180deg, color-mix(in oklch, var(--accent) 88%, white 12%), #b8070f); }
  .toast.toast-warning .toast-icon { background: linear-gradient(180deg, #ffb020, #ff8a00); color: #1a1200; }
  .toast-message { min-width: 0; }
  .toast-title { font-weight: 750; font-size: 13px; letter-spacing: -0.01em; line-height: 1.2; }
  .toast-text { color: var(--muted); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }

  .toast-close {
    width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.72);
    cursor: pointer; transition: background .2s, transform .2s;
  }
  .toast-close:hover { background: rgba(255,255,255,0.10); transform: scale(1.04); }

  .toast-progress { position: relative; height: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
  .toast-progress::before {
    content:""; position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--accent), color-mix(in oklch, var(--accent) 70%, white));
    transform-origin: left; animation: toastProgress linear forwards;
  }
  @keyframes toastProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes toast-progress-animation { from { transform: translateX(-100%); } to { transform: translateX(0); } }

  /* variants subtle border tint */
  .toast.toast-success { border-color: rgba(32,197,90,0.22); }
  .toast.toast-error { border-color: rgba(255,10,22,0.22); }
  .toast.toast-warning { border-color: rgba(255,176,32,0.22); }

  @media (max-width: 640px) {
    .toast-container { inset: 10px 10px auto 10px; width: auto; }
  }
  @media (prefers-reduced-motion: reduce) {
    .toast { transition: none; }
    .toast-progress::before { animation: none; }
  }
}
