/* ════════════════════════════════════════════════════════════════════
   Unified Paywall — hilel.link
   Used by Paywall.open() from portal/js/paywall.js.
   Brand tokens come from portal/css/design-system.css (must be loaded
   first); we fall back to literal hex values for pages that don't use
   the full design system (e.g. links.html, calculator.html).
   ════════════════════════════════════════════════════════════════════ */

.hl-paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 26, 0.85);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: hl-paywall-fade 200ms ease;
}

@keyframes hl-paywall-fade { from { opacity: 0 } to { opacity: 1 } }

.hl-paywall-box {
  background: var(--bg-card, #130826);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 22px);
  padding: 32px 28px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  text-align: center;
  color: var(--text, #fbf8fc);
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  font-family: 'Heebo', Arial, sans-serif;
}

.hl-paywall-close {
  position: absolute;
  top: 12px;
  left: 12px;            /* RTL: close button goes top-left */
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #fbf8fc);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.hl-paywall-close:hover,
.hl-paywall-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: 2px solid var(--purple-light, #c966e8);
  outline-offset: 2px;
}

.hl-paywall-title {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--gold, #c9a84c), var(--gold-light, #e8d088));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hl-paywall-sub {
  margin: 0 0 24px;
  color: var(--text-muted, #c9b8d4);
  font-size: 15px;
  line-height: 1.6;
}

.hl-paywall-tiles {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

@media (min-width: 540px) {
  .hl-paywall-tiles { grid-template-columns: 1fr 1fr; }
  .hl-paywall-tiles .hl-paywall-tile.is-wide { grid-column: 1 / -1; }
}

.hl-paywall-tile {
  display: block;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px 16px;
  color: inherit;
  text-align: right;     /* RTL */
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  position: relative;
  cursor: pointer;
}
.hl-paywall-tile:hover,
.hl-paywall-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--purple-light, #c966e8);
  background: rgba(201, 102, 232, 0.08);
  outline: none;
}

.hl-paywall-tile.is-best {
  border-color: var(--gold, #c9a84c);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(232, 208, 136, 0.04));
}

.hl-paywall-badge {
  position: absolute;
  top: -10px;
  right: 12px;       /* RTL */
  background: linear-gradient(135deg, var(--gold, #c9a84c), var(--gold-light, #e8d088));
  color: #0a0118;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 999px;
}

.hl-paywall-tile-name { font-weight: 600; font-size: 17px; margin: 0 0 4px }
.hl-paywall-tile-price {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-light, #c966e8), var(--accent, #d97af5));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 6px 0 4px;
}
.hl-paywall-tile-price small { font-size: 13px; font-weight: 400; color: var(--text-muted, #c9b8d4); -webkit-text-fill-color: var(--text-muted, #c9b8d4) }
.hl-paywall-tile-desc { font-size: 13px; color: var(--text-muted, #c9b8d4); line-height: 1.5; margin: 0 }

.hl-paywall-signin {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(133, 4, 162, 0.12);
  border: 1px solid rgba(201, 102, 232, 0.3);
  font-size: 14px;
  color: var(--text-muted, #c9b8d4);
}
.hl-paywall-signin a {
  color: var(--purple-light, #c966e8);
  font-weight: 600;
  text-decoration: underline;
}

.hl-paywall-footer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted, #c9b8d4);
  line-height: 1.6;
}
.hl-paywall-footer a { color: var(--purple-light, #c966e8); text-decoration: underline; }

/* Lock background scroll when paywall is open */
body.hl-paywall-open { overflow: hidden; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hl-paywall-overlay { animation: none; }
  .hl-paywall-tile { transition: none; }
}
