.site-popup-stack {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.site-popup-stack[hidden] {
  display: none !important;
}

.site-popup-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-popup-dialog {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.site-popup-card {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  transform:
    translate(
      calc(var(--site-popup-depth, 0) * 14px),
      calc(var(--site-popup-depth, 0) * 14px)
    );
  transform-origin: center;
  transition: transform .18s ease, opacity .18s ease;
}

.site-popup-dialog.is-top .site-popup-card {
  pointer-events: auto;
}

.site-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #334155;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 2px 12px rgba(15, 23, 42, .12);
}

.site-popup-image {
  display: block;
  width: 100%;
  max-height: 42vh;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 20px 20px 0 0;
}

.site-popup-content {
  padding: 26px 28px 20px;
}

.site-popup-title {
  margin: 0 42px 14px 0;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 800;
  line-height: 1.3;
}

.site-popup-body {
  color: #334155;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.site-popup-link {
  margin-top: 20px;
}

.professional-trial-popup-card {
  border-color: rgba(79, 70, 229, .18);
  background:
    radial-gradient(circle at 100% 0, rgba(139, 92, 246, .16), transparent 38%),
    linear-gradient(145deg, #fff, #f8f7ff);
}

.professional-trial-popup-badge {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: .82rem;
  font-weight: 800;
}

.site-popup-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
}

.site-popup-actions .btn-link {
  color: #64748b;
  text-decoration: none;
}

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

@media (max-width: 600px) {
  .site-popup-dialog {
    padding: 12px;
  }

  .site-popup-card {
    width: min(100%, calc(100vw - 24px));
    max-height: 86vh;
    border-radius: 16px;
    transform:
      translate(
        calc(var(--site-popup-depth, 0) * 8px),
        calc(var(--site-popup-depth, 0) * 10px)
      );
  }

  .site-popup-image {
    max-height: 36vh;
    border-radius: 16px 16px 0 0;
  }

  .site-popup-content {
    padding: 22px 20px 16px;
  }

  .site-popup-actions {
    padding: 12px 14px;
  }
}

@media print {
  .site-popup-stack {
    display: none !important;
  }
}
