/* Cloud — هوية الموقع: كحلي داكن + سماوي + ذهبي */
:root {
  --bg: #0a1424;
  --bg-2: #0c1829;
  --card: #111e33;
  --card-2: #15243c;
  --border: #1f3452;
  --border-2: #2a4a6b;
  --cyan: #29abe2;
  --cyan-2: #4dd8f0;
  --cyan-soft: rgba(77, 216, 240, 0.12);
  --gold: #fbbf24;
  --gold-border: #b8963a;
  --text: #eef3f9;
  --text-2: #c4d0de;
  --muted: #8ea0b6;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan-2); text-decoration: none; }
img, svg { display: block; }
h1, h2, h3 { line-height: 1.4; margin: 0; }
p { margin: 0; }
.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: embed; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--cyan); color: #06223a; box-shadow: 0 10px 30px rgba(41, 171, 226, .25); }
.btn-gold { background: var(--gold); color: #2a1d00; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--cyan-2); }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.btn-sm { padding: 7px 14px; font-size: .88rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- الهيدر ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 20, 36, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 800; font-size: 1.35rem; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--cyan);
  display: grid; place-items: center; color: #06223a; flex: none;
}
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- الهيرو ---------- */
.hero {
  position: relative; overflow: hidden; padding: 70px 0 60px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(41, 171, 226, .22), transparent 60%),
    linear-gradient(180deg, #0d2340 0%, var(--bg) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(77, 216, 240, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 216, 240, .08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.pill {
  display: inline-block; padding: 6px 20px; border-radius: 999px;
  border: 1px solid rgba(77, 216, 240, .45); color: var(--cyan-2);
  background: rgba(77, 216, 240, .06); font-size: .92rem; margin-bottom: 22px;
}
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; margin-bottom: 22px; }
.hero p.lead { color: var(--text-2); font-size: 1.12rem; max-width: 640px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.hero-actions .btn { padding: 15px 34px; font-size: 1.05rem; }

/* معاينة لوحة التحكم داخل الهيرو */
.preview {
  border-radius: 24px; padding: 14px; background: linear-gradient(160deg, #123a5c, #0c1a2e);
  border: 1px solid var(--border-2); box-shadow: var(--shadow), 0 0 60px rgba(41, 171, 226, .18);
}
.preview-inner { background: var(--bg-2); border-radius: 16px; padding: 18px; border: 1px solid var(--border); }
.preview-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 700; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); display: block; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.preview-stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.preview-stat b { display: block; font-size: 1.3rem; }
.preview-stat span { font-size: .78rem; color: var(--muted); }
.preview-bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding: 8px 4px 0; border-bottom: 1px solid var(--border-2); }
.preview-bars i { flex: 1; background: var(--cyan); border-radius: 4px 4px 0 0; display: block; opacity: .9; }
.preview-rows { margin-top: 12px; display: grid; gap: 8px; }
.preview-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-2); background: var(--card); padding: 8px 12px; border-radius: 10px; }

/* ---------- الأقسام ---------- */
section.block { padding: 90px 0; }
section.block.alt { background: var(--bg-2); }
.section-title { text-align: center; font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; margin-bottom: 14px; }
.section-sub { text-align: center; color: var(--muted); max-width: 680px; margin: 0 auto 50px; font-size: 1.05rem; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px;
}
.feature .icon { color: var(--cyan-2); margin-bottom: 18px; }
.feature h3 { font-size: 1.25rem; margin-bottom: 10px; }
.feature p { color: var(--muted); }

