/* ─────────────────────────────────────────────────────────────────────────────
   Viewer Plan Paywall Modal — Task #1599876
   Triggers when a free user hits a blur gate on settlement details,
   guides, or any gated content. Shows $4.99/mo offer first; on dismiss
   slides in a 50% annual deal ($2.50/mo).

   Philosophy: exclusive / community-first, not nagging.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Backdrop ──────────────────────────────────────────────────────────────── */
#sr-viewer-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#sr-viewer-modal-backdrop.sr-vm-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal card ────────────────────────────────────────────────────────────── */
#sr-viewer-modal {
  position: relative;
  background: #0f1117;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: 40px 36px 36px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0,0,0,0.64), 0 0 0 1px rgba(255,255,255,0.04);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  overflow: hidden;
}
#sr-viewer-modal-backdrop.sr-vm-visible #sr-viewer-modal {
  transform: translateY(0) scale(1);
}

/* Subtle gradient accent at top */
#sr-viewer-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #059669 0%, #10b981 50%, #34d399 100%);
  border-radius: 20px 20px 0 0;
}

/* ── Close button ──────────────────────────────────────────────────────────── */
.sr-vm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.07);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  line-height: 1;
  transition: background 0.18s, color 0.18s;
  z-index: 1;
}
.sr-vm-close:hover {
  background: rgba(255,255,255,0.13);
  color: #fff;
}

/* ── Eyebrow ───────────────────────────────────────────────────────────────── */
.sr-vm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.24);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 18px;
}

/* ── Headline ──────────────────────────────────────────────────────────────── */
.sr-vm-headline {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.sr-vm-headline em {
  font-style: normal;
  color: #34d399;
}

/* ── Body ──────────────────────────────────────────────────────────────────── */
.sr-vm-body {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.55;
  margin: 0 0 24px;
}

/* ── Feature list ──────────────────────────────────────────────────────────── */
.sr-vm-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sr-vm-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
}
.sr-vm-features li::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: rgba(16, 185, 129, 0.18);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 8.5l2.5 2.5 5-6' stroke='%2310b981' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

/* ── Price block (monthly offer) ──────────────────────────────────────────── */
.sr-vm-price-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sr-vm-price-amount {
  font-size: 1.9rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}
.sr-vm-price-amount small {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0;
}
.sr-vm-price-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  text-align: right;
  max-width: 160px;
}

/* ── Primary CTA ───────────────────────────────────────────────────────────── */
.sr-vm-cta-primary {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 4px 20px rgba(16,185,129,0.28);
  margin-bottom: 12px;
}
.sr-vm-cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(16,185,129,0.38);
  color: #fff;
  text-decoration: none;
}

/* ── Dismiss link ──────────────────────────────────────────────────────────── */
.sr-vm-dismiss {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  width: 100%;
  transition: color 0.18s;
}
.sr-vm-dismiss:hover { color: rgba(255,255,255,0.6); }

/* ════════════════════════════════════════════════════════════════════════════
   ANNUAL UPSELL SLIDE-IN
   Appears after user dismisses the monthly offer.
   ════════════════════════════════════════════════════════════════════════════ */

#sr-viewer-annual-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#sr-viewer-annual-backdrop.sr-va-visible {
  opacity: 1;
  pointer-events: auto;
}

#sr-viewer-annual-sheet {
  background: #0f1117;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px 20px 0 0;
  padding: 28px 28px 36px;
  max-width: 480px;
  width: 100%;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}
#sr-viewer-annual-backdrop.sr-va-visible #sr-viewer-annual-sheet {
  transform: translateY(0);
}

/* Drag handle */
#sr-viewer-annual-sheet::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.sr-va-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.24);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
  margin-top: 10px;
}

