/* ═══════ مُوَلّد القوائم المالية — Design System v2.0 "Premium Glass" ═══════
   ثيم زجاجي داكن فاخر: خلفية متدرجة عميقة + زجاج حقيقي + فيزياء Jelly.
   RTL بالكامل · Mobile-First · صفر اعتماديات خارجية */

:root {
  --navy-950: #060f22;
  --navy-900: #0b1f3a;
  --navy-800: #10294b;
  --navy-700: #16345e;
  --gold-500: #d4af37;
  --gold-600: #b8901f;
  --gold-900: #3a2f0d;
  --ink: #eef2f8;                  /* نص فاتح على الداكن */
  --muted: #9db0c9;
  --glass: rgba(255, 255, 255, 0.10);
  --glass-hi: rgba(255, 255, 255, 0.16);
  --glass-line: rgba(255, 255, 255, 0.18);
  --green: #4ade80;
  --red: #f87171;
  --line: rgba(255, 255, 255, 0.18);   /* توافقية مع المكونات القديمة */
  --radius: 18px;
  --ease-jelly: cubic-bezier(0.34, 1.8, 0.44, 1);
}

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

html {
  scroll-behavior: smooth;
  /* التدرج العميق: كحلي ليلي → كحلي → ذهبي داكن في الأفق */
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(212, 175, 55, 0.14), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(22, 52, 94, 0.55), transparent 65%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 48%, #1a2332 82%, var(--gold-900) 130%);
  background-attachment: fixed;
  min-height: 100%;
}

body {
  font-family: "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
  color: var(--ink);
  line-height: 1.85;
  direction: rtl;
  background: transparent;
}

.container { width: min(1100px, 92%); margin-inline: auto; }

