/* ============================================================
   Paywall v2 — شاشة الاشتراك (بتظهر لما التجربة المجانية/الاشتراك يخلص)
   مرجع التصميم: "صفحة الـ Paywall — لسان" (ديسكتوب 1440 + موبايل 390)
   كل الكلاسات بـ lspw- ومتعزلة تحت #subscription-paywall-overlay، فمفيش تأثير على باقي الموقع.
   المنطق في js/features/subscription/subscription.js (_subPaywallHTML / subPwPick).
   ============================================================ */

#subscription-paywall-overlay.lspw {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: #0b0b0c;
  color: #f5f2ea;
  direction: rtl;
  font-family: "Cairo", system-ui, sans-serif;
  line-height: 1.7;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}
#subscription-paywall-overlay.lspw *,
#subscription-paywall-overlay.lspw *::before,
#subscription-paywall-overlay.lspw *::after {
  box-sizing: border-box;
}
#subscription-paywall-overlay.lspw button,
#subscription-paywall-overlay.lspw input {
  font-family: inherit;
}
#subscription-paywall-overlay.lspw button:focus-visible,
#subscription-paywall-overlay.lspw input:focus-visible,
#subscription-paywall-overlay.lspw a:focus-visible {
  outline: 3px solid #ffba00;
  outline-offset: 2px;
}

