/* SA F/1–F/6 Arabic soft guided paywall — ui-us.pen F/* peach CTA */

:root {
  --design-w: 402;
  --design-h: 822;
  --color-title: #5f443e;
  --color-subtitle: #52352e;
  --cta-a: #fe8b90;
  --cta-b: #fdbc8a;
  --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: light;
}

*,
*::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: #f6ebe3;
  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: #f3e6dc;
  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__bg--tall .feature__bg-img {
  object-position: center 22%;
}

.feature__bg--shift .feature__bg-img {
  object-position: center 30%;
}

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

.feature__shade {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(563 * var(--v));
  height: calc(259 * var(--v));
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(255, 245, 235, 0.92) 0%,
    rgba(255, 245, 235, 0.45) 50%,
    transparent 100%
  );
}

.feature__shade--soft {
  background: linear-gradient(
    to top,
    rgba(245, 250, 245, 0.9) 0%,
    rgba(245, 250, 245, 0.4) 50%,
    transparent 100%
  );
}

.feature__copy {
  position: absolute;
  left: 0;
  right: 0;
  /* Design: title y619 / CTA y719.5 — reserve footer + ~16px gap */
  top: auto;
  bottom: calc(120px + var(--safe-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 calc(24 * 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;
}

.feature__subtitle {
  margin: 0;
  max-width: 338px;
  color: var(--color-subtitle);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.feature__copy--green .feature__title {
  color: #3e493d;
}
.feature__copy--green .feature__subtitle {
  color: #5c6b5d;
}

.feature__copy--teal .feature__title {
  color: #073a42;
}
.feature__copy--teal .feature__subtitle {
  color: #155762;
}

.paywall__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Keep ~16px+ air above CTA vs feature copy (design CTA y719.5) */
  padding: 16px 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(95, 68, 62, 0.22);
  transition:
    width 0.28s var(--ease-out),
    background 0.28s ease;
}

.paywall__dot.is-active {
  width: 16px;
  background: linear-gradient(90deg, var(--cta-a), var(--cta-b));
}

.paywall__cta {
  position: relative;
  width: min(346px, 100%);
  height: 56px;
  min-height: 56px;
  border: 1px solid rgba(255, 244, 214, 0.67);
  border-radius: 28px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  background-image: linear-gradient(90deg, var(--cta-a) 0%, var(--cta-b) 100%);
  box-shadow: 0 8px 18px rgba(90, 50, 23, 0.28);
  transition: transform 0.18s var(--ease-out);
}

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

.paywall__cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.35) 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(95, 68, 62, 0.65);
  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, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  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(40, 24, 20, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.paywall__error[hidden] {
  display: none;
}

/* F/6 PRO — design frame fill #5fc5d3; image 402×757; soft bottom fade */
.pro {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.98);
  pointer-events: none;
  /* Design frame fill under the cropped hero */
  background: #5fc5d3;
  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;
  left: 0;
  right: 0;
  top: 0;
  /* Design image height 757 / 822 */
  height: calc(757 * var(--v));
  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;
}

/* Bottom gradient wash over hero → teal base (design soft fade) */
.pro__bottom-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(420 * var(--v));
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    #5fc5d3 0%,
    rgba(95, 197, 211, 0.92) 12%,
    rgba(255, 248, 240, 0.88) 38%,
    rgba(255, 248, 240, 0.55) 58%,
    rgba(255, 248, 240, 0) 100%
  );
}

.pro__card {
  position: relative;
  z-index: 2;
  margin-top: auto;
  width: 100%;
  padding:
    max(48px, calc(var(--safe-top) + 40px))
    calc(28 * var(--u))
    max(16px, calc(var(--safe-bottom) + 14px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: transparent;
}

.pro__title {
  margin: 0;
  color: #073a42;
  font-size: clamp(28px, 8vw, 33px);
  font-weight: 900;
  line-height: 1.2;
}

.pro__subtitle {
  margin: 10px 0 0;
  color: #155762;
  font-size: 14px;
  font-weight: 500;
}

.pro__benefits {
  width: 100%;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pro__benefit {
  min-height: 64px;
  padding: 10px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(180, 140, 120, 0.25);
  color: #6a4031;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

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

@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;
  }
}
