/* =========================================================
   Nixie | Toast notifications
   از توکن‌های طراحی style.css استفاده می‌کنه تا کاملاً هم‌رنگ و
   هم‌فونت با بقیه‌ی سایت باشه (وارینت داخلی Toastify).
   ========================================================= */

.toast-container{
  position:fixed;
  top:18px;
  left:50%;
  transform:translateX(-50%);
  z-index:9999;
  display:flex;
  flex-direction:column;
  gap:12px;
  width:min(92vw,380px);
  pointer-events:none;
}

.toast{
  pointer-events:auto;
  position:relative;
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px 16px 16px 12px;
  background:#fff;
  border:1px solid var(--line);
  border-inline-start:4px solid transparent;
  border-radius:var(--radius-md);
  box-shadow:var(--shadow);
  overflow:hidden;
  opacity:0;
  transform:translateY(-14px) scale(.97);
  animation:toastIn .35s var(--ease) forwards;
}
.toast.toast-hide{
  animation:toastOut .25s var(--ease) forwards;
}
.toast-error{
  animation:toastInShake .5s var(--ease) forwards;
}

.toast-icon{
  flex:none;
  width:30px;height:30px;
  border-radius:50%;
  display:grid;place-items:center;
  color:#fff;
  margin-top:1px;
}
.toast-icon svg{width:16px;height:16px;}

.toast-body{flex:1;min-width:0;}
.toast-title{
  margin:0;
  font-family:'Vazirmatn', sans-serif;
  font-size:13.5px;
  font-weight:600;
  line-height:1.7;
  color:var(--ink);
}

.toast-close{
  flex:none;
  border:0;background:transparent;
  color:var(--ink-soft);
  width:22px;height:22px;border-radius:50%;
  display:grid;place-items:center;
  transition:background .2s,color .2s;
}
.toast-close svg{width:12px;height:12px;}
.toast-close:hover{background:var(--cream-2);color:var(--ink);}

.toast-progress{
  position:absolute;bottom:0;right:0;left:0;height:3px;
  background:rgba(44,18,80,.08);
}
.toast-progress i{
  display:block;height:100%;width:100%;
  transform-origin:right;
  animation:toastProgress linear forwards;
}

.toast-success{border-inline-start-color:#22a55e;background:linear-gradient(0deg,#f2fbf6,#f2fbf6),#fff;}
.toast-success .toast-icon{background:#22a55e;}
.toast-success .toast-progress i{background:#22a55e;}

.toast-error{border-inline-start-color:#c34376;background:linear-gradient(0deg,#fdf1f5,#fdf1f5),#fff;}
.toast-error .toast-icon{background:#c34376;}
.toast-error .toast-progress i{background:#c34376;}
.toast-error .toast-title{color:#8a2452;}

.toast-warning{border-inline-start-color:#d98c2b;background:linear-gradient(0deg,#fdf6ec,#fdf6ec),#fff;}
.toast-warning .toast-icon{background:#d98c2b;}
.toast-warning .toast-progress i{background:#d98c2b;}

.toast-info{border-inline-start-color:var(--wine-800);background:linear-gradient(0deg,#f8f1ff,#f8f1ff),#fff;}
.toast-info .toast-icon{background:var(--wine-800);}
.toast-info .toast-progress i{background:var(--wine-800);}

.toast-loading{border-inline-start-color:var(--wine-900);}
.toast-loading .toast-icon{background:var(--wine-900);}
.toast-loading .toast-icon svg{animation:toastSpin .8s linear infinite;}
.toast-loading .toast-progress{display:none;}

@keyframes toastIn{to{opacity:1;transform:translateY(0) scale(1);}}
@keyframes toastInShake{
  0%{opacity:0;transform:translateY(-14px) scale(.97);}
  55%{opacity:1;transform:translateY(0) scale(1);}
  70%{transform:translateX(-4px);}
  85%{transform:translateX(3px);}
  100%{transform:translateX(0);}
}
@keyframes toastOut{to{opacity:0;transform:translateY(-10px) scale(.97);}}
@keyframes toastProgress{from{transform:scaleX(1);}to{transform:scaleX(0);}}
@keyframes toastSpin{to{transform:rotate(360deg);}}

@media (prefers-reduced-motion: reduce){
  .toast,.toast.toast-hide,.toast-icon svg,.toast-progress i{animation-duration:.001ms !important;}
}

@media (max-width:500px){
  .toast-container{top:10px;width:94vw;}
  .toast{padding:12px 12px 14px 10px;}
}
