:root {
  --ts-popup-overlay: rgba(8, 28, 53, 0.35);
  --ts-popup-card-bg: #ffffff;
  --ts-popup-shadow: 0 20px 45px rgba(15, 32, 67, 0.18);
  --ts-popup-success: #22c55e;
  --ts-popup-error: #ef4444;
  --ts-popup-text: #1f2937;
  --ts-popup-muted: #6b7280;
}

body.ts-popup-open {
  overflow: hidden;
}

.ts-popup-overlay {
  position: fixed;
  inset: 0;
  background: var(--ts-popup-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}

.ts-popup-card {
  width: min(360px, 92vw);
  background: var(--ts-popup-card-bg);
  color: var(--ts-popup-text);
  border-radius: 18px;
  box-shadow: var(--ts-popup-shadow);
  text-align: center;
  padding: 26px 24px 22px;
  animation: ts-popup-in 180ms ease-out;
}

.ts-popup-icon {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.ts-popup-icon svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ts-popup-card--success .ts-popup-icon {
  color: var(--ts-popup-success);
  background: rgba(34, 197, 94, 0.12);
}

.ts-popup-card--error .ts-popup-icon {
  color: var(--ts-popup-error);
  background: rgba(239, 68, 68, 0.12);
}

.ts-popup-title {
  font-size: 20px;
  font-weight: 700;
  margin: 2px 0 8px;
}

.ts-popup-message {
  font-size: 14px;
  color: var(--ts-popup-muted);
  margin: 0 0 18px;
  line-height: 1.45;
}

.ts-popup-button {
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 13px;
  color: #ffffff;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.ts-popup-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ts-popup-button:active {
  transform: scale(0.98);
}

.ts-popup-card--success .ts-popup-button {
  background: var(--ts-popup-success);
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.25);
}

.ts-popup-card--error .ts-popup-button {
  background: var(--ts-popup-error);
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25);
}

.ts-popup-button--secondary {
  color: #1f2937;
  background: #eef2f7;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.14);
}

.ts-popup-spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 28, 53, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.ts-popup-spinner {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  animation: ts-spin 0.9s linear infinite;
}

@keyframes ts-popup-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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