.sr-va-headline {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.sr-va-headline em {
  font-style: normal;
  color: #fbbf24;
}

.sr-va-sub {
  font-size: 0.87rem;
  color: rgba(255,255,255,0.55);
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Crossed-out monthly price vs annual deal */
.sr-va-pricing-compare {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 12px;
}
.sr-va-was {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-decoration: line-through;
}
.sr-va-arrow {
  color: rgba(255,255,255,0.25);
  font-size: 1.1rem;
}
.sr-va-now {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.02em;
}
.sr-va-now small {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0;
}
.sr-va-badge {
  margin-left: auto;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 100px;
  white-space: nowrap;
}

/* Annual CTA */
.sr-va-cta {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #0f1117;
  font-weight: 800;
  font-size: 0.97rem;
  text-align: center;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 4px 20px rgba(245,158,11,0.25);
  margin-bottom: 12px;
}
.sr-va-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(245,158,11,0.38);
  color: #0f1117;
  text-decoration: none;
}

.sr-va-dismiss {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  width: 100%;
  transition: color 0.18s;
}
.sr-va-dismiss:hover { color: rgba(255,255,255,0.55); }

/* ── Secondary link (See annual plan) ─────────────────────────────────────── */
.sr-vm-secondary-link {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  margin-bottom: 2px;
  transition: color 0.18s;
  text-decoration: underline;
}
.sr-vm-secondary-link:hover { color: rgba(255,255,255,0.7); }

/* ── Mobile tweaks ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #sr-viewer-modal {
    padding: 32px 22px 28px;
    border-radius: 16px;
  }
  .sr-vm-headline { font-size: 1.35rem; }
  .sr-vm-price-amount { font-size: 1.65rem; }
  .sr-va-headline { font-size: 1.2rem; }
}

/* ════════════════════════════════════════════════════════════════════════════
   STEP 2: EXIT-INTENT POPUP — Task #1600181
   Warmer, more personal tone. Triggered when user dismisses Step 1 or
   moves mouse out of viewport. "We're actually losing money" angle.
   ════════════════════════════════════════════════════════════════════════════ */

#sr-viewer-exit-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#sr-viewer-exit-backdrop.sr-ve-visible {
  opacity: 1;
  pointer-events: auto;
}

#sr-viewer-exit-sheet {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px 24px 0 0;
  padding: 32px 28px 40px;
  max-width: 480px;
  width: 100%;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}
#sr-viewer-exit-backdrop.sr-ve-visible #sr-viewer-exit-sheet {
  transform: translateY(0);
}

/* Drag handle */
#sr-viewer-exit-sheet::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
}

/* Close button */
.sr-ve-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  font-size: 16px;
  line-height: 1;
  transition: background 0.18s, color 0.18s;
  z-index: 1;
}
.sr-ve-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

.sr-ve-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.22);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
  margin-top: 10px;
}

.sr-ve-headline {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.sr-ve-body {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin: 0 0 22px;
}

/* Price compare */
.sr-ve-pricing-compare {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 12px;
}
.sr-ve-was {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.28);
  text-decoration: line-through;
}
.sr-ve-arrow { color: rgba(255,255,255,0.22); font-size: 1rem; }
.sr-ve-now {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.02em;
}
.sr-ve-now small {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0;
}
.sr-ve-badge {
  margin-left: auto;
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 100px;
  white-space: nowrap;
}

/* Annual primary CTA */
.sr-ve-cta-primary {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #0f1117;
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 4px 20px rgba(245,158,11,0.25);
  margin-bottom: 8px;
}
.sr-ve-cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(245,158,11,0.38);
  color: #0f1117;
  text-decoration: none;
}

.sr-ve-billing-note {
  text-align: center;
  font-size: 0.74rem;
  color: rgba(255,255,255,0.3);
  margin: 0 0 10px;
}

/* Monthly secondary CTA */
.sr-ve-cta-secondary {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.87rem;
  color: rgba(255,255,255,0.55);
  text-decoration: underline;
  padding: 6px;
  margin-bottom: 10px;
  transition: color 0.18s;
}
.sr-ve-cta-secondary:hover { color: rgba(255,255,255,0.8); text-decoration: underline; }

.sr-ve-dismiss {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.25);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  transition: color 0.18s;
}
.sr-ve-dismiss:hover { color: rgba(255,255,255,0.5); }

/* ════════════════════════════════════════════════════════════════════════════
   STEP 3: LAST-CHANCE TOAST — Task #1600181
   Anchored bottom of screen. Shows once, then 24h cooldown.
   ════════════════════════════════════════════════════════════════════════════ */

#sr-viewer-toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 24px));
  z-index: 9600;
  background: #0f3460;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 14px;
  padding: 12px 16px 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(251,191,36,0.1);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease;
  opacity: 0;
}
#sr-viewer-toast.sr-vt-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.sr-vt-text {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.82);
  font-weight: 600;
  flex: 1;
  line-height: 1.35;
}

.sr-vt-cta {
  flex-shrink: 0;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #0f1117;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 9px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.16s;
}
.sr-vt-cta:hover { opacity: 0.88; color: #0f1117; text-decoration: none; }

.sr-vt-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.18s;
}
.sr-vt-close:hover { color: rgba(255,255,255,0.65); }

/* ── Mobile tweaks (Step 2 + 3) ────────────────────────────────────────────── */
@media (max-width: 480px) {
  #sr-viewer-exit-sheet {
    padding: 28px 20px 36px;
    border-radius: 20px 20px 0 0;
  }
  .sr-ve-headline { font-size: 1.18rem; }
  #sr-viewer-toast {
    bottom: 12px;
    border-radius: 12px;
    padding: 10px 12px 10px 14px;
    gap: 8px;
  }
  .sr-vt-text { font-size: 0.82rem; }
  .sr-vt-cta { font-size: 0.78rem; padding: 7px 11px; }
}
