/* ===================================================
   RedotPay Referral Landing — Stylesheet
   ألوان البراند بتتحط ديناميكيًا من config.js في app.js
   =================================================== */

:root {
  --color-bg: #0E0F12;
  --color-bg-light: #F7F5F0;
  --color-primary: #E8412E;
  --color-primary-hover: #C93521;
  --color-accent-green: #2FAE6B;
  --color-text-dark: #14151A;
  --color-text-light: #F7F5F0;
  --color-text-muted: #8B8F98;
  --color-border: #23252B;
  --color-border-light: #E7E3D9;

  --font-display: "Space Grotesk", "IBM Plex Sans Arabic", sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Space Grotesk", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--color-bg-light);
  color: var(--color-text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
}

h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); margin-bottom: 8px; }
h3 { font-size: 1.1rem; margin-bottom: 6px; }

.section-sub {
  color: var(--color-text-muted);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

p { max-width: 62ch; }

section { padding: 72px 0; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-light);
  border: 1.5px solid var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-primary); }

.btn-large { padding: 16px 32px; font-size: 1.05rem; }
.btn-small { padding: 10px 20px; font-size: 0.9rem; }

/* ---------- الهيدر ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 15, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text-light);
  text-decoration: none;
}
.logo-img { height: 32px; }

/* ---------- Hero ---------- */
.hero {
  background: var(--color-bg);
  color: var(--color-text-light);
  padding: 96px 0 72px;
}

.hero-inner {
  max-width: 760px;
  text-align: center;
  margin: 0 auto;
}

.eyebrow {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  margin-bottom: 20px;
}

.hero-sub {
  color: #C7CAD1;
  font-size: 1.1rem;
  max-width: 56ch;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
}

.play-icon { font-size: 0.85em; }

.trust-line {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---------- فيديو المودال ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.video-modal[hidden] {
  display: none;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.video-modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
}

.video-frame-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.video-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-close {
  position: absolute;
  top: -44px;
  left: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- أرقام الثقة ---------- */
.stats {
  background: var(--color-bg);
  padding-top: 0;
  padding-bottom: 64px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--color-border);
  padding-top: 40px;
}

.stat { text-align: center; }

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  color: var(--color-text-light);
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- حسبة "كام هتدفع فعليًا" ---------- */
.pricing-breakdown {
  background: var(--color-bg-light);
  text-align: center;
}

.pricing-breakdown h2 { text-align: center; }
.pricing-breakdown .section-sub { text-align: center; }

.ledger {
  max-width: 480px;
  margin: 0 auto 32px;
  background: #fff;
  border: 1.5px solid var(--color-border-light);
  border-radius: 16px;
  overflow: hidden;
  text-align: right;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.98rem;
}

.ledger-row-deduct { color: var(--color-accent-green); font-weight: 600; }

.ledger-row-total {
  background: var(--color-bg);
  color: var(--color-text-light);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  border-bottom: none;
}

.fine-print {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 16px auto 0;
  max-width: 50ch;
}

/* ---------- الأكواد ---------- */
.codes { background: #fff; }

.code-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.code-card {
  border: 1.5px solid var(--color-border-light);
  border-radius: 16px;
  padding: 28px 24px;
}

.code-card-featured {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 5%, #fff);
}

.code-card-icon { font-size: 1.6rem; display: block; margin-bottom: 12px; }

.code-card p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--color-bg-light);
  border: 1px dashed var(--color-border-light);
  border-radius: 10px;
  padding: 10px 14px;
}

.code-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 1.05rem;
}

.copy-btn {
  background: var(--color-text-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.copy-btn.copied { background: var(--color-accent-green); }

.code-warning {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--color-primary-hover);
}

.help-line {
  text-align: center;
  color: var(--color-text-muted);
}
.help-line a { color: var(--color-primary); font-weight: 600; text-decoration: none; }

/* ---------- المميزات ---------- */
.features { background: var(--color-bg-light); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-icon { font-size: 1.5rem; display: block; margin-bottom: 10px; }

.feature p { color: var(--color-text-muted); font-size: 0.92rem; }

/* ---------- الاستخدامات ---------- */
.use-cases { background: #fff; text-align: center; }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tag {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.92rem;
}

/* ---------- الخطوات ---------- */
.steps { background: var(--color-bg); color: var(--color-text-light); text-align: center; }
.steps h2 { text-align: center; }

.steps-list {
  max-width: 640px;
  margin: 0 auto 36px;
  text-align: right;
}

.step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}
.step:last-child { border-bottom: none; }

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step p { color: #C7CAD1; font-size: 0.92rem; }

/* ---------- التقييمات ---------- */
.reviews { background: var(--color-bg-light); text-align: center; }
.reviews h2 { text-align: center; margin-bottom: 40px; }

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: right;
}

.review {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  padding: 24px;
}

.stars { color: var(--color-primary); display: block; margin-bottom: 10px; letter-spacing: 2px; }

.review p { font-size: 0.95rem; margin-bottom: 12px; }

.review-source { color: var(--color-text-muted); font-size: 0.85rem; }

/* ---------- الأسئلة الشائعة ---------- */
.faq { background: #fff; }
.faq h2 { text-align: center; margin-bottom: 40px; }

.faq-list { max-width: 700px; margin: 0 auto; }

.faq-item {
  border-bottom: 1px solid var(--color-border-light);
  padding: 18px 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-inline-start: 12px;
}

.faq-item[open] summary::after { content: "−"; }

.faq-item p {
  margin-top: 12px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---------- CTA نهائي ---------- */
.final-cta {
  background: var(--color-bg);
  color: var(--color-text-light);
  text-align: center;
}

.final-cta h2 { margin-bottom: 12px; }
.final-cta p { color: #C7CAD1; margin: 0 auto 28px; }

/* ---------- الفوتر ---------- */
.site-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 24px 0 40px;
}
.site-footer p {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  text-align: center;
  max-width: none;
}

/* ---------- Focus visibility (accessibility) ---------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* =====================================================
   تابلت / لابتوب صغير
   ===================================================== */
@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .code-cards { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================
   الموبايل (تابلت صغير / موبايل أفقي)
   ===================================================== */
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .code-cards { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
}

@media (max-width: 560px) {
  .container { padding: 0 18px; }
  section { padding: 48px 0; }
  .hero { padding: 56px 0 40px; }
  .stats-grid { grid-template-columns: 1fr; gap: 24px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .btn-large { padding: 15px 22px; font-size: 0.98rem; }
  .header-inner { padding-block: 12px; }
  .logo { font-size: 1.1rem; }
  .ledger-row { padding: 14px 18px; font-size: 0.9rem; }
  .video-modal { padding: 12px; }
  .video-close { top: -38px; font-size: 1.2rem; }
  h2 { font-size: 1.5rem; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 1.8rem; }
  .code-box { flex-direction: column; align-items: stretch; gap: 8px; }
  .copy-btn { width: 100%; }
}