/* ── الترويسة الزجاجية ── */
.site-header {
  background: rgba(6, 15, 34, 0.55);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  color: #fff;
  padding: 1.1rem 0;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--glass-line);
  box-shadow: 0 1px 0 rgba(212, 175, 55, 0.35), 0 12px 40px rgba(0,0,0,.25);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: #fff; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  display: grid; place-items: center;
  font-weight: 800; color: var(--navy-950); font-size: 1.35rem;
  box-shadow: 0 6px 18px rgba(212,175,55,.35);
}
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-name small { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.main-nav { display: flex; gap: 1.5rem; align-items: center; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; transition: color .2s; }
.main-nav a:hover { color: var(--gold-500); }
.nav-cta {
  background: var(--gold-500); color: var(--navy-950) !important;
  padding: .5rem 1.2rem; border-radius: 10px; font-weight: 800;
  box-shadow: 0 4px 16px rgba(212,175,55,.3);
}

/* ── البطل ── */
.hero { color: #fff; padding: 4rem 0 5.5rem; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.8rem); font-weight: 800; margin-bottom: 1.1rem; text-shadow: 0 4px 30px rgba(0,0,0,.4); }
.hero h1 span { color: var(--gold-500); }
.hero p { color: #b9c8dd; max-width: 660px; margin: 0 auto 2.4rem; font-size: 1.08rem; }
.badges { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.badge {
  border: 1px solid var(--glass-line); border-radius: 999px;
  padding: .3rem 1rem; font-size: .8rem; color: #dbe4ef;
  background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* ── الزجاج الفاخر — القاعدة المشتركة ── */
.access-card, .tool-panel, .step, .tool-card, .jelly-glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 16px 48px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

/* الوهج المتبع للمؤشر */
.jelly-glass::before, .tool-panel::before, .access-card::before, .step::before, .tool-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(480px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(212, 175, 55, 0.12), transparent 60%);
  opacity: 0; transition: opacity .35s;
  pointer-events: none; z-index: 0;
}
.jelly-glass:hover::before, .tool-panel:hover::before,
.access-card:hover::before, .step:hover::before, .tool-card:hover::before { opacity: 1; }

/* ── بطاقة الدخول ── */
.access-card {
  max-width: 480px; margin: -4rem auto 0; padding: 2.6rem 2.2rem;
  z-index: 5; border-top: 3px solid var(--gold-500);
}
.access-card h2 { font-size: 1.2rem; color: #fff; margin-bottom: .5rem; }
.access-card .hint { font-size: .87rem; color: var(--muted); margin-bottom: 1.4rem; }

/* ── الحقول الزجاجية ── */
.field { margin-bottom: 1.2rem; position: relative; z-index: 1; }
.field label { display: block; font-size: .92rem; font-weight: 700; color: #dbe4f2; margin-bottom: .45rem; }
.field input, .field select, .code-input {
  width: 100%; padding: .85rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid var(--glass-line);
  border-radius: 12px;
  font-family: inherit; font-size: 1rem; color: var(--ink);
  transition: border-color .25s, box-shadow .4s var(--ease-jelly), transform .3s var(--ease-jelly);
}
.field input::placeholder { color: rgba(157, 176, 201, .55); }
.field select option { background: var(--navy-900); color: var(--ink); }
.field input:focus, .field select:focus, .code-input:focus {
  outline: none; border-color: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.14), 0 8px 26px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.field input.ltr, .code-input { direction: ltr; text-align: left; }
.code-input {
  font-size: 1.3rem; text-align: center; letter-spacing: .25em;
  font-family: "Courier New", monospace; font-weight: 700;
}

/* ── الأزرار — قاعدة فيزياء Jelly (التحويلات في jelly.js) ── */
.btn {
  display: inline-block; width: 100%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
  color: #fff; border: 1px solid var(--glass-line); border-radius: 12px;
  padding: 1rem; font-size: 1.05rem; font-weight: 800; font-family: inherit;
  cursor: pointer; margin-top: 1.1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.15);
  will-change: transform; position: relative; z-index: 1;
}
.btn:hover { box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.2); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--navy-950); border-color: rgba(255,255,255,.3);
  box-shadow: 0 6px 24px rgba(212,175,55,.35);
}
.form-msg { margin-top: .9rem; font-size: .9rem; min-height: 1.4em; text-align: center; position: relative; z-index: 1; }
.form-msg.error { color: var(--red); }
.form-msg.ok { color: var(--green); }
.zero-trust-note {
  display: flex; align-items: center; gap: .5rem; justify-content: center;
  margin-top: 1.3rem; font-size: .8rem; color: var(--muted); position: relative; z-index: 1;
}

/* ── الأقسام ── */
.section { padding: 4.5rem 0; position: relative; }
.section:first-of-type { padding-top: 2.8rem; }   /* لا فراغ ميت تحت الترويسة */
.section-title { text-align: center; color: #fff; font-size: 1.6rem; font-weight: 800; margin-bottom: .6rem; text-shadow: 0 4px 24px rgba(0,0,0,.4); }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 2.6rem; font-size: .98rem; }

.steps { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.step { padding: 1.8rem 1.5rem; }
.step > * { position: relative; z-index: 1; }
.step-num {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--navy-950);
  display: grid; place-items: center; font-weight: 800; margin-bottom: .8rem;
  box-shadow: 0 4px 14px rgba(212,175,55,.3);
}
.step h3 { font-size: 1.02rem; color: #fff; margin-bottom: .35rem; }
.step p { font-size: .88rem; color: var(--muted); }

.tools-grid { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.tool-card { padding: 1.9rem 1.6rem; text-decoration: none; color: inherit; display: block; transition: transform .45s var(--ease-jelly), box-shadow .3s; }
.tool-card:hover { transform: translateY(-6px); }
.tool-card > * { position: relative; z-index: 1; }
.tool-icon { font-size: 1.9rem; margin-bottom: .7rem; }
.tool-card h3 { color: #fff; font-size: 1.06rem; margin-bottom: .4rem; }
.tool-card p { font-size: .88rem; color: var(--muted); }

/* ── صفحات الأدوات ── */
.tool-panel { padding: 2.2rem 2rem; margin-bottom: 2.2rem; }
.tool-panel > * { position: relative; z-index: 1; }
.tool-panel h2 { color: #fff; font-size: 1.25rem; margin-bottom: .4rem; }
.tool-panel .desc { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }

.result {
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid rgba(212, 175, 55, 0.28);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 14px; padding: 1.2rem 1.4rem; margin-top: 1.2rem;
  font-size: .97rem; display: none;
}
.result.show { display: block; animation: jellyIn .5s var(--ease-jelly); }
.result .big { font-size: 1.4rem; font-weight: 800; color: var(--gold-500); }
.result.ok { background: rgba(74, 222, 128, 0.10); border-color: rgba(74, 222, 128, 0.3); }
.result.ok .big { color: var(--green); }
.result.err { background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.3); }
.result.err .big { color: var(--red); }
@keyframes jellyIn { from { opacity: 0; transform: scale(.94) translateY(8px); } }

.tabs { display: flex; gap: .55rem; margin-bottom: 1.4rem; flex-wrap: wrap; position: relative; z-index: 1; }
.tab {
  border: 1.5px solid var(--glass-line);
  background: var(--glass); color: var(--ink);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 10px; padding: .45rem 1.1rem;
  cursor: pointer; font-family: inherit; font-size: .9rem;
  will-change: transform;
}
.tab.active { border-color: var(--gold-500); background: rgba(212,175,55,.18); color: var(--gold-500); font-weight: 800; }

.isic-row { padding: .75rem .95rem; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; gap: .85rem; align-items: baseline; }
.isic-row code { background: rgba(212,175,55,.16); color: var(--gold-500); border: 1px solid rgba(212,175,55,.3); border-radius: 7px; padding: .12rem .6rem; font-size: .85rem; direction: ltr; }
.isic-row span { font-size: .93rem; }
.isic-empty { padding: 1.1rem; color: var(--muted); text-align: center; font-size: .9rem; }

/* ── التذييل ── */
.site-footer {
  background: rgba(6, 15, 34, 0.6);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-line);
  color: var(--muted); padding: 2.6rem 0; margin-top: 3.5rem;
  font-size: .87rem; text-align: center;
}
.site-footer strong { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 640px) {
  .main-nav a:not(.nav-cta) { display: none; }
  .access-card { margin-inline: 4%; }
  .tool-panel { padding: 1.6rem 1.2rem; }
}
