/* صفحة هبوط Link ERP. الألوان والخط ونصف القطر من src/app/globals.css في التطبيق */

@font-face { font-family: "Tajawal"; font-weight: 400; font-display: swap; src: url(fonts/tajawal-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 400; font-display: swap; src: url(fonts/tajawal-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url(fonts/tajawal-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url(fonts/tajawal-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url(fonts/tajawal-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url(fonts/tajawal-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url(fonts/tajawal-arabic-800-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url(fonts/tajawal-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --radius: 0.625rem;
  --background: oklch(0.99 0.002 250);
  --foreground: oklch(0.18 0.01 250);
  --card: oklch(1 0 0);
  --primary: oklch(0.55 0.13 156);
  --primary-foreground: oklch(0.99 0 0);
  --muted: oklch(0.96 0.005 250);
  --muted-foreground: oklch(0.47 0.01 250);
  --accent: oklch(0.94 0.03 156);
  --accent-foreground: oklch(0.3 0.05 156);
  --warning: oklch(0.75 0.15 65);
  --warning-foreground: oklch(0.2 0.05 65);
  --border: oklch(0.9 0.005 250);
  /* نص وروابط بلون العلامة: أغمق قليلاً من الأساسي ليقرأ على الأبيض */
  --brand-text: oklch(0.47 0.12 156);
  /* لوحة الرسم وقسم التواصل */
  --sheet: oklch(0.33 0.065 156);
  --sheet-line: oklch(0.96 0.02 156);
  --sheet-muted: oklch(0.87 0.04 156);
  --sheet-grid: oklch(1 0 0 / 7%);
  color-scheme: light;
}
.dark {
  --background: oklch(0.16 0.01 250);
  --foreground: oklch(0.97 0 0);
  --card: oklch(0.21 0.012 250);
  --primary: oklch(0.65 0.15 156);
  --primary-foreground: oklch(0.15 0.01 250);
  --muted: oklch(0.19 0.011 250);
  --muted-foreground: oklch(0.72 0.01 250);
  --accent: oklch(0.32 0.04 156);
  --accent-foreground: oklch(0.95 0.02 156);
  --border: oklch(1 0 0 / 11%);
  --brand-text: oklch(0.74 0.14 156);
  --sheet: oklch(0.27 0.048 156);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: "Tajawal", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { line-height: 1.35; text-wrap: balance; }
h1 { font-size: clamp(2.125rem, 1.35rem + 3.1vw, 3.5rem); font-weight: 800; line-height: 1.25; }
h2 { font-size: clamp(1.625rem, 1.25rem + 1.5vw, 2.375rem); font-weight: 800; }
h3 { font-size: 1.1875rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.sheet :focus-visible, .contact :focus-visible { outline-color: var(--warning); }

.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 20; background: var(--primary); color: var(--primary-foreground); padding: .5rem 1rem; border-radius: var(--radius); }
.skip:focus { top: .75rem; }

/* الرأس */
.top { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; gap: .5rem; min-height: 4rem; position: relative; }
.brand { display: flex; align-items: center; gap: .625rem; margin-inline-end: auto; font-weight: 800; font-size: 1.25rem; color: var(--brand-text); text-decoration: none; }
.app-icon { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: var(--radius); background: var(--primary); color: var(--primary-foreground); }
.links { display: flex; gap: .25rem; margin-inline-end: .75rem; }
.links a { padding: .375rem .75rem; border-radius: calc(var(--radius) - 2px); text-decoration: none; font-weight: 500; font-size: 1rem; }
.links a:hover { background: var(--accent); color: var(--accent-foreground); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: var(--radius); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.icon-button:hover { background: var(--accent); color: var(--accent-foreground); }
.menu-button { display: none; }
.only-dark, .dark .only-light { display: none; }
.dark .only-dark { display: block; }
html:not(.js) .icon-button { display: none; }

@media (max-width: 62rem) {
  .js .menu-button { display: inline-flex; }
  .js .links { display: none; position: absolute; top: 100%; inset-inline: -1rem; margin: 0; padding: .5rem 1rem 1rem; flex-direction: column; background: var(--card); border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px oklch(0 0 0 / 14%); }
  .js .links.open { display: flex; }
  .js .links a { padding: .75rem; }
  html:not(.js) .top { position: static; }
  html:not(.js) .top-row { flex-wrap: wrap; padding-block: .5rem; }
  html:not(.js) .links { flex-wrap: wrap; width: 100%; }
}

/* الواجهة الأولى */
.hero { padding-block: clamp(2.5rem, 6vw, 5.5rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero-text { display: grid; gap: 1.5rem; justify-items: start; }
.lede { font-size: clamp(1.125rem, 1rem + .5vw, 1.3125rem); color: var(--muted-foreground); max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: .5rem 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-weight: 700; text-decoration: none; }
.button:hover { background: var(--accent); color: var(--accent-foreground); }
.button.primary { background: var(--brand-text); border-color: var(--brand-text); color: var(--primary-foreground); }
.dark .button.primary { color: var(--primary-foreground); }
.button.primary:hover { filter: brightness(1.08); }
.note { font-size: .9375rem; color: var(--muted-foreground); }

.sheet {
  padding: clamp(.75rem, 2.5vw, 1.75rem); border-radius: calc(var(--radius) + 6px); color: var(--sheet-line);
  background-color: var(--sheet);
  background-image: linear-gradient(var(--sheet-grid) 1px, transparent 1px), linear-gradient(90deg, var(--sheet-grid) 1px, transparent 1px);
  background-size: 1.5rem 1.5rem;
}
.drawing { display: block; width: 100%; height: auto; }
.drawing .lines { fill: none; stroke: var(--sheet-line); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.drawing .accent { stroke: var(--warning); stroke-width: 2.5; }
.drawing .dims { stroke: var(--warning); stroke-width: 2; }
.drawing .labels { fill: var(--sheet-line); font-size: 17px; font-weight: 700; }
/* الرسم يصغر على الهاتف، فتكبر أسماؤه لتبقى مقروءة */
@media (max-width: 32rem) { .drawing .labels { font-size: 20px; } }
.sheet figcaption { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--sheet-grid); font-size: .9375rem; color: var(--sheet-muted); }

/* حركة واحدة: ترسم خطوط القياس ثم تظهر أسماؤها */
@media (prefers-reduced-motion: no-preference) {
  .drawing .dims path { stroke-dasharray: 1; animation: draw .9s .25s ease-out both; }
  .drawing .labels { animation: appear .5s .95s ease-out both; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 60rem) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 3.5rem; } }

/* الأقسام */
section:not(.hero) { padding-block: clamp(3rem, 7vw, 5.5rem); }
.band { background: var(--muted); border-block: 1px solid var(--border); }
.head { display: grid; gap: .625rem; max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.head p { color: var(--muted-foreground); }

/* دورة الطلبية: شريط قياس تقع عليه الخطوات */
.tape, .steps { counter-reset: step; }
.tape { display: grid; }
.tape li { counter-increment: step; position: relative; padding: 0 3.75rem 1.75rem 0; }
.tape li::before, .steps li::before {
  content: counter(step); display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
  border-radius: 50%; background: var(--warning); color: var(--warning-foreground); font-weight: 800; line-height: 1;
}
.tape li::before { position: absolute; top: 0; right: 0; z-index: 1; }
/* الشريط نفسه بتدريجاته: رأسي في الشاشة الضيقة */
.tape li::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: .8125rem; width: .625rem;
  background: repeating-linear-gradient(to bottom, var(--warning) 0 2px, transparent 2px 8px);
  opacity: .75;
}
.tape li:last-child { padding-bottom: 0; }
.tape li:last-child::after { display: none; }
.tape h3 { padding-top: .25rem; }
.tape p { margin-top: .25rem; color: var(--muted-foreground); font-size: 1rem; line-height: 1.7; }

@media (min-width: 44rem) {
  .tape { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2.25rem; }
  .tape li, .tape li:last-child { padding: 3.5rem 0 0 1.5rem; }
  .tape li::after, .tape li:last-child::after {
    display: block; top: .8125rem; bottom: auto; right: 0; left: 0; width: auto; height: .625rem;
    background: repeating-linear-gradient(to left, var(--warning) 0 2px, transparent 2px 8px);
  }
}
@media (min-width: 68rem) {
  .tape { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tape li, .tape li:last-child { padding-left: 1rem; }
}

.cost { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding: clamp(1.25rem, 3vw, 2rem); background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); }
.cost dl { display: grid; margin-block: 1rem; }
.cost dl div { display: grid; gap: .25rem 1.5rem; padding-block: .875rem; border-top: 1px solid var(--border); }
.cost dt { font-weight: 800; color: var(--brand-text); }
.cost > p { color: var(--muted-foreground); font-size: .9375rem; }
@media (min-width: 44rem) { .cost dl div { grid-template-columns: 6rem 1fr; } }

/* أقسام النظام: جدول بسطور، لا بطاقات */
.modules { display: grid; column-gap: 3.5rem; }
.modules li { padding-block: 1.5rem; border-top: 1px solid var(--border); }
.modules h3 { display: flex; align-items: center; gap: .75rem; }
.modules h3 .icon { width: 1.5rem; height: 1.5rem; color: var(--brand-text); }
.modules p { margin-top: .5rem; padding-inline-start: 2.25rem; color: var(--muted-foreground); }
@media (min-width: 52rem) { .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.reports { margin-top: 2rem; padding: clamp(1.25rem, 3vw, 2rem); background: var(--accent); color: var(--accent-foreground); border-radius: calc(var(--radius) + 4px); }
.report-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem; margin-top: 1.25rem; }
.report-groups h4 { padding-bottom: .5rem; margin-bottom: .5rem; border-bottom: 2px solid var(--primary); }

.points { display: grid; gap: 2rem 3.5rem; }
.points > div { padding-inline-start: 1.25rem; border-inline-start: 3px solid var(--primary); }
.points p { margin-top: .5rem; color: var(--muted-foreground); }
@media (min-width: 48rem) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* مخطط الشبكة */
.lan { display: grid; justify-items: stretch; }
.host { display: grid; justify-items: start; align-content: center; gap: .375rem; padding: 1.5rem; border-radius: calc(var(--radius) + 4px); background: var(--sheet); color: var(--sheet-line); }
.host .icon { width: 2.75rem; height: 2.75rem; stroke-width: 1.5; }
.host b { font-size: 1.375rem; font-weight: 800; }
.host span { color: var(--sheet-muted); }
.wire { display: flex; align-items: center; justify-content: center; min-height: 4.5rem; position: relative; }
.wire::before { content: ""; position: absolute; top: 0; bottom: 0; right: 50%; border-right: 3px dashed var(--primary); }
.wire span { position: relative; padding: .125rem .875rem; border-radius: 99px; background: var(--accent); color: var(--accent-foreground); font-size: .875rem; font-weight: 700; white-space: nowrap; }
.clients { display: grid; gap: .75rem; }
.clients li { display: flex; align-items: center; gap: 1rem; padding: .875rem 1.25rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.clients .icon { width: 1.75rem; height: 1.75rem; color: var(--brand-text); }
.clients span { display: grid; line-height: 1.5; color: var(--muted-foreground); font-size: .9375rem; }
.clients b { color: var(--foreground); font-size: 1.0625rem; }

@media (min-width: 48rem) {
  .lan { grid-template-columns: minmax(0, 1fr) minmax(9rem, .7fr) minmax(0, 1fr); align-items: stretch; }
  /* خط أفقي من الجهاز الرئيسي، ثم فرع لكل جهاز */
  .wire::before { top: 50%; bottom: auto; right: 0; left: 0; border-right: 0; border-top: 3px dashed var(--primary); }
  .clients { grid-auto-rows: 1fr; position: relative; padding-inline-start: 2rem; }
  .clients li { position: relative; }
  .clients li::before { content: ""; position: absolute; top: 50%; right: -2rem; width: 2rem; border-top: 3px dashed var(--primary); }
  .clients li::after { content: ""; position: absolute; right: -2rem; top: -.75rem; bottom: 0; border-right: 3px dashed var(--primary); }
  .clients li:first-child::after { top: 50%; }
  .clients li:last-child::after { bottom: 50%; }
}

.steps { display: grid; gap: 2rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.25rem 1fr; column-gap: 1rem; align-content: start; }
.steps li::before { grid-row: span 2; }
.steps h3 { padding-top: .25rem; }
.steps p { margin-top: .25rem; color: var(--muted-foreground); }
.steps bdi { display: inline-block; padding: 0 .5rem; border-radius: calc(var(--radius) - 4px); background: var(--muted); border: 1px solid var(--border); color: var(--foreground); font-weight: 700; overflow-wrap: anywhere; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3.5rem; } }

.facts { display: grid; gap: .875rem; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.facts li { color: var(--muted-foreground); }
.facts b { color: var(--foreground); }

/* حالات الترخيص */
.states { display: grid; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); overflow: hidden; }
.states > div { display: grid; align-content: start; gap: .5rem; padding: 1.5rem; }
.states > div + div { border-top: 1px solid var(--border); }
.states .when { font-weight: 700; color: var(--brand-text); }
.states p:last-child { color: var(--muted-foreground); }
.states .current { background: var(--accent); color: var(--accent-foreground); }
.states .current p { color: inherit; }
#license .note { margin-top: 1.25rem; }
@media (min-width: 52rem) {
  .states { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .states > div + div { border-top: 0; border-inline-start: 1px solid var(--border); }
}

/* التواصل */
.contact { background: var(--sheet); color: var(--sheet-line); }
.contact .head p { color: var(--sheet-muted); }
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .75rem; }
.channels a { display: flex; align-items: center; gap: 1rem; height: 100%; padding: 1rem 1.25rem; border: 1px solid oklch(1 0 0 / 22%); border-radius: var(--radius); text-decoration: none; }
.channels a:hover { background: oklch(1 0 0 / 10%); border-color: var(--warning); }
.channels .icon { width: 1.75rem; height: 1.75rem; color: var(--warning); }
.channels span { display: grid; min-width: 0; line-height: 1.5; font-size: .9375rem; color: var(--sheet-muted); }
.channels bdi { justify-self: start; font-size: 1.125rem; font-weight: 700; color: var(--sheet-line); overflow-wrap: anywhere; }
.address { display: flex; align-items: center; gap: .5rem; margin-top: 1.5rem; color: var(--sheet-muted); }

footer { padding-block: 2rem; background: var(--card); font-size: .9375rem; color: var(--muted-foreground); }
.foot { display: grid; gap: .25rem; }

/* شاشات كبيرة: تكبر الصفحة كلها كما يكبر التطبيق */
@media (min-width: 1920px) { html { font-size: 18px; } }
@media (min-width: 2560px) { html { font-size: 21px; } }
@media (min-width: 3400px) { html { font-size: 28px; } }

@media print {
  .top, .actions { display: none; }
}
