:root {
  --green: #0e5a36;
  --green-deep: #0a3f26;
  --red: #b4161b;
  --ink: #1b1a17;
  --ink-soft: #4a463f;
  --muted: #7b756a;
  --cream: #faf7f1;
  --paper: rgba(255, 253, 248, 0.86);
  --line: rgba(27, 26, 23, 0.1);
  --radius: 22px;
  --shadow: 0 20px 50px -24px rgba(40, 32, 18, 0.35), 0 2px 6px rgba(40, 32, 18, 0.06);
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- خلفية الفيديو المرتبطة بالتمرير ---------- */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stage canvas, .stage .poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
/* الفيديو بألوانه الأصلية — النصوص تبقى واضحة عبر البطاقات والظلال الفاتحة */
.stage .wash { display: none; }

main, header, footer { position: relative; z-index: 1; }

/* ---------- الشريط العلوي ---------- */
.topbar {
  position: fixed; top: 0; inset-inline: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background .3s, box-shadow .3s;
}
.topbar.scrolled { background: rgba(250, 247, 241, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 15px; }
.topbar .brand img { width: 40px; height: 40px; object-fit: contain; mix-blend-mode: multiply; }
.topbar .brand span { opacity: 0; transform: translateY(4px); transition: .3s; }
.topbar.scrolled .brand span { opacity: 1; transform: none; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 10px 22px;
  background: var(--green); color: #fff;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { background: var(--green-deep); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: rgba(255,255,255,.7); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.red { background: var(--red); }
.btn.red:hover { background: #8f1015; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-xl {
  font-size: clamp(20px, 3.2vw, 28px); font-weight: 700;
  padding: 22px clamp(36px, 6vw, 64px);
  box-shadow: 0 18px 40px -16px rgba(14, 90, 54, .65);
  position: relative; overflow: hidden;
}
.btn-xl::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(120%); animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(120%); } 100% { transform: translateX(-120%); } }

/* ---------- الأقسام ---------- */
.section {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 110px clamp(16px, 5vw, 48px);
}
.wrap { width: 100%; max-width: 980px; margin-inline: auto; }
.center { text-align: center; }

.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; color: var(--green); letter-spacing: 0;
  margin-bottom: 14px;
}
.kicker::before { content: ''; width: 28px; height: 2px; background: linear-gradient(90deg, var(--red), var(--green)); border-radius: 2px; }

.card {
  background: var(--paper);
  backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* hero */
.hero { padding-top: 90px; text-align: center; }
.partners {
  display: inline-block; padding: 14px 26px; border-radius: 20px;
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.partners img { width: min(520px, 78vw); mix-blend-mode: multiply; }
.hero-logo {
  width: min(340px, 72vw); margin: 26px auto 8px;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.08));
}
.hero .eyebrow { font-size: clamp(18px, 2.4vw, 22px); font-weight: 500; color: var(--ink-soft); margin: 0; }
.hero h1 {
  margin: 2px 0 0; font-weight: 700; line-height: 1.25;
  font-size: clamp(34px, 6vw, 60px);
}
.hero h1 .r { color: var(--red); }
.hero h1 .g { color: var(--green); }
.hero .sub { margin: 6px 0 0; font-size: clamp(18px, 2.6vw, 26px); font-weight: 500; color: var(--ink); }
.scroll-hint {
  margin-top: 34px; display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); text-decoration: none;
}
.scroll-hint i { width: 22px; height: 36px; border: 2px solid currentColor; border-radius: 12px; position: relative; }
.scroll-hint i::after { content: ''; position: absolute; top: 6px; left: 50%; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: currentColor; animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* about */
.about { padding: clamp(28px, 5vw, 56px); }
.about p { margin: 0; font-size: clamp(19px, 2.4vw, 25px); line-height: 2; font-weight: 400; color: var(--ink); text-wrap: pretty; }
.about h2, .details h2 { margin: 0 0 18px; font-size: clamp(26px, 3.6vw, 38px); line-height: 1.4; }

/* details */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.fact { padding: 26px 24px; display: flex; flex-direction: column; gap: 6px; }
.fact .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(14,90,54,.1); color: var(--green); margin-bottom: 8px; }
.fact .ico svg { width: 24px; height: 24px; }
.fact small { color: var(--muted); font-size: 14px; font-weight: 500; }
.fact strong { font-size: clamp(18px, 2vw, 21px); font-weight: 700; line-height: 1.5; }
.fact a { font-size: 14px; color: var(--green); font-weight: 600; text-decoration: none; margin-top: 4px; }

.countdown { margin-top: 16px; padding: 22px; display: flex; align-items: center; justify-content: center; gap: clamp(10px, 3vw, 34px); flex-wrap: wrap; }
.countdown .label { font-weight: 600; color: var(--ink-soft); }
.countdown .units { display: flex; gap: clamp(8px, 2vw, 18px); direction: rtl; }
.countdown .u { min-width: 70px; text-align: center; }
.countdown .u b { display: block; font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.1; color: var(--green); font-variant-numeric: tabular-nums; }
.countdown .u span { font-size: 13px; color: var(--muted); }

