@import url("tokens.css");

/* ==========================================================================
   المبساط — أنماط الموقع
   الألوان والخطوط كلها من tokens.css — لا تكتب قيمة لون مباشرة هنا.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--sp-4);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  letter-spacing: -.01em;
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: clamp(1.75rem, 4vw, var(--fs-3xl)); }
h3 { font-size: var(--fs-xl); }
p  { margin: 0 0 var(--sp-4); }
a  { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; }
ul { padding-inline-start: 1.2em; margin: 0 0 var(--sp-4); }
li { margin-bottom: var(--sp-2); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.narrow    { width: min(100% - 2.5rem, var(--container-narrow)); margin-inline: auto; }
.section   { padding-block: var(--sp-9); }
.section--tight { padding-block: var(--sp-8); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; inset-inline-start: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--r-md) 0;
}
.skip:focus { inset-inline-start: 0; }

/* ---- العناوين المصغّرة ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  color: var(--accent); letter-spacing: .04em;
  margin-bottom: var(--sp-3);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }

.lead { font-size: var(--fs-lg); color: var(--text-muted); max-width: 62ch; }

/* ---- الأزرار ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.6rem; border-radius: var(--r-full);
  font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-bold);
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { background: var(--accent-hover); color: #fff; box-shadow: var(--shadow-lg); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-raised); color: var(--text); border-color: var(--text-muted); }
.btn--wa { background: var(--ok-600); color: #fff; }
.btn--wa:hover { background: #19643E; color: #fff; }
.btn--lg { padding: 1rem 2rem; font-size: var(--fs-base); }
.btn--block { width: 100%; }

/* ---- الترويسة ---- */
.header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.header__inner { height: 100%; display: flex; align-items: center; gap: var(--sp-5); }
.brand {
  display: flex; align-items: center; gap: .6rem; text-decoration: none;
  color: var(--text); font-weight: var(--fw-bold); font-size: var(--fs-lg);
}
.brand svg { width: 34px; height: 34px; flex: none; }
.nav { display: flex; gap: var(--sp-5); margin-inline-start: auto; }
.nav a { color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.nav a:hover { color: var(--text); }
.header__actions { display: flex; align-items: center; gap: .6rem; margin-inline-start: auto; }
.nav + .header__actions { margin-inline-start: 0; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-full);
  background: transparent; color: var(--text); cursor: pointer; font-size: 1rem;
}
.icon-btn:hover { background: var(--bg-raised); }
@media (max-width: 880px) {
  .nav { display: none; }
  .header__actions .btn { display: none; }
}

/* ---- البطل ---- */
.hero { position: relative; padding-block: clamp(3rem, 8vw, 6rem) var(--sp-8); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset-inline-end: -14%; top: -26%;
  width: 62vw; height: 62vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(circle at 50% 50%, var(--accent-soft), transparent 66%);
  border-radius: 50%; pointer-events: none; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { max-width: 18ch; margin-bottom: var(--sp-5); }
.hero h1 .u {
  color: var(--accent);
  background-image: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 24%, transparent) 62%);
}
.hero__lead {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--text-muted);
  max-width: 58ch; margin-bottom: var(--sp-6);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.hero__note { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-4); }

.trust {
  display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6);
  margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--border-soft);
}
.trust__item { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); color: var(--text-muted); }
.trust__item b { color: var(--text); font-weight: var(--fw-bold); }

/* ---- الشبكات ---- */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---- البطاقات ---- */
.card {
  background: var(--bg-raised); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: var(--sp-5);
}
.card h3 { margin-bottom: var(--sp-2); font-size: var(--fs-lg); }
.card p:last-child { margin-bottom: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.card__icon { font-size: 1.7rem; line-height: 1; margin-bottom: var(--sp-3); display: block; }

/* ---- شريط داكن ---- */
.band {
  background: var(--bg-inverse); color: var(--text-inverse);
  border-radius: var(--r-xl); padding: clamp(1.75rem, 5vw, var(--sp-8));
}
.band h2, .band h3 { color: var(--text-inverse); }
.band p { color: color-mix(in srgb, var(--text-inverse) 78%, transparent); }
.band .eyebrow { color: var(--gold-600); }
.band .eyebrow::before { background: var(--gold-600); }

.chain {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: var(--sp-6);
}
.chain__step {
  padding: var(--sp-4);
  border: 1px dashed color-mix(in srgb, var(--text-inverse) 28%, transparent);
  border-radius: var(--r-md);
}
.chain__step b { display: block; margin-bottom: .35rem; color: var(--text-inverse); }
.chain__step small { color: color-mix(in srgb, var(--text-inverse) 66%, transparent); font-size: var(--fs-sm); line-height: 1.6; display: block; }
.chain__step--break { border-style: solid; border-color: var(--clay-600); background: color-mix(in srgb, var(--clay-600) 16%, transparent); }

/* ---- الباقات ---- */
.plans { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: stretch; }
.plan {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-6) var(--sp-5); position: relative;
  display: flex; flex-direction: column;
}
.plan--featured { border-color: var(--accent); border-width: 2px; box-shadow: var(--shadow-lg); }
.plan__tag {
  position: absolute; top: -13px; inset-inline-start: var(--sp-5);
  background: var(--accent); color: #fff; font-size: var(--fs-xs); font-weight: var(--fw-bold);
  padding: .25rem .8rem; border-radius: var(--r-full);
}
.plan__name { font-size: var(--fs-xl); margin-bottom: .35rem; }
.plan__for { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--sp-5); min-height: 3.2em; }
.plan__price { font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: 1; font-family: var(--font-num); }
.plan__price small { font-size: var(--fs-sm); font-weight: var(--fw-normal); color: var(--text-muted); }
.plan__sub { font-size: var(--fs-sm); color: var(--text-muted); margin: .55rem 0 var(--sp-5); min-height: 1.7em; }
.plan ul { list-style: none; padding: 0; margin: 0 0 var(--sp-5); flex: 1; }
.plan li { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--fs-sm); margin-bottom: .7rem; line-height: 1.6; }
.plan li::before { content: "✓"; color: var(--ok-600); font-weight: var(--fw-bold); flex: none; }
.plan li.no { color: var(--text-muted); }
.plan li.no::before { content: "—"; color: var(--ink-300); }
.price-note { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-5); text-align: center; }