.step { text-align: center; background: var(--card); border-radius: var(--radius); padding: 34px 26px; border: 1px solid transparent; }
.step .num {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px;
  display: grid; place-items: center; font-weight: 800; font-size: 1.4rem;
  background: var(--cyan); color: #06223a;
}
.step:nth-child(4) .num { background: var(--cyan-2); }
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .97rem; }
.step code { background: var(--card-2); padding: 1px 8px; border-radius: 6px; color: var(--cyan-2); direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* الباقات */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; max-width: 860px; margin-inline: auto; }
.plan {
  position: relative; border-radius: 26px; padding: 40px 34px 34px;
  background: linear-gradient(180deg, #14253f, #10203a);
  border: 2px solid #2b6e8a;
}
.plan.gold { border-color: var(--gold-border); box-shadow: 0 0 50px rgba(251, 191, 36, .08); }
.plan .tag {
  position: absolute; top: -17px; left: 30px; padding: 4px 18px; border-radius: 999px;
  background: var(--cyan-2); color: #06223a; font-size: .85rem; font-weight: 700;
}
.plan.gold .tag { background: var(--gold); color: #2a1d00; }
.plan h3 { color: var(--cyan-2); font-size: 1.6rem; }
.plan.gold h3 { color: var(--gold); }
.plan .price { font-size: 2.6rem; font-weight: 800; margin: 18px 0 22px; }
.plan .price small { font-size: 1.6rem; font-weight: 700; }
.plan hr { border: 0; border-top: 1px solid var(--border-2); margin: 0 0 22px; }
.plan dt { color: var(--cyan-2); font-size: .92rem; font-weight: 700; }
.plan dd { margin: 4px 0 18px; color: var(--text-2); }
.plan .note { margin-top: 8px; padding: 14px; text-align: center; border-radius: 12px; font-weight: 700; background: var(--cyan-soft); color: var(--cyan-2); }
.plan.gold .note { background: rgba(251, 191, 36, .1); color: var(--gold); }

/* الشروط (أكورديون) */
.terms { max-width: 860px; margin-inline: auto; display: grid; gap: 18px; }
.term { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.term.open { border-color: #2b6e8a; }
.term button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: none; border: 0; color: var(--text); font: inherit; font-weight: 800; font-size: 1.12rem;
  padding: 24px 28px; cursor: pointer; text-align: right;
}
.term button svg { color: var(--cyan-2); transition: transform .2s; flex: none; transform: rotate(180deg); }
.term.open button svg { transform: rotate(0deg); }
.term .body { display: none; padding: 0 28px 26px; color: var(--muted); }
.term.open .body { display: block; }
.center { text-align: center; }

/* الدعم */
.support { text-align: center; }
.support .handle {
  display: inline-block; margin: 30px 0 26px; padding: 18px 34px; border-radius: 14px;
  border: 1px dashed var(--border-2); background: var(--card); font-weight: 700;
}

footer.site-footer { border-top: 1px solid var(--border); padding: 44px 0; text-align: center; background: var(--bg-2); }
footer.site-footer b { font-size: 1.3rem; }
footer.site-footer p { color: var(--muted); margin-top: 6px; }
footer.site-footer nav { display: flex; gap: 24px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ---------- النماذج ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px;
  background: radial-gradient(ellipse at top, rgba(41, 171, 226, .18), transparent 60%), var(--bg); }
.auth-card { width: min(460px, 100%); }
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border-radius: 12px; padding: 4px; margin-bottom: 24px; border: 1px solid var(--border); }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700; padding: 10px; border-radius: 9px; cursor: pointer; }
.tabs button.active { background: var(--cyan); color: #06223a; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: .92rem; color: var(--text-2); }
.field small { color: var(--muted); font-size: .8rem; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border-2);
  background: var(--bg-2); color: var(--text); font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan-2); box-shadow: 0 0 0 3px rgba(77, 216, 240, .12); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--text-2); margin-bottom: 18px; }
.check input { width: auto; margin-top: 6px; }
.alert { padding: 12px 16px; border-radius: 11px; margin-bottom: 16px; font-size: .93rem; }
.alert-error { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); color: #fecaca; }
.alert-ok { background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .35); color: #bbf7d0; }
.alert-warn { background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .35); color: #fde68a; }
.link-btn { background: none; border: 0; color: var(--cyan-2); font: inherit; cursor: pointer; padding: 0; }

.result-card { max-width: 480px; text-align: center; }
.result-icon { font-size: 3rem; margin-bottom: 8px; }
.result-card h1 { margin-bottom: 10px; }
.result-card p { color: var(--text-2); margin-bottom: 22px; }