/* شريط ألوان العلم الألماني */
.lspw .lspw-stripe {
  display: flex;
  height: 5px;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: content-box;
}
.lspw .lspw-stripe i { flex: 1; display: block; }
.lspw .lspw-stripe i:nth-child(1) { background: #000; }
.lspw .lspw-stripe i:nth-child(2) { background: #d62718; }
.lspw .lspw-stripe i:nth-child(3) { background: #ffba00; }

/* ---------- الهيدر (موبايل أولاً) ---------- */
.lspw .lspw-head {
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lspw .lspw-brand { display: flex; align-items: center; gap: 10px; }
.lspw .lspw-logo { width: 36px; height: 36px; border-radius: 50%; display: block; }
.lspw .lspw-brandtxt { display: flex; flex-direction: column; line-height: 1.05; }
.lspw .lspw-ar { font-size: 21px; font-weight: 900; }
.lspw .lspw-lat {
  display: none;
  font-family: "Nunito", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.32em;
  color: #ffba00;
  direction: ltr;
  text-align: right;
}
.lspw .lspw-user { display: flex; align-items: center; gap: 14px; }
.lspw .lspw-hello { display: none; font-size: 15px; color: #c9c4b8; }
.lspw .lspw-out {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #c9c4b8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- المحتوى (موبايل: عمود واحد بترتيب التصميم) ---------- */
.lspw .lspw-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 6px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.lspw .lspw-left { display: contents; }
.lspw .lspw-hero { order: 1; }
.lspw .lspw-journey { order: 2; }
.lspw .lspw-right { order: 3; }
.lspw .lspw-perks-title { order: 4; }
.lspw .lspw-perks { order: 5; }
.lspw .lspw-founder { order: 6; }

/* الهيرو */
.lspw .lspw-hero { display: flex; align-items: flex-start; gap: 8px; }
.lspw .lspw-hero-text { flex: 1; min-width: 0; }
.lspw .lspw-h1 { margin: 0; font-size: 34px; line-height: 1.25; font-weight: 900; color: #f5f2ea; }
.lspw .lspw-sub { margin: 10px 0 0; font-size: 15px; line-height: 1.9; color: #c9c4b8; }
.lspw .lspw-sub-d { display: none; }
.lspw .lspw-mascot { width: 80px; height: auto; transform: rotate(-5deg); flex: none; display: block; }

/* رحلتك من الصفر لـ C1 */
.lspw .lspw-journey { --pw-node: 44px; }
.lspw .lspw-jhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.lspw .lspw-jtitle { font-size: 16px; font-weight: 900; }
.lspw .lspw-jstats { display: none; font-size: 14px; color: #c9c4b8; }
.lspw .lspw-track { position: relative; }
.lspw .lspw-line {
  position: absolute;
  top: calc(var(--pw-node) / 2 - 1px);
  right: calc(var(--pw-node) / 2);
  left: calc(var(--pw-node) / 2);
  height: 0;
  border-top: 3px dashed #3a3a44;
}
.lspw .lspw-fill {
  position: absolute;
  top: calc(var(--pw-node) / 2 - 1px);
  right: calc(var(--pw-node) / 2);
  width: max(8%, calc((100% - var(--pw-node)) * var(--pw-prog, 0)));
  height: 3px;
  background: #ffba00;
}
.lspw .lspw-nodes { position: relative; display: flex; justify-content: space-between; }
.lspw .lspw-node {
  flex: none;
  width: var(--pw-node);
  height: var(--pw-node);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  background: #141416;
  color: #a8a39a;
  border: 2px dashed #4a4a54;
}
.lspw .lspw-node.is-past {
  background: rgba(255, 186, 0, 0.16);
  color: #ffba00;
  border: 2px solid rgba(255, 186, 0, 0.55);
}
.lspw .lspw-node.is-here {
  background: #ffba00;
  color: #0b0b0c;
  border: 0;
  box-shadow: 0 0 0 6px rgba(255, 186, 0, 0.22);
}
.lspw .lspw-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #c9c4b8;
}
.lspw .lspw-lock svg { flex: none; }
.lspw .lspw-lock-d { display: none; }

/* كارت الاشتراك */
.lspw .lspw-right { min-width: 0; }
.lspw .lspw-card {
  background: #fff8e6;
  color: #0b0b0c;
  border-radius: 28px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.lspw .lspw-card-title { font-size: 21px; font-weight: 900; }
.lspw .lspw-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: #f0e4c4; }
.lspw .lspw-tab {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  background: transparent;
  color: #3b372e;
}
.lspw .lspw-tab[aria-checked="true"] { background: #0b0b0c; color: #ffba00; }

.lspw .lspw-priceRow { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.lspw .lspw-best {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 12px;
  border-radius: 999px;
  background: #0b0b0c;
  color: #ffba00;
  font-size: 12.5px;
  font-weight: 900;
}
.lspw .lspw-price { display: flex; align-items: baseline; gap: 8px; }
.lspw .lspw-price-n { font-size: 64px; font-weight: 900; line-height: 1; }
.lspw .lspw-price-u { font-size: 18px; font-weight: 900; }
.lspw .lspw-was { text-align: left; }
.lspw .lspw-was-t { font-size: 15px; color: #5c564a; text-decoration: line-through; }
.lspw .lspw-saved {
  margin-top: 4px;
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: #d3f3e5;
  color: #075c43;
  font-size: 14px;
  font-weight: 900;
}
.lspw .lspw-span { font-size: 14px; color: #3b372e; font-weight: 700; }

.lspw .lspw-go {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  background: #0866ff;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.lspw .lspw-go:hover { transform: translateY(-2px); }
.lspw .lspw-go svg { flex: none; }

.lspw .lspw-trust {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: #075c43;
}
.lspw .lspw-trust span { display: flex; align-items: center; gap: 6px; }
.lspw .lspw-steps { display: flex; gap: 8px; font-size: 13px; color: #3b372e; font-weight: 600; }
.lspw .lspw-steps span { flex: 1; padding: 8px 10px; border-radius: 12px; background: #f0e4c4; }

.lspw .lspw-codebox { border-top: 1px solid #e0d3ae; padding-top: 14px; }
.lspw .lspw-codelabel { display: block; font-size: 15px; font-weight: 900; margin-bottom: 8px; }
.lspw .lspw-coderow { display: flex; gap: 8px; }
.lspw .lspw-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid #cdbe92;
  background: #fff;
  color: #0b0b0c;
  font-size: 15px;
  text-transform: uppercase;
}
.lspw .lspw-act {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 0;
  background: #0b0b0c;
  color: #ffba00;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}
.lspw .lspw-act:disabled { opacity: 0.6; cursor: default; }
.lspw .lspw-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: #3b372e;
  cursor: pointer;
}
.lspw .lspw-terms input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: #0b0b0c; flex: none; }
.lspw .lspw-terms a { color: #0b0b0c; font-weight: 900; }
.lspw .lspw-msg { margin-top: 8px; min-height: 18px; font-size: 13px; font-weight: 700; }

/* مميزات الاشتراك */
.lspw .lspw-perks-title { font-size: 17px; font-weight: 900; margin: 0 0 -10px; }
.lspw .lspw-perks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 24px;
  font-size: 15px;
  font-weight: 700;
}
.lspw .lspw-perks li { display: flex; align-items: center; gap: 12px; }
.lspw .lspw-tick {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffba00;
  color: #0b0b0c;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* كلمة المؤسس */
.lspw .lspw-founder { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 20px; }
.lspw .lspw-founder-row { display: flex; gap: 14px; align-items: flex-start; }
.lspw .lspw-founder-img { width: 40px; height: 40px; border-radius: 50%; flex: none; display: block; }
.lspw .lspw-founder-txt { font-size: 14px; line-height: 1.9; color: #e7e2d6; }
.lspw .lspw-founder-name { font-size: 13px; color: #a8a39a; }

/* موبايل صغير جدًا */
@media (max-width: 359px) {
  .lspw .lspw-tab { font-size: 12.5px; }
  .lspw .lspw-price-n { font-size: 54px; }
  .lspw .lspw-card { padding: 18px; }
}

/* ============================================================
   ديسكتوب (>= 1200px) — عمودين زي تصميم الـ 1440
   ============================================================ */
@media (min-width: 1200px) {
  /* التصميم: محتوى 1240px + padding 40px من كل جنب = 1320px إجمالي */
  .lspw .lspw-head { max-width: 1320px; padding: 16px 40px; }
  .lspw .lspw-logo { width: 44px; height: 44px; }
  .lspw .lspw-ar { font-size: 24px; }
  .lspw .lspw-lat { display: block; }
  .lspw .lspw-hello { display: inline; }
  .lspw .lspw-out {
    padding: 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    color: #f5f2ea;
    font-size: 15px;
  }

  .lspw .lspw-main {
    max-width: 1320px;
    padding: 32px 40px 64px;
    flex-direction: row;
    align-items: flex-start;
    gap: 64px;
  }
  .lspw .lspw-left {
    display: flex;
    flex-direction: column;
    gap: 32px;
    flex: 1;
    min-width: 0;
  }
  .lspw .lspw-hero, .lspw .lspw-journey, .lspw .lspw-right,
  .lspw .lspw-perks-title, .lspw .lspw-perks, .lspw .lspw-founder { order: 0; }
  .lspw .lspw-right { flex: 0 0 480px; }

  .lspw .lspw-hero { gap: 24px; }
  .lspw .lspw-h1 { font-size: clamp(46px, 4.45vw, 64px); line-height: 1.18; }
  .lspw .lspw-sub { margin-top: 18px; font-size: 19px; line-height: 1.95; max-width: 540px; }
  .lspw .lspw-sub-m { display: none; }
  .lspw .lspw-sub-d { display: inline; }
  .lspw .lspw-mascot { width: 130px; }

  .lspw .lspw-journey { --pw-node: 52px; }
  .lspw .lspw-jhead { margin-bottom: 14px; }
  .lspw .lspw-jtitle { font-size: 18px; }
  .lspw .lspw-jstats { display: inline; }
  .lspw .lspw-node { font-size: 16px; }
  .lspw .lspw-fill { width: max(7%, calc((100% - var(--pw-node)) * var(--pw-prog, 0))); }
  .lspw .lspw-lock { margin-top: 14px; font-size: 14px; }
  .lspw .lspw-lock-m { display: none; }
  .lspw .lspw-lock-d { display: inline; }

  .lspw .lspw-perks-title { display: none; }
  .lspw .lspw-perks { grid-template-columns: 1fr 1fr; font-size: 17px; }

  .lspw .lspw-founder { padding-top: 24px; }
  .lspw .lspw-founder-img { width: 52px; height: 52px; }
  .lspw .lspw-founder-txt { font-size: 15px; }

  .lspw .lspw-card { padding: 32px; }
  .lspw .lspw-tab { font-size: 15px; }
  .lspw .lspw-price-n { font-size: 76px; }
  .lspw .lspw-span { font-size: 15px; }
  .lspw .lspw-go { min-height: 60px; font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .lspw .lspw-go { transition: none; }
  .lspw .lspw-go:hover { transform: none; }
}
