/* كتبي PDF — البانرات العائمة وصفحات الهبوط (يُحمَّل فقط حين يوجد بانر مؤهل أو في صفحة هبوط) */

/* ---------- ألوان التمييز ---------- */
.kbp, .lp { --c: var(--gold); --t: var(--gold-dim); --cl: var(--gold-light); }
.kbp[data-accent="teal"], .lp[data-color="teal"] { --c: var(--teal); --t: var(--teal-dim); --cl: var(--teal); }
.kbp[data-accent="violet"], .lp[data-color="violet"] { --c: var(--violet); --t: var(--violet-dim); --cl: var(--violet); }
.kbp[data-accent="rose"], .lp[data-color="rose"] { --c: var(--rose); --t: var(--rose-dim); --cl: var(--rose); }

html.kbp-lock { overflow: hidden; }

/* ======================================================================
   البانر العائم
   ====================================================================== */
.kbp-card {
  position: relative; overflow: hidden; color: var(--text);
  background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 22px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .75), 0 0 40px -22px var(--c);
}
.kbp-img { display: block; width: 100%; background: var(--surface); }
.kbp-img picture, .kbp-img img { display: block; width: 100%; height: auto; }
.kbp-imglink { display: block; color: inherit; text-decoration: none; }
.kbp-body { display: grid; gap: 8px; padding: 16px 18px 18px; text-align: center; color: inherit; text-decoration: none; }
.kbp-t { font-size: 1.12rem; font-weight: 800; line-height: 1.6; color: var(--text); }
.kbp-x { margin: 0; font-size: 14px; line-height: 1.9; color: var(--text-muted); }
.kbp-btn {
  justify-self: center; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 28px; margin-top: 4px;
  border-radius: var(--radius-pill, 999px); border: 0; font: inherit; font-size: 14.5px; font-weight: 800; color: #221a0d; text-decoration: none; cursor: pointer;
  background: var(--gradient-gold); box-shadow: 0 10px 24px -12px var(--c);
  transition: transform var(--transition), box-shadow var(--transition);
}
.kbp-btn:hover { transform: translateY(-2px); }
.kbp[data-accent="teal"] .kbp-btn { background: linear-gradient(135deg, #9bf0e1, var(--teal)); }
.kbp[data-accent="violet"] .kbp-btn { background: linear-gradient(135deg, #c3b8ff, var(--violet)); color: #14102e; }
.kbp[data-accent="rose"] .kbp-btn { background: linear-gradient(135deg, #f6b5bf, var(--rose)); color: #2b0f15; }
.kbp-close {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3; width: 34px; height: 34px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 22px; line-height: 1;
  color: #fff; background: rgba(10, 13, 19, .68); border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%;
  transition: background var(--transition), transform var(--transition);
}
.kbp-close:hover { background: var(--rose); transform: scale(1.08); }
.kbp-close:focus-visible, .kbp-btn:focus-visible, .kbp-imglink:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.kbp-pv {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 3; padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 800; color: #221a0d; background: var(--rose);
}

/* ---------- نافذة منبثقة ---------- */
.kbp-pop {
  position: fixed; inset: 0; z-index: 2600; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5, 7, 12, .74); opacity: 0; transition: opacity .25s ease; overscroll-behavior: contain;
}
.kbp-pop.is-in { opacity: 1; }
.kbp-pop .kbp-card {
  width: min(100%, 520px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(16px) scale(.97); transition: transform .3s cubic-bezier(.22, .8, .3, 1);
}
.kbp-pop.is-in .kbp-card { transform: none; }
.kbp-pop .kbp-card:focus { outline: 0; }

/* ---------- بطاقة عائمة في الزاوية ---------- */
.kbp-float {
  position: fixed; z-index: 85; inset-block-end: 18px; inset-inline-end: 18px; width: min(330px, calc(100vw - 24px));
  opacity: 0; transform: translateY(18px); transition: opacity .3s ease, transform .35s cubic-bezier(.22, .8, .3, 1);
}
.kbp-float.is-in { opacity: 1; transform: none; }
.kbp-float .kbp-card { border-radius: 18px; }
.kbp-float .kbp-body { padding: 12px 14px 14px; }
.kbp-float .kbp-t { font-size: 1rem; }
.kbp-float .kbp-x { font-size: 13px; line-height: 1.8; }
.kbp-float .kbp-btn { min-height: 40px; padding: 0 22px; font-size: 13.5px; }

.kbp-float .kbp-img picture, .kbp-float .kbp-img img { max-height: 210px; object-fit: cover; }
@media (max-width: 980px) { .kbp-float .kbp-img picture, .kbp-float .kbp-img img { max-height: 150px; } }

/* ---------- شريط سفلي ---------- */
.kbp-bar {
  position: fixed; z-index: 85; inset-inline: 0; inset-block-end: 0; padding: 0 12px 12px; pointer-events: none;
  opacity: 0; transform: translateY(22px); transition: opacity .3s ease, transform .35s cubic-bezier(.22, .8, .3, 1);
}
.kbp-bar.is-in { opacity: 1; transform: none; }
.kbp-bar .kbp-card {
  pointer-events: auto; max-width: 1100px; margin-inline: auto; display: flex; align-items: center; gap: 14px;
  padding: 10px; padding-inline-end: 54px; border-radius: 18px;
}
.kbp-bar .kbp-img { flex: 0 0 64px; width: 64px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.kbp-bar .kbp-img picture, .kbp-bar .kbp-img img { width: 100%; height: 100%; object-fit: cover; }
.kbp-bar .kbp-body {
  flex: 1; min-width: 0; padding: 0; gap: 0 18px; text-align: start; justify-items: start; align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}
.kbp-bar .kbp-t { grid-column: 1; font-size: 1rem; }
.kbp-bar .kbp-x { grid-column: 1; font-size: 13px; line-height: 1.7; }
.kbp-bar .kbp-btn { grid-column: 2; grid-row: 1 / span 2; margin: 0; min-height: 40px; padding: 0 26px; font-size: 13.5px; }
.kbp-bar .kbp-close { top: 50%; margin-top: -17px; inset-inline-end: 12px; }
/* بانر صورة فقط (إعلان عريض) */
.kbp-bar.is-wide .kbp-card { display: block; padding: 0; }
.kbp-bar.is-wide .kbp-img { width: 100%; aspect-ratio: auto; border-radius: 0; }
.kbp-bar.is-wide .kbp-img img { height: auto; max-height: 130px; object-fit: cover; }
.kbp-bar.is-wide .kbp-close { top: 10px; margin-top: 0; }

/* الهاتف واللوحي: فوق شريط التبويب السفلي */
@media (max-width: 980px) {
  .kbp-float, .kbp-bar { inset-block-end: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .kbp-float { inset-inline: 12px; width: auto; max-width: 420px; margin-inline: auto; }
  .kbp-bar { padding: 0 10px; }
}
@media (max-width: 560px) {
  .kbp-bar .kbp-card { flex-wrap: wrap; gap: 10px; padding: 10px; padding-inline-end: 48px; }
  .kbp-bar .kbp-body { flex-basis: calc(100% - 80px); grid-template-columns: minmax(0, 1fr); }
  .kbp-bar .kbp-btn { grid-column: 1; grid-row: auto; justify-self: stretch; margin-top: 8px; }
  .kbp-bar.is-wide .kbp-card { padding: 0; }
}
/* لوحة المفاتيح أو ورقة «المزيد» مفتوحة: يختفي البانر حتى لا يغطي شيئًا */
html.kb-kbd .kbp-float, html.kb-kbd .kbp-bar, html.kb-sheet-open .kbp-float, html.kb-sheet-open .kbp-bar { display: none; }

@media (prefers-reduced-motion: reduce) {
  .kbp-pop, .kbp-pop .kbp-card, .kbp-float, .kbp-bar, .kbp-btn, .kbp-close { transition: none; }
}
@media print { .kbp { display: none !important; } }

/* ======================================================================
   صفحة الهبوط
   ====================================================================== */
.lp-preview { padding: 10px 18px; text-align: center; font-weight: 800; color: var(--text); background: var(--rose-dim); border-bottom: 1px solid var(--rose); }

.lp-hero { position: relative; overflow: hidden; padding: 56px 0 52px; background: var(--gradient-hero, none); border-bottom: 1px solid var(--border); }
.lp-glow { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: .5; }
.lp-glow-a { width: 340px; height: 340px; top: -150px; inset-inline-end: 6%; background: var(--t); }
.lp-glow-b { width: 300px; height: 300px; bottom: -150px; inset-inline-start: 8%; background: var(--violet-dim); }
.lp-hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: center; }
.lp-hero-in.has-img { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 44px; }
.lp-hero-text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.lp-hero-in:not(.has-img) .lp-hero-text { align-items: center; text-align: center; max-width: 780px; margin-inline: auto; }
.lp-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 99px; font-size: 13px; font-weight: 800;
  color: var(--cl); background: var(--t); border: 1px solid var(--c);
}
.lp-title { margin: 0; font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 900; line-height: 1.3; color: var(--text); }
.lp-sub { margin: 0; max-width: 580px; font-size: 1.08rem; line-height: 1.95; color: var(--text-muted); }

.lp-count { width: 100%; max-width: 440px; display: grid; gap: 10px; }
.lp-count-label { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-muted); }
.lp-count-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lp-cb {
  display: grid; gap: 2px; padding: 12px 6px 10px; text-align: center; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 0 26px -16px var(--c);
}
.lp-cb b { font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 900; line-height: 1.2; color: var(--cl); font-variant-numeric: tabular-nums; }
.lp-cb small { font-size: 12px; font-weight: 700; color: var(--text-faint); }
.lp-count-done { display: none; align-items: center; gap: 8px; margin: 0; padding: 12px 16px; border-radius: 14px; font-weight: 800; color: var(--teal); background: var(--teal-dim); border: 1px solid var(--teal); }
.lp-count.is-over .lp-count-grid, .lp-count.is-over .lp-count-label { display: none; }
.lp-count.is-over .lp-count-done { display: flex; }

.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.lp-hero-in:not(.has-img) .lp-cta { justify-content: center; }

.lp-hero-img { margin: 0; min-width: 0; }
.lp-hero-img picture, .lp-hero-img img { display: block; width: 100%; height: auto; }
.lp-hero-img img {
  max-height: 560px; object-fit: contain; border-radius: 22px; border: 1px solid var(--border-strong);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8), 0 0 50px -26px var(--c);
}

.lp-sec { padding-top: 44px; padding-bottom: 8px; }
.lp-body {
  max-width: 820px; margin-inline: auto; padding: 28px 30px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
}
.lp-body > :first-child { margin-top: 0; }
.lp-body > :last-child { margin-bottom: 0; }
.lp-body h2 { margin: 1.4em 0 .5em; font-size: 1.35rem; font-weight: 800; color: var(--text); }
.lp-body h3 { margin: 1.2em 0 .4em; font-size: 1.12rem; font-weight: 800; color: var(--cl); }
.lp-body p { margin: 0 0 1em; line-height: 2.05; color: var(--text-muted); }
.lp-body ul { margin: 0 0 1em; padding-inline-start: 1.3em; display: grid; gap: 6px; list-style: disc; }
.lp-body li { line-height: 1.9; color: var(--text-muted); }
.lp-body li::marker { color: var(--c); }
.lp-body strong { color: var(--text); }
.lp-body a { color: var(--cl); text-decoration: underline; text-underline-offset: 3px; }

.lp-coming { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 22px 18px; }
.lp-cc { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lp-cc-cover {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 14px; background: var(--bg-elevated);
  border: 1px solid var(--border-strong); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .8);
}
.lp-cc-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.lp-cc-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); background: linear-gradient(150deg, var(--surface), var(--bg-elevated)); }
.lp-cc-tag {
  position: absolute; top: 10px; inset-inline-start: 10px; padding: 3px 12px; border-radius: 99px; font-size: 11.5px; font-weight: 800;
  color: #221a0d; background: var(--gradient-gold); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .6);
}
.lp-cc-title { margin: 8px 0 0; font-size: 15px; font-weight: 800; line-height: 1.55; color: var(--text); }
.lp-cc-author { margin: 0; font-size: 12.5px; color: var(--text-faint); }
.lp-cc-note { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--text-muted); }

.lp-form-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: center; padding: 28px 30px; border-radius: 26px;
  background: linear-gradient(150deg, var(--surface), var(--bg-elevated)); border: 1px solid var(--c); box-shadow: 0 0 60px -30px var(--c);
}
.lp-form-ic { display: inline-flex; width: 60px; height: 60px; align-items: center; justify-content: center; border-radius: 18px; color: var(--c); background: var(--t); }
.lp-form-txt { min-width: 0; }
.lp-form-txt h2 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; color: var(--text); }
.lp-form-txt p { margin: 0; line-height: 1.9; color: var(--text-muted); }
.lp-form-box { min-width: 0; }
.lp-form {
  display: flex; align-items: center; gap: 8px; padding: 5px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border-strong);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lp-form:focus-within { border-color: var(--c); box-shadow: 0 0 0 3px var(--t); }
