/* ==========================================================================
   共享 UI：Toast
   由 login.html / dashboard.html 共用
   ========================================================================== */

.toast-viewport {
  position: fixed;
  top: calc(var(--safe-top) + 14px);
  left: 50%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 14px 32px -14px rgba(26, 27, 46, 0.4);
  font-size: 12.5px;
  line-height: 1.5;
  animation: toast-in 0.22s ease both;
  pointer-events: auto;
}

.toast.is-closing {
  animation: toast-out 0.2s ease both;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.toast--error {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff5f5;
  color: #9f1d24;
}

.toast--error .toast-icon {
  background: #dc5454;
}

.toast--success {
  border-color: rgba(5, 150, 105, 0.26);
  background: #f1fff7;
  color: #166534;
}

.toast--success .toast-icon {
  background: var(--success);
}

.toast--info {
  border-color: rgba(37, 99, 235, 0.24);
  background: #f2f8ff;
  color: #1d4e89;
}

.toast--info .toast-icon {
  background: #3e7cb1;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}
