/* ==========================================================================
   قاعة — qa3a.app
   شروط التصميم في §8 من docs/qa3a-app-website-spec.md غير قابلة للتفاوض:
     · ارتفاع السطر ≥ 1.7 للعربية والكردية
     · letter-spacing: 0 على كل نصّ عربي أو كردي — الحروف متصلة وأي تباعد
       يفكّك الكلمة
     · أرقام لاتينية 0-9 في اللغات الثلاث
     · أهداف لمس ≥ 48 بكسل
   الخط مستضاف ذاتياً في /assets/fonts — لا طلب إلى أي طرف ثالث، تماماً كما
   تَعِد سياسة الخصوصية.
   ========================================================================== */

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-arabic-600.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-arabic-700.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --bg:       #0A0B0D;
  --surface:  #14161A;
  --line:     #23262D;
  --text:     #F2F4F7;
  --muted:    #98A2B3;
  --ok:       #12B76A;
  --fail:     #F04438;
  --warn:     #F79009;

  --radius:   12px;
  --tap:      48px;   /* أصغر هدف لمس مسموح */
  --measure:  68ch;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;          /* الخط العربي يحتاج هذا */
  letter-spacing: 0;         /* ★ لا يُرفع أبداً على نصّ عربي أو كردي */

  /* أرقام لاتينية في اللغات الثلاث */
  font-variant-numeric: lining-nums tabular-nums;
}

/* الإنجليزية وحدها تحتمل سطراً أقصر */
body[data-locale="en"] { line-height: 1.6; }

/* أي عنصر عربي أو كردي: صفر تباعد، مهما ورث */
[dir="rtl"], [dir="rtl"] * { letter-spacing: 0 !important; }

h1, h2, h3 {
  letter-spacing: 0;
  line-height: 1.45;         /* العناوين أقلّ من الفقرات لكن ليست ضيّقة */
  margin: 0 0 12px;
  font-weight: 700;
}

h1 { font-size: clamp(26px, 5.2vw, 40px); }
h2 { font-size: clamp(20px, 3.6vw, 26px); margin-top: 40px; }
h3 { font-size: 18px; margin-top: 28px; font-weight: 600; }

p, li { margin: 0 0 16px; max-width: var(--measure); }

a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: #fff; }

strong { font-weight: 600; }

hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* ----------------------------------------------------------------- تخطيط */

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------------------------------------------------------ شعار */

.logo {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);   /* §8: هدف لمس ≥ 48 بكسل */
  gap: 10px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--text);
}

.logo img, .logo svg { height: 34px; width: auto; display: block; }

.logo-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 20px;
  font-weight: 700;
  padding-bottom: 2px;   /* يوازن نزول حرف «ق» بصرياً */
}

/* ------------------------------------------------------------------ أزرار */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 16px 28px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  border: 1px solid transparent;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-block { display: flex; width: 100%; }

/* ------------------------------------------------------------- مبدّل اللغة */

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.langs li { margin: 0; max-width: none; }

.langs a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
}

.langs a:hover { background: var(--surface); color: var(--text); }
.langs a[aria-current="true"] { background: var(--surface); color: var(--text); }

/* ------------------------------------------------------------ رأس وتذييل */

.site-head {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-foot {
  margin-top: 72px;
  padding: 28px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.site-foot p { max-width: none; }

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.foot-links li { margin: 0; max-width: none; }

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
}

.foot-links a:hover { background: var(--surface); color: var(--text); }

/* ------------------------------------------------------------ بطل الصفحة */

.hero { padding: 64px 0 8px; }
.hero h1 { max-width: 16ch; }

.hero .lede {
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 32px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ------------------------------------------------------------------ مزايا */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  margin: 0;
  max-width: none;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.features b { display: block; margin-bottom: 6px; font-weight: 600; }
.features span { color: var(--muted); font-size: 15px; }

/* ------------------------------------------------------------------ لقطات */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin: 56px 0 0;
}

.shots img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  display: block;
}

/* --------------------------------------------------------- صفحات /dl */

.hero-center { text-align: center; }
.hero-center h1,
.hero-center .lede { margin-inline: auto; }
.hero-center .hero-cta { justify-content: center; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------- بطاقة وسط الشاشة (هبوط) */

.center-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  grid-template-columns: minmax(0, 1fr);   /* وإلّا فاض العمود إلى max-content */
  padding: 24px;
  text-align: center;
}

.card { width: 100%; max-width: 420px; }
.card p { max-width: none; }

.status-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
}

.status-ok   { color: var(--ok); }
.status-fail { color: var(--fail); }
.status-wait { color: var(--warn); }

.card .muted { color: var(--muted); margin: 0 0 28px; }

.hint {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.hint a { color: var(--muted); }

/* ------------------------------------------------------------- رمز QR /dl */

.qr {
  width: 208px;
  height: 208px;
  padding: 14px;
  background: #fff;
  border-radius: var(--radius);
  margin: 0 auto 24px;
}

.qr svg, .qr img { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------ نصّ قانوني */

.legal { padding: 40px 0 0; }
.legal .updated { color: var(--muted); font-size: 15px; margin-bottom: 40px; }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-bottom: 10px; }

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 16px;
}

.legal th, .legal td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: start;
  vertical-align: top;
}

.legal th { background: var(--surface); font-weight: 600; }
.legal td p:last-child, .legal th p:last-child { margin-bottom: 0; }

.note {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--muted);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  margin: 0 0 24px;
}

.note p:last-child { margin-bottom: 0; }

.never td { color: var(--muted); }

/* ------------------------------------------------------- وصول وحركة مخفّضة */

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
}

.skip:focus {
  inset-inline-start: 8px;
  z-index: 10;
  background: var(--surface);
  border-radius: 10px;
}

/*
 * قوائم الروابط في أسفل صفحات الدعم — تصفّح لا نصّ، فتأخذ حجم الهدف الكامل.
 * الروابط داخل الفقرات تبقى في مقاس النصّ: WCAG 2.5.8 يستثني ما كان داخل
 * جملة أو كتلة نصّ، ولا سبيل لتكبيرها دون تمزيق السطر.
 */
.link-list { list-style: none; padding: 0; margin: 0; }

.link-list li { margin: 0; max-width: none; }

.link-list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  margin-inline-start: -12px;
  border-radius: 10px;
}

.link-list a:hover { background: var(--surface); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 8px; }
  .site-foot { margin-top: 56px; }

  /* على الهاتف الأزرار بعرض الشاشة — هدف أكبر وصفّ أنظف. */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
}