/* ---------- لوحة التحكم ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-left: 1px solid var(--border); padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .brand { margin: 0 8px 28px; }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px;
  color: var(--text-2); font-weight: 600;
}
.nav a:hover { background: var(--card); }
.nav a.active { background: var(--cyan-soft); color: var(--cyan-2); }
.sidebar .me { margin-top: auto; padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); font-size: .9rem; }
.sidebar .me b { display: block; }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; }
.page-head p { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.stat span { color: var(--muted); font-size: .88rem; display: block; }
.stat b { font-size: 1.75rem; font-weight: 800; display: block; margin-top: 4px; }
.stat small { color: var(--muted); font-size: .8rem; }
.stat.hero-stat { background: linear-gradient(160deg, #134468, #10243d); border-color: #2b6e8a; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; margin-bottom: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.15rem; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: right; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: .8rem; display: block; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-good { background: rgba(52, 211, 153, .12); color: var(--good); }
.badge-warn { background: rgba(251, 191, 36, .12); color: var(--warn); }
.badge-bad { background: rgba(248, 113, 113, .12); color: var(--bad); }
.badge-muted { background: rgba(142, 160, 182, .14); color: var(--muted); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 150px; padding: 9px 12px; }

/* الرسوم البيانية */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--cyan); }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart .bar-hit:hover + .bar, .chart g:hover .bar { fill: var(--cyan-2); }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .base-line { stroke: var(--border-2); stroke-width: 1; }
.tooltip {
  position: absolute; pointer-events: none; background: #0a1424; border: 1px solid var(--border-2);
  border-radius: 10px; padding: 8px 12px; font-size: .82rem; white-space: nowrap; box-shadow: var(--shadow);
  transform: translate(-50%, -110%); z-index: 5;
}
.tooltip b { display: block; font-size: .95rem; }
.hbars { display: grid; gap: 14px; }
.hbar-label { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.hbar-track { height: 10px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--cyan); border-radius: 6px; }

/* ربط القروب */
.link-box { border: 1px dashed var(--border-2); border-radius: 16px; padding: 22px; background: var(--bg-2); }
.code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2rem; letter-spacing: 6px; font-weight: 800;
  color: var(--cyan-2); background: var(--card); border: 1px solid var(--border-2); border-radius: 12px;
  padding: 10px 22px; display: inline-block; direction: ltr;
}
.link-steps { margin: 18px 0 0; padding-inline-start: 22px; color: var(--text-2); display: grid; gap: 10px; }
.link-steps code { background: var(--card); padding: 2px 8px; border-radius: 6px; color: var(--cyan-2); direction: ltr; display: inline-block; }

.switch { position: relative; width: 44px; height: 24px; display: inline-block; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-2); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; right: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--cyan); }
.switch input:checked + span::before { transform: translateX(-20px); }

.modal-bg { position: fixed; inset: 0; background: rgba(3, 8, 16, .7); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { width: min(480px, 100%); }
.modal h2 { margin-bottom: 18px; font-size: 1.2rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 8px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--card-2); border: 1px solid var(--border-2); padding: 12px 22px; border-radius: 12px;
  box-shadow: var(--shadow); font-weight: 600;
}
.loader { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }

.mobile-nav { display: none; }

/* ---------- الجوال ---------- */
@media (max-width: 960px) {
  .hero .container, .two-col { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav {
    display: flex; position: sticky; top: 0; z-index: 40; overflow-x: auto; gap: 6px; padding: 10px 12px;
    background: rgba(12, 24, 41, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
  }
  .mobile-nav a { flex: none; padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .9rem; }
  .mobile-nav a.active { background: var(--cyan-soft); color: var(--cyan-2); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  section.block { padding: 64px 0; }
  .site-header .btn { padding: 9px 14px; font-size: .9rem; }
  .header-actions .hide-sm { display: none; }
  .card { padding: 24px; }
  .preview-stats { grid-template-columns: repeat(3, 1fr); }
  .code { font-size: 1.5rem; letter-spacing: 4px; }
}
