/*
 * CBAT.ui.toast() styling — TK-2026-01234.
 *
 * One floating toast, theme-aware + a11y-safe. Message text is --cbat-text
 * (AA in both themes); the semantic (success/error/info) is carried by a
 * colored left border + a tinted background, never by the text color.
 */
.cbat-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.cbat-toast {
  pointer-events: auto;
  min-width: 200px;
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 4px;
  border-left: 4px solid var(--cbat-border);
  background: var(--cbat-bg-secondary);
  color: var(--cbat-text);
  font-size: var(--cbat-font-size-sm);
  font-weight: 600;
  box-shadow: 0 2px 8px var(--cbat-modal-overlay);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Tint by mixing the SOLID semantic color into the opaque secondary bg — the
   --*-bg tokens are low-alpha rgba, so mixing those would leave the toast
   translucent and break the --cbat-text contrast guarantee. 15% keeps it
   opaque + legible in both themes. */
.cbat-toast--success {
  border-left-color: var(--success);
  background: color-mix(in srgb, var(--success) 15%, var(--cbat-bg-secondary));
}

.cbat-toast--error {
  border-left-color: var(--error);
  background: color-mix(in srgb, var(--error) 15%, var(--cbat-bg-secondary));
}

.cbat-toast--info {
  border-left-color: var(--info);
  background: color-mix(in srgb, var(--info) 15%, var(--cbat-bg-secondary));
}

.cbat-toast--hiding {
  opacity: 0;
  transform: translateY(8px);
}

@media (prefers-reduced-motion: reduce) {
  .cbat-toast {
    transition: opacity 0.4s ease;
  }
  .cbat-toast--hiding {
    transform: translateY(0);
  }
}
