@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@400;500;600&display=swap');

#rsg-exit-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 18, 40, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999999;
  animation: rsgFadeIn 0.35s ease;
  box-sizing: border-box;
  /* display + exact dimensions set by JS using window.innerWidth/innerHeight */
}

#rsg-exit-overlay.rsg-hidden {
  display: none !important;
}

@keyframes rsgFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes rsgSlideUp {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rsgFadeOut {
  to { opacity: 0; }
}

.rsg-popup {
  background: #ffffff;
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(10, 18, 40, 0.28);
  animation: rsgSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.rsg-popup-header {
  background: linear-gradient(135deg, #0B1F4E 0%, #1a3a7a 60%, #0f2d6b 100%);
  padding: 36px 36px 28px;
  position: relative;
  overflow: hidden;
}

.rsg-popup-header::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(197,164,90,0.18) 0%, transparent 70%);
  border-radius: 50%;
}

.rsg-banner {
  width: 100%;
  background: linear-gradient(90deg, #0B1F4E, #142d6e, #0B1F4E);
  background-size: 200% 100%;
  animation: rsgBannerShift 4s ease infinite;
  overflow: hidden;
  position: relative;
}

@keyframes rsgBannerShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.rsg-banner::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(197,164,90,0.18) 40%,
    rgba(255,255,255,0.22) 50%,
    rgba(197,164,90,0.18) 60%,
    transparent 100%
  );
  animation: rsgShimmer 2.8s ease infinite;
}

@keyframes rsgShimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

.rsg-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 36px;
  position: relative;
  z-index: 1;
}

.rsg-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C5A45A;
  flex-shrink: 0;
  animation: rsgPulseDot 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(197,164,90,0.6);
}

@keyframes rsgPulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(197,164,90,0.7); transform: scale(1); }
  50%  { box-shadow: 0 0 0 7px rgba(197,164,90,0); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(197,164,90,0); transform: scale(1); }
}

.rsg-banner-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #C5A45A;
  animation: rsgTextGlow 2.8s ease-in-out infinite;
}

@keyframes rsgTextGlow {
  0%, 100% { color: #C5A45A; text-shadow: none; }
  50%       { color: #e0c278; text-shadow: 0 0 12px rgba(197,164,90,0.55); }
}

.rsg-banner-divider {
  width: 1px;
  height: 14px;
  background: rgba(197,164,90,0.35);
  flex-shrink: 0;
}

.rsg-banner-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rsg-popup-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  position: relative;
  z-index: 1;
  max-width: 380px;
  margin: 0;
}

.rsg-popup-header h2 span {
  color: #C5A45A;
}

.rsg-close-x {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255,255,255,0.12);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 2;
  line-height: 1;
  padding: 0;
}

.rsg-close-x:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

.rsg-popup-body {
  padding: 28px 36px 32px;
  font-family: 'DM Sans', sans-serif;
}

.rsg-popup-body p {
  font-size: 15px;
  color: #4a5568;
  line-height: 1.65;
  margin: 0 0 24px;
}

.rsg-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rsg-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #2d3748;
  font-weight: 500;
}

.rsg-benefits li::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-color: #0B1F4E;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23C5A45A'%3E%3Cpath d='M13.485 3.515a.75.75 0 0 1 0 1.06l-6.97 6.97a.75.75 0 0 1-1.06 0L2.515 8.606a.75.75 0 1 1 1.06-1.06L6 10.06l6.424-6.424a.75.75 0 0 1 1.061-.12z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
}

.rsg-cta-btn {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #C5A45A 0%, #d4b870 100%);
  color: #0B1F4E !important;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 16px 24px;
  border-radius: 12px;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 20px rgba(197,164,90,0.35);
  box-sizing: border-box;
}

.rsg-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(197,164,90,0.45);
  color: #0B1F4E !important;
}

/* ── TABLET (541px – 1024px) ── */
@media (min-width: 541px) and (max-width: 1024px) {
  #rsg-exit-overlay { padding: 16px; }
  /* popup width/height set by JS using window.innerWidth */
  .rsg-popup {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .rsg-popup-header { padding: 30px 28px 22px; }
  .rsg-popup-body   { padding: 22px 28px 28px; }
  .rsg-popup-header h2 { font-size: 24px; }
}

/* ── MOBILE (≤540px) ── */
@media (max-width: 540px) {
  #rsg-exit-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  /* popup width/height set by JS using window.innerWidth — avoids 100vw
     including any page horizontal overflow that would push the card off-screen */
  .rsg-popup {
    min-width: 0;
    box-sizing: border-box;
    border-radius: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .rsg-banner-inner {
    padding: 10px 14px;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .rsg-banner-text    { font-size: 11px; letter-spacing: 0.1em; }
  .rsg-banner-sub     { display: none; }
  .rsg-banner-divider { display: none; }
  .rsg-pulse-dot      { width: 8px; height: 8px; flex-shrink: 0; }
  .rsg-popup-header   { padding: 18px 16px 14px; overflow: hidden; }
  .rsg-popup-header h2 { font-size: 19px; max-width: 100%; word-break: break-word; }
  .rsg-close-x        { top: 10px; right: 10px; width: 26px; height: 26px; font-size: 14px; }
  .rsg-popup-body     { padding: 14px 16px 20px; }
  .rsg-popup-body p   { font-size: 13px; line-height: 1.55; margin-bottom: 14px; }
  .rsg-benefits       { gap: 8px; margin-bottom: 16px; }
  .rsg-benefits li    { font-size: 13px; }
  .rsg-cta-btn        { font-size: 14px; padding: 13px 16px; border-radius: 10px; }
}
