/* MUDAR Connect — بوابة المطورين. ألوان مُدار: كحلي #0A2342، أزرق #0E5A8A، سماوي #12D6D0 */
:root {
  --bg: #F4F7FB; --surface: #FFFFFF; --surface-2: #EEF3F9; --ink: #0A2342; --ink-2: #344B68; --muted: #5B6F88;
  --line: #D7E0EC; --accent: #0E5A8A; --accent-ink: #FFFFFF; --cyan: #0B8F8B; --ok: #1E7A46; --warn: #8A5410; --bad: #B3261E;
  --code-bg: #0B1A30; --code-ink: #DCE7F5; --radius: 14px;
  --ff: 'IBM Plex Sans Arabic', system-ui, sans-serif; --ff-h: 'El Messiri', Georgia, serif; --ff-m: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #08131F; --surface: #0F1E31; --surface-2: #152840; --ink: #E7EEF7; --ink-2: #BFCDE0; --muted: #93A6BF;
    --line: #23395A; --accent: #4CB8E6; --accent-ink: #06121F; --cyan: #3FD6CF; --ok: #6FD39A; --warn: #E7B06A; --bad: #FF8A80; --code-bg: #050D18; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--ff); }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { inset-inline-start: 8px; z-index: 10; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--ff-h); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--ff-m); font-size: .88em; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
pre { direction: ltr; text-align: left; background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 8px 0 14px; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; color: inherit; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { font-family: var(--ff-h); font-size: 1.15rem; color: var(--ink); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.brand b { color: var(--accent); }
.mark { color: var(--cyan); }
.top nav { display: flex; gap: 6px 16px; align-items: center; flex-wrap: wrap; font-weight: 500; }
.top nav a { text-decoration: none; color: var(--ink-2); padding: 6px 2px; }
.top nav a[aria-current=page] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.top nav .lang { font-size: .9rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink) !important;
  border-radius: 10px; padding: 10px 18px; font: 600 1rem var(--ff); cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .92rem; }
.btn.ghost { background: transparent; color: var(--accent) !important; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad) !important; }
.btn:hover { filter: brightness(1.08); }

.hero { padding: 56px 0 36px; }
.hero p { font-size: 1.12rem; color: var(--ink-2); max-width: 760px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--ink-2); margin: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.steps li::before { content: counter(s); flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.apis { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.apis a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.apis a:hover { border-color: var(--accent); }
.apis small { display: block; color: var(--muted); }

.form { max-width: 620px; margin: 32px auto 56px; }
.form .card { padding: 24px; }
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select, .field textarea { width: 100%; font: 1rem var(--ff); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.field textarea { min-height: 90px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 16px; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
.alert { border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; border: 1px solid; }
.alert.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.alert.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.alert.info { border-color: var(--line); background: var(--surface-2); }
.muted { color: var(--muted); }

.dash { padding: 28px 0 56px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pill { display: inline-block; font-size: .82rem; font-weight: 600; border-radius: 999px; padding: 3px 12px; border: 1px solid var(--line); background: var(--surface-2); }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { white-space: nowrap; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline .field { margin: 0; flex: 1 1 180px; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.checklist .y { color: var(--ok); font-weight: 700; }
.checklist .n { color: var(--muted); font-weight: 700; }
.secret { font-family: var(--ff-m); direction: ltr; background: var(--code-bg); color: var(--code-ink); padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; }

.docs { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 28px 0 56px; align-items: start; }
@media (max-width: 900px) { .docs { grid-template-columns: 1fr; } .docs aside { position: static !important; } }
.docs aside { position: sticky; top: 76px; font-size: .93rem; }
.docs aside a { display: block; padding: 4px 0; color: var(--ink-2); text-decoration: none; }
.docs aside a:hover { color: var(--accent); }
.docs aside b { display: block; margin: 12px 0 4px; font-family: var(--ff-h); }
.ep { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; scroll-margin-top: 80px; }
.ep-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; direction: ltr; justify-content: flex-start; }
.m { font: 700 .78rem var(--ff-m); border-radius: 6px; padding: 2px 8px; color: #fff; }
.m.GET { background: #1E7A46; } .m.POST { background: #0E5A8A; } .m.PUT { background: #7A4E0E; } .m.PATCH { background: #6B3FA0; } .m.DELETE { background: #B3261E; }
.ep-path { font-family: var(--ff-m); font-weight: 500; overflow-wrap: anywhere; }
.ep p { margin: 8px 0; color: var(--ink-2); }
.lbl { font-size: .8rem; font-weight: 600; color: var(--muted); margin-top: 8px; }

.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 18px 0; font-size: .88rem; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
