/* SA E/1–E/6 Arabic guided paywall — ui-us.pen E/* luxury gold */

:root {
  --design-w: 402;
  --design-h: 822;
  --color-title: #ffffff;
  --color-subtitle: rgba(255, 255, 255, 0.87);
  --color-cta: #c79b43;
  --color-cta-text: #ffffff;
  --font: "SF Arabic", "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --native-safe-top: 0px;
  --native-safe-right: 0px;
  --native-safe-bottom: 0px;
  --native-safe-left: 0px;
  --safe-top: max(var(--native-safe-top), env(safe-area-inset-top, 0px));
  --safe-right: max(var(--native-safe-right), env(safe-area-inset-right, 0px));
  --safe-bottom: max(var(--native-safe-bottom), env(safe-area-inset-bottom, 0px));
  --safe-left: max(var(--native-safe-left), env(safe-area-inset-left, 0px));
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --page-ms: 480ms;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  font-family: var(--font);
  background: #1a1410;
  color: var(--color-title);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  overflow: hidden;
}

/* Hide stage until images are preloaded (avoids empty-image flash). */
html:not(.is-assets-ready) .stage {
  opacity: 0;
}

html.is-assets-ready .stage {
  opacity: 1;
}


.stage {
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.phone {
  width: 100%;
  height: 100%;
  position: relative;
}

.paywall {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2a2118;
  isolation: isolate;
  --u: calc(100% / var(--design-w));
  --v: calc(100% / var(--design-h));
}

.feature-stack {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: opacity var(--page-ms) var(--ease-out);
}

.paywall.is-pro .feature-stack {
  opacity: 0;
  pointer-events: none;
}

.feature {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-18px) scale(0.985);
  transition:
    opacity var(--page-ms) var(--ease-out),
    transform var(--page-ms) var(--ease-out),
    visibility 0s linear var(--page-ms);
  content-visibility: hidden;
  contain: layout paint style;
}

.feature.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity var(--page-ms) var(--ease-out),
    transform var(--page-ms) var(--ease-out),
    visibility 0s linear 0s;
  content-visibility: visible;
}

.feature.is-exit-left {
  opacity: 0;
  visibility: visible;
  transform: translateX(22px) scale(0.985);
}

.feature.is-enter-right {
  opacity: 0;
  transform: translateX(-28px) scale(0.99);
}

.feature__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.feature__bg-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.feature.is-active .feature__bg-img {
  animation: heroIn 0.55s var(--ease-out) both;
}

.feature__shade {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(486 * var(--v));
  height: calc(336 * var(--v));
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(20, 12, 8, 0.78) 0%,
    rgba(20, 12, 8, 0.35) 45%,
    transparent 100%
  );
}