.lp-form input[type="email"] { flex: 1 1 0; width: 0; min-width: 0; height: 44px; padding: 0 16px; font: inherit; color: var(--text); background: transparent; border: 0; outline: 0; text-align: start; }
.lp-form .btn { flex: 0 0 auto; }
.lp-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.lp-form-msg { min-height: 1.5em; margin: 8px 6px 0; font-size: 13.5px; font-weight: 700; }
.lp-form-msg.is-ok { color: var(--teal); }
.lp-form-msg.is-err { color: var(--rose); }
.lp-form-note { margin: 2px 6px 0; font-size: 12px; color: var(--text-faint); }
.lp-form-note a { color: var(--cl); }

.lp-share-sec { padding-bottom: 40px; }
.lp-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center; color: var(--text-muted); font-size: 14px; }
.lp-share .sh-btn {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill, 999px); padding: 6px 16px;
  transition: color .15s, border-color .15s;
}
.lp-share .sh-btn:hover { color: var(--cl); border-color: var(--c); }

@media (max-width: 860px) {
  .lp-hero { padding: 36px 0 40px; }
  .lp-hero-in.has-img { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .lp-hero-in.has-img .lp-hero-img { order: -1; max-width: 440px; margin-inline: auto; }
  .lp-hero-text, .lp-hero-in.has-img .lp-hero-text { align-items: center; text-align: center; }
  .lp-cta { justify-content: center; }
  .lp-form-card { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; padding: 24px 18px; }
  .lp-form-box { width: 100%; }
  .lp-coming { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
}
@media (max-width: 480px) {
  .lp-body { padding: 20px 16px; }
  .lp-cta .btn { flex: 1 1 100%; }
  .lp-form { flex-wrap: wrap; border-radius: 22px; }
  .lp-form .btn { flex: 1 1 100%; }
}
