:root {
  --wdl-accent: #6a2bac;
  --wdl-accent-2: #21cbcb;
  --wdl-text: #1a1d2e;
  --wdl-muted: #6b7080;
  --wdl-surface: #ffffff;
  --wdl-success: #0f9b6b;
  --wdl-danger: #dc2626;
  --wdl-warning: #d97706;
}

#wd-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 20010;
  background: linear-gradient(90deg, var(--wdl-accent), var(--wdl-accent-2));
  box-shadow: 0 0 10px rgba(106, 43, 172, .55);
  opacity: 0;
  transition: width .25s ease, opacity .3s ease;
  pointer-events: none;
}
#wd-progress.is-active { opacity: 1; }

#wd-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(247, 248, 252, .72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility 0s linear .18s;
}
#wd-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity .18s ease;
}
.wd-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 220px;
  max-width: 92vw;
  padding: 26px 30px 22px;
  background: var(--wdl-surface);
  border: 1px solid #e3e6f0;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(26, 29, 46, .14), 0 2px 6px rgba(26, 29, 46, .06);
  transform: translateY(6px) scale(.98);
  transition: transform .2s ease;
}
#wd-overlay.is-visible .wd-overlay-card { transform: none; }
.wd-overlay-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--wdl-text);
  letter-spacing: .1px;
  text-align: center;
}
.wd-overlay-sub {
  font-size: 11.5px;
  color: var(--wdl-muted);
  margin-top: -8px;
  text-align: center;
}

.wd-ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--wdl-accent) 0 65%, rgba(106, 43, 172, .12) 65% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: wd-rotate .9s linear infinite;
}

.wd-spin {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -.15em;
  animation: wd-rotate .7s linear infinite;
  flex-shrink: 0;
}
.wd-spin + span { margin-left: 7px; }

.wd-btn-loading,
.btn.wd-btn-loading,
a.wd-btn-loading {
  pointer-events: none;
  opacity: .85;
  cursor: progress;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

html.wd-loading,
html.wd-loading body { cursor: progress; }

#wd-toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20020;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.wd-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: #1a1d2e;
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 8px 28px rgba(26, 29, 46, .22);
  border-left: 4px solid var(--wdl-accent);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.wd-toast.is-in { opacity: 1; transform: none; }
.wd-toast-success { border-left-color: var(--wdl-success); }
.wd-toast-error { border-left-color: var(--wdl-danger); }
.wd-toast-warning { border-left-color: var(--wdl-warning); }
.wd-toast i { margin-top: 2px; opacity: .9; }

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

@media (max-width: 576px) {
  #wd-toasts { left: 16px; right: 16px; bottom: 14px; max-width: none; }
  .wd-overlay-card { min-width: 0; width: 100%; max-width: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .wd-ring, .wd-spin { animation-duration: 1.6s; }
  #wd-overlay, .wd-overlay-card, .wd-toast { transition: none; }
}