/* ---- الخطوات ---- */
.steps { display: grid; gap: var(--sp-5); }
.step { display: grid; grid-template-columns: 44px 1fr; gap: var(--sp-4); align-items: start; }
.step__n {
  width: 44px; height: 44px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--palm-600); color: #fff; font-weight: var(--fw-bold); font-family: var(--font-num);
}
.step h3 { margin-bottom: .3rem; font-size: var(--fs-lg); }
.step p { margin-bottom: 0; color: var(--text-muted); }

/* ---- الملاءمة: نعم / لا ---- */
.fit { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.fit__col { border-radius: var(--r-lg); padding: var(--sp-5); border: 1px solid var(--border-soft); background: var(--bg-raised); }
.fit__col--yes { border-color: color-mix(in srgb, var(--ok-600) 34%, transparent); }
.fit__col--no  { background: var(--bg-sunken); }
.fit__col h3 { font-size: var(--fs-lg); }
.fit__col ul { list-style: none; padding: 0; margin: 0; }
.fit__col li { display: flex; gap: .6rem; font-size: var(--fs-sm); margin-bottom: .75rem; color: var(--text-muted); line-height: 1.6; }
.fit__col--yes li::before { content: "✓"; color: var(--ok-600); font-weight: 700; flex: none; }
.fit__col--no  li::before { content: "✕"; color: var(--err-600); font-weight: 700; flex: none; }

/* ---- الأسئلة ---- */
.faq { border-top: 1px solid var(--border-soft); }
.faq details { border-bottom: 1px solid var(--border-soft); }
.faq summary {
  cursor: pointer; list-style: none; padding: var(--sp-5) 0;
  font-weight: var(--fw-bold); font-size: var(--fs-lg);
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: var(--accent); font-size: var(--fs-xl); flex: none;
  transition: transform var(--dur-base) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding-bottom: var(--sp-5); color: var(--text-muted); max-width: 72ch; }

/* ---- النموذج ---- */
.form { display: grid; gap: var(--sp-4); }
.field label { display: block; font-size: var(--fs-sm); font-weight: var(--fw-bold); margin-bottom: .4rem; }
.field .req { color: var(--accent); }
.field input, .field select, .field textarea {
  width: 100%; padding: .8rem 1rem; font-family: inherit; font-size: var(--fs-base);
  background: var(--bg-raised); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field textarea { min-height: 120px; resize: vertical; }
.field .err { display: none; color: var(--err-600); font-size: var(--fs-sm); margin-top: .35rem; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--err-600); }
.field.invalid .err { display: block; }
.form__note { font-size: var(--fs-sm); color: var(--text-muted); }
.hp { position: absolute; inset-inline-start: -9999px; opacity: 0; height: 0; }

.form__ok {
  display: none; padding: var(--sp-5); border-radius: var(--r-lg);
  background: var(--palm-100); border: 1px solid color-mix(in srgb, var(--ok-600) 34%, transparent);
  color: var(--ink-900);
}
.form__ok.show { display: block; }

.contact-grid {
  display: grid; gap: var(--sp-7);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-points { list-style: none; padding: 0; margin: var(--sp-5) 0 0; }
.contact-points li { display: flex; gap: .7rem; font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--sp-3); line-height: 1.6; }
.contact-points li b { color: var(--text); }

/* ---- التذييل ---- */
.footer {
  border-top: 1px solid var(--border-soft); padding-block: var(--sp-6);
  margin-top: var(--sp-8); font-size: var(--fs-sm); color: var(--text-muted);
}
.footer__inner { display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between; align-items: center; }
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer__links { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

/* ---- زر واتساب عائم ---- */
.wa-float {
  position: fixed; inset-block-end: 20px; inset-inline-start: 20px; z-index: 90;
  width: 56px; height: 56px; border-radius: var(--r-full);
  background: var(--ok-600); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-lg); text-decoration: none;
}
.wa-float:hover { background: #19643E; color: #fff; }
.wa-float svg { width: 28px; height: 28px; }

/* ---- ظهور عند التمرير ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- الطباعة ---- */
@media print {
  .header, .wa-float, .hero::before { display: none !important; }
  body { background: #fff; color: #000; }
}
