/**
 * ARTIC unified action feedback — Microsoft-style busy states, toasts, overlays.
 * UPS brown/gold theme; loads after artic-shell.css.
 */

/* ── Inline button spinner ── */
.artic-btn-busy {
  position: relative;
  pointer-events: none;
  opacity: 0.82;
}

.artic-btn-busy > .artic-btn-label {
  visibility: hidden;
}

.artic-btn-busy::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.05rem;
  height: 1.05rem;
  margin: -0.525rem 0 0 -0.525rem;
  border: 2px solid rgba(53, 28, 21, 0.22);
  border-top-color: var(--ups-brown, #351c15);
  border-radius: 50%;
  animation: artic-spin 0.65s linear infinite;
}

.btn-primary.artic-btn-busy::after {
  border-color: rgba(53, 28, 21, 0.25);
  border-top-color: var(--ups-text-on-gold, #351c15);
}

.site-header .btn.artic-btn-busy::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: var(--ups-gold, #ffb500);
}

@keyframes artic-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Unified toast ── */
.artic-toast {
  position: fixed;
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(0.75rem);
  z-index: 1400;
  max-width: min(92vw, 26rem);
  padding: 0.65rem 1.05rem;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.artic-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.artic-toast.is-ok {
  background: #1a4d2e;
  color: #e8f8ee;
  border: 1px solid rgba(120, 220, 160, 0.35);
}

.artic-toast.is-error {
  background: #4a1515;
  color: #ffe8e8;
  border: 1px solid rgba(255, 140, 140, 0.35);
}

.artic-toast.is-info {
  background: rgba(53, 28, 21, 0.94);
  color: #fff8e8;
  border: 1px solid rgba(255, 181, 0, 0.45);
}

.artic-toast[hidden] {
  display: none !important;
}

/* ── Page overlay (API / OCR / login restore) ── */
.artic-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(26, 15, 12, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.artic-busy-overlay[hidden] {
  display: none !important;
}

.artic-busy-card {
  width: min(22rem, 100%);
  padding: 1.35rem 1.25rem 1.15rem;
  border-radius: 12px;
  background: #fffaf2;
  border-top: 4px solid var(--ups-gold, #ffb500);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
  text-align: center;
}

.artic-busy-spinner {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto 0.85rem;
  border: 3px solid rgba(53, 28, 21, 0.14);
  border-top-color: var(--ups-gold, #ffb500);
  border-radius: 50%;
  animation: artic-spin 0.7s linear infinite;
}

.artic-busy-message {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ups-brown, #351c15);
}

.artic-busy-progress {
  margin-top: 0.85rem;
  height: 5px;
  border-radius: 999px;
  background: rgba(53, 28, 21, 0.12);
  overflow: hidden;
}

.artic-busy-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ups-gold, #ffb500), #ffc940);
  transition: width 0.25s ease;
}

.artic-busy-progress.is-indeterminate .artic-busy-progress-bar {
  width: 38% !important;
  animation: artic-progress-slide 1.1s ease-in-out infinite;
}

@keyframes artic-progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* ── Status pill (inline / SW refresh) ── */
.artic-status-pill {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(53, 28, 21, 0.94);
  color: #fff8e8;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.artic-status-pill.is-visible {
  opacity: 1;
}

.artic-status-pill[hidden] {
  display: none !important;
}

.artic-status-pill.is-loading::before {
  content: '';
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--ups-gold, #ffb500);
  border-radius: 50%;
  animation: artic-spin 0.65s linear infinite;
  flex-shrink: 0;
}

/* Profile page reuses artic-toast via artic-busy.js delegation */