.feature__copy {
  position: absolute;
  left: 0;
  right: 0;
  /* Sit above Continue footer (button + dots + pad ≈ 110px) */
  top: auto;
  bottom: calc(118px + var(--safe-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 calc(26 * var(--u));
  text-align: center;
  pointer-events: none;
}

.feature.is-active .feature__copy {
  animation: contentIn 0.65s var(--ease-out) 0.06s both;
}

.feature__title {
  margin: 0;
  max-width: 370px;
  width: 100%;
  color: var(--color-title);
  font-size: clamp(24px, 7.5vw, 30px);
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.feature__subtitle {
  margin: 10px 0 0;
  max-width: 350px;
  color: var(--color-subtitle);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

/* E/5 long title — design fs26; keep clear of CTA */
.feature[data-step="4"] .feature__title {
  font-size: clamp(22px, 6.5vw, 26px);
  max-width: 375px;
}

.feature[data-step="4"] .feature__subtitle {
  margin-top: 8px;
  max-width: 316px;
}

.paywall__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 calc(28 * var(--u)) max(18px, calc(var(--safe-bottom) + 14px));
  transition:
    opacity var(--page-ms) var(--ease-out),
    transform var(--page-ms) var(--ease-out);
}

.paywall__footer--continue {
  gap: 12px;
}

.paywall.is-pro .paywall__footer--continue {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.paywall__dots {
  display: flex;
  flex-direction: row-reverse;
  gap: 6px;
  align-items: center;
  justify-content: center;
  height: 10px;
}

.paywall__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition:
    width 0.28s var(--ease-out),
    background 0.28s ease;
}

.paywall__dot.is-active {
  width: 16px;
  background: var(--color-cta);
}

.paywall__cta {
  position: relative;
  width: min(346px, 100%);
  height: 56px;
  min-height: 56px;
  border: 0;
  border-radius: 28px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-cta-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  background: var(--color-cta);
  box-shadow: 0 12px 24px rgba(120, 80, 30, 0.35);
  transition: transform 0.18s var(--ease-out);
}

.paywall__cta--trial {
  width: 100%;
  max-width: 346px;
  font-size: 13px;
  font-weight: 800;
}

.paywall__cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 65%
  );
  transform: translateX(120%);
  animation: ctaShimmer 3.6s ease-in-out 1.2s infinite;
  pointer-events: none;
}

.paywall__cta-label,
.paywall__cta-spinner {
  position: relative;
  z-index: 1;
}

.paywall__cta:active {
  transform: scale(0.975);
}

.paywall__cta[disabled],
.paywall.is-busy .paywall__cta--trial {
  cursor: progress;
}

.paywall__cta-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.paywall.is-busy .paywall__cta-spinner {
  display: inline-block;
}

.paywall__legal {
  margin: 12px 0 0;
  color: rgba(255, 248, 230, 0.72);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.paywall__close {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: max(14px, calc(var(--safe-left) + 10px));
  right: auto;
  z-index: 20;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #5a4030;
  background: rgba(255, 248, 240, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.paywall__close:not([hidden]) {
  opacity: 1;
  transform: scale(1);
}

.paywall__error {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: max(88px, calc(var(--safe-bottom) + 88px));
  z-index: 15;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 18, 10, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.paywall__error[hidden] {
  display: none;
}

/* E/6 PRO sheet over luxury portrait */
.pro {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.98);
  pointer-events: none;
  transition:
    opacity var(--page-ms) var(--ease-out),
    transform var(--page-ms) var(--ease-out),
    visibility 0s linear var(--page-ms);
}

.paywall.is-pro .pro {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition:
    opacity var(--page-ms) var(--ease-out),
    transform var(--page-ms) var(--ease-out),
    visibility 0s linear 0s;
}

.pro__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.pro__bg-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  user-select: none;
  -webkit-user-drag: none;
}

.pro__sheet {
  position: relative;
  z-index: 1;
  margin-top: auto;
  width: 100%;
  padding:
    28px calc(28 * var(--u))
    max(16px, calc(var(--safe-bottom) + 14px));
  border-radius: 28px 28px 0 0;
  background: linear-gradient(
    180deg,
    rgba(255, 248, 235, 0.96) 0%,
    rgba(250, 240, 220, 0.98) 100%
  );
  border-top: 1px solid rgba(199, 155, 67, 0.35);
  box-shadow: 0 -16px 40px rgba(40, 24, 10, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pro__title {
  margin: 0;
  color: #c79b43;
  font-size: 20px;
  font-weight: 900;
}

.pro__subtitle {
  margin: 8px 0 0;
  color: #c79b43;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
}

.pro__benefits {
  width: 100%;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pro__benefit {
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(199, 155, 67, 0.25);
  color: #3a2520;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
}

.pro__footer {
  width: 100%;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pro .paywall__legal {
  color: #6b5145;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes contentIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ctaShimmer {
  0%,
  55% {
    transform: translateX(120%);
  }
  80%,
  100% {
    transform: translateX(-120%);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .feature,
  .pro,
  .feature__bg-img,
  .feature.is-active .feature__copy,
  .paywall__cta::before {
    animation: none !important;
    transition: none !important;
  }
}