/* closing */
.closing { text-align: center; }
.closing .line {
  display: block; font-weight: 700; line-height: 1.35;
  font-size: clamp(36px, 7.4vw, 86px);
  text-shadow: 0 0 40px rgba(250,247,241,.95), 0 0 12px rgba(250,247,241,.9);
}
.closing .line + .line { color: var(--red); margin-top: 10px; }
.closing .line.small { font-size: clamp(22px, 3.6vw, 36px); font-weight: 500; color: var(--ink-soft); }

/* cta */
.cta { text-align: center; }
.cta-box { padding: clamp(34px, 6vw, 64px) clamp(20px, 5vw, 60px); }
.cta h2 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 42px); line-height: 1.4; }
.cta p.lead { margin: 0 auto 30px; max-width: 560px; color: var(--ink-soft); font-size: clamp(16px, 2vw, 19px); }
.contacts { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.contacts a { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 500; font-size: 15px; padding: 9px 18px; border-radius: 999px; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px var(--line); }
.contacts a:hover { background: #fff; }
.contacts svg { width: 18px; height: 18px; color: var(--green); }

.site-footer { text-align: center; padding: 26px 16px 34px; font-size: 13px; color: var(--muted); }

/* حركة الظهور */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .12s; } .reveal.d2 { transition-delay: .24s; } .reveal.d3 { transition-delay: .36s; } .reveal.d4 { transition-delay: .5s; }

/* ---------- صفحة التسجيل ---------- */
.page-bg { position: fixed; inset: 0; z-index: 0; }
.page-bg img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.6) blur(2px); transform: scale(1.04); }
.page-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(250,247,241,.78), rgba(250,247,241,.88)); }

.form-page { min-height: 100vh; padding: 100px 16px 50px; display: grid; place-items: start center; position: relative; z-index: 1; }
.form-card { width: 100%; max-width: 640px; padding: clamp(24px, 5vw, 44px); }
.form-head { text-align: center; margin-bottom: 26px; }
.form-head img { width: 110px; margin: 0 auto 6px; mix-blend-mode: multiply; }
.form-head h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.4; }
.form-head p { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 7px; }
.field label .req { color: var(--red); }
.field input[type=text], .field input[type=tel], .field input[type=email] {
  width: 100%; padding: 13px 16px; border-radius: 14px;
  border: 1px solid rgba(27,26,23,.16); background: rgba(255,255,255,.9);
  font-size: 16px; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #a8a196; }
.field input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(14,90,54,.12); }
.field input[type=tel], .field input[type=email] { direction: ltr; text-align: right; }
.field input[type=tel]:placeholder-shown, .field input[type=email]:placeholder-shown { direction: rtl; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.field .err { font-size: 13px; color: var(--red); margin-top: 5px; display: none; }
.field.invalid input { border-color: var(--red); }
.field.invalid .err { display: block; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.photo-pick {
  display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 16px;
  border: 1.5px dashed rgba(27,26,23,.22); background: rgba(255,255,255,.6); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.photo-pick:hover, .photo-pick.drag { border-color: var(--green); background: rgba(255,255,255,.9); }
.photo-pick .ph { width: 92px; height: 92px; border-radius: 50%; flex: none; background: #efebe3 center/cover no-repeat; display: grid; place-items: center; color: #b3ab9d; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--green); }
.photo-pick .ph svg { width: 38px; height: 38px; }
.photo-pick .ph.has svg { display: none; }
.photo-pick b { display: block; font-size: 15px; }
.photo-pick span { font-size: 13px; color: var(--muted); }
.field.invalid .photo-pick { border-color: var(--red); }

.form-actions { margin-top: 26px; }
.form-actions .btn { width: 100%; padding: 15px; font-size: 18px; }
.form-error { display: none; margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: rgba(180,22,27,.08); color: var(--red); font-size: 14px; text-align: center; }
.form-error.show { display: block; }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: none; }
.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.success { text-align: center; display: none; }
.success.show { display: block; animation: pop .6s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.success .check { width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(14,90,54,.1); color: var(--green); }
.success .check svg { width: 38px; height: 38px; }
.success .letter { text-align: right; font-size: 17px; line-height: 2; color: var(--ink); }
.success .letter p { margin: 0 0 12px; }
.success .letter .sign { color: var(--ink-soft); font-weight: 600; }

@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .topbar .btn { padding: 8px 16px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn-xl::after, .scroll-hint i::after { animation: none; }
}

/* وضوح نصوص الترحيب فوق الفيديو بألوانه الأصلية */
.hero .eyebrow, .hero h1, .hero .sub, .scroll-hint { text-shadow: 0 0 24px rgba(255,253,248,.95), 0 0 8px rgba(255,253,248,.9); }
.closing .line.reveal { padding: 0 12px; }
