/* Universal interactive feedback for buttons + form submits + toast container.
   Loaded on every layout. Targets bare <button> and [type=submit]/[type=button]
   so existing Tailwind utility classes don't need to be edited. */

button,
[type="submit"],
[type="button"] {
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  user-select: none;
}

button:hover:not(:disabled),
[type="submit"]:hover:not(:disabled),
[type="button"]:hover:not(:disabled) {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

button:active:not(:disabled),
[type="submit"]:active:not(:disabled),
[type="button"]:active:not(:disabled) {
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}

button:focus-visible,
[type="submit"]:focus-visible,
[type="button"]:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3993ff;
  outline-offset: 2px;
  border-radius: 6px;
}

button:disabled,
[type="submit"]:disabled,
[type="button"]:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.sr-spinner {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: sr-spin 0.7s linear infinite;
  vertical-align: -0.16em;
  margin-right: 0.4em;
}
@keyframes sr-spin { to { transform: rotate(360deg); } }

/* Toast — bottom-right slide-in */
.sr-toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.sr-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.35;
  background: #0a0a0d;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
  max-width: 380px;
  transform: translateY(8px);
  opacity: 0;
  animation: sr-toast-in 220ms ease-out forwards;
}
.sr-toast__message {
  flex: 1;
  min-width: 0;
}
.sr-toast__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  opacity: 0.85;
}
.sr-toast__close:hover {
  background: rgba(255, 255, 255, 0.16);
  opacity: 1;
}
.sr-toast--ok {
  background: linear-gradient(135deg, #047857, #065f46);
}
.sr-toast--err {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
}
.sr-toast--out {
  animation: sr-toast-out 260ms ease-in forwards;
}
@keyframes sr-toast-in {
  to { transform: translateY(0); opacity: 1; }
}
@keyframes sr-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}
