/* Madar Swap — نفس هوية الموقع الرسمي (أسود عميق + أزرق ملكي). خطوط النظام فقط، بلا أي ملف خارجي. */
:root {
  --bg: #030407; --bg-2: #07090f; --panel: #0a0e17; --field: #060912;
  --line: rgba(110, 140, 220, 0.14); --line-2: rgba(110, 140, 220, 0.28);
  --text: #eef3fc; --muted: #8e9ab0; --blue: #3d7bff; --indigo: #1d4ed8; --teal: #5aa9ff;
  --good: #34d399; --warn: #fbbf24; --bad: #f87171;
  --grad: linear-gradient(120deg, #7cc0ff, var(--blue) 50%, var(--indigo));
  --font: "Segoe UI", system-ui, -apple-system, Tahoma, "Noto Sans Arabic", "Geeza Pro", sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.wrap { width: min(1100px, 100% - 32px); margin: 0 auto; }

/* الخلفية: وهج ومدارات هادئة */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(900px 520px at 80% -10%, rgba(29, 78, 216, 0.30), transparent 60%),
    radial-gradient(700px 480px at -10% 35%, rgba(61, 123, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 50% 115%, rgba(29, 78, 216, 0.16), transparent 60%),
    var(--bg); }
.sky::before, .sky::after { content: ""; position: absolute; border: 1px solid rgba(120, 160, 255, 0.10); border-radius: 50%; animation: drift 40s linear infinite; }
.sky::before { width: 1100px; height: 420px; top: 90px; right: -320px; transform: rotate(-18deg); }
.sky::after { width: 1500px; height: 560px; top: 40px; right: -520px; border-color: rgba(90, 169, 255, 0.06); animation-duration: 60s; animation-direction: reverse; }
@keyframes drift { from { transform: rotate(-18deg); } to { transform: rotate(342deg); } }

/* الترويسة */
header { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(14px); background: rgba(6, 10, 19, 0.72); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 32px; height: 32px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.beta { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; color: var(--teal); border: 1px solid rgba(90, 169, 255, .4); background: rgba(61, 123, 255, .1); border-radius: 999px; padding: 1px 7px; margin-inline-start: 2px; }
.links { display: flex; gap: 4px; }
.links a { color: var(--muted); padding: 7px 12px; border-radius: 10px; font-size: 14px; transition: color .2s, background .2s; }
.links a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.pill { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); border-radius: 999px; padding: 7px 14px; font-size: 14px; transition: border-color .2s, background .2s, transform .15s; }
.pill:hover { border-color: rgba(90, 169, 255, .5); }
.pill.primary { background: linear-gradient(120deg, var(--indigo), var(--blue)); border-color: transparent; font-weight: 600; box-shadow: 0 6px 24px rgba(29, 78, 216, .35); }
.pill.ok { border-color: rgba(52, 211, 153, .45); display: inline-flex; align-items: center; gap: 7px; }
.pill.ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }

/* البطل */
.hero { text-align: center; padding: 46px 0 22px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 13px; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.2; margin: 16px 0 8px; letter-spacing: -.5px; }
[dir="rtl"] h1 { letter-spacing: 0; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); margin: 0; font-size: 16px; }

/* بطاقة التحويل: إطار مضيء متدرّج + وهج */
.card { position: relative; width: min(480px, 100%); margin: 18px auto 0; padding: 18px; border-radius: 24px; border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box,
              linear-gradient(140deg, rgba(124, 192, 255, .55), rgba(29, 78, 216, .12) 45%, rgba(90, 169, 255, .45)) border-box;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 60px rgba(29, 78, 216, .18); animation: rise .6s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.card-head b { font-size: 17px; }
select.chain { background: var(--field); border: 1px solid var(--line-2); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }

.field { background: var(--field); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; transition: border-color .2s, box-shadow .2s; }
.field:focus-within { border-color: rgba(90, 169, 255, .45); box-shadow: 0 0 0 3px rgba(61, 123, 255, .12); }
.field-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.field-top button { background: rgba(61, 123, 255, .12); border: 0; color: var(--teal); padding: 0 8px; margin-inline-start: 6px; border-radius: 6px; font-size: 12px; }
.field-main { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.field-main input, .field-main .out { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 30px; font-weight: 600; direction: ltr; text-align: start; font-family: var(--font); padding: 0; }
.field-main .out { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .2s; }
.field-main .out.dim { color: var(--muted); }
.field-main .out.loading { color: transparent; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(90,169,255,.14), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.tok { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 6px 12px 6px 7px; font-weight: 600; white-space: nowrap; transition: border-color .2s, transform .15s; }
.tok:hover { border-color: rgba(90, 169, 255, .55); transform: translateY(-1px); }
.badge { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
img.badge { object-fit: cover; background: #0f1626; }
.row .badge { width: 32px; height: 32px; }
.flip { display: flex; justify-content: center; margin: -10px 0; position: relative; z-index: 1; }
.flip button { width: 40px; height: 40px; border-radius: 14px; border: 4px solid var(--panel); background: #0f1626; color: var(--teal); font-size: 18px; transition: transform .35s ease, background .2s; }
.flip button:hover { transform: rotate(180deg); background: #16213a; }

.details { margin: 14px 4px 2px; font-size: 13px; color: var(--muted); animation: fade .3s ease; }
.details div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.details .fee { color: var(--teal); direction: ltr; unicode-bidi: isolate; }
.details .bad { color: var(--bad); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.slip { display: flex; gap: 6px; align-items: center; }
.slip button { border: 1px solid var(--line-2); background: transparent; border-radius: 8px; padding: 0 8px; font-size: 12px; color: var(--muted); transition: all .15s; }
.slip button.on { border-color: var(--blue); color: var(--text); background: rgba(61, 123, 255, .12); }

.main-btn { position: relative; overflow: hidden; width: 100%; margin-top: 14px; border: 0; border-radius: 18px; padding: 16px; font-size: 16.5px; font-weight: 700; background: linear-gradient(120deg, var(--indigo), var(--blue)); box-shadow: 0 10px 30px rgba(29, 78, 216, .35); transition: transform .15s, box-shadow .2s, filter .2s; }
.main-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s; }
.main-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(29, 78, 216, .5); }
.main-btn:not(:disabled):hover::after { transform: translateX(120%); }
.main-btn:disabled { background: #141b2b; color: var(--muted); box-shadow: none; }
.main-btn.danger { background: linear-gradient(120deg, #7f1d1d, #b91c1c); }
.msg { margin-top: 10px; font-size: 13.5px; text-align: center; min-height: 20px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--good); animation: pop .35s ease; }
.msg a { color: var(--teal); text-decoration: underline; }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
.lock { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* الشبكات */
.nets { text-align: center; margin-top: 34px; }
.nets p { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); font-size: 13px; direction: ltr; }
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.d-bnb { background: #f3ba2f; } .d-eth { background: #8c9eff; } .d-sol { background: linear-gradient(135deg, #14f195, #9945ff); }
.d-base { background: #0052ff; } .d-arb { background: #28a0f0; } .d-pol { background: #8247e5; }

/* المزايا */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
.features article { background: rgba(10, 14, 23, .7); border: 1px solid var(--line); border-radius: 18px; padding: 20px; transition: transform .2s, border-color .2s; }
.features article:hover { transform: translateY(-3px); border-color: rgba(90, 169, 255, .35); }
.ico { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--teal); background: rgba(61, 123, 255, .12); border: 1px solid rgba(90, 169, 255, .25); }
.features h3 { font-size: 16px; margin: 12px 0 4px; }
.features p { color: var(--muted); font-size: 13.5px; margin: 0; line-height: 1.8; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 50px; font-size: 13.5px; color: var(--muted); }
.steps div { display: flex; gap: 10px; align-items: center; }
.steps p { margin: 0; }
.steps span { min-width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(120deg, var(--indigo), var(--blue)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

footer { border-top: 1px solid var(--line); background: rgba(6, 10, 19, .6); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 0; color: var(--muted); font-size: 12.5px; }
.foot-links { display: flex; gap: 16px; }
.foot-links a:hover { color: var(--text); }

/* النوافذ */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; animation: fade .2s ease; }
.overlay[hidden] { display: none; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px; width: 100%; max-width: 420px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: rise .25s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; }
.modal-head button { background: none; border: 0; color: var(--muted); font-size: 22px; }
.modal input { margin: 0 16px 10px; background: var(--field); border: 1px solid var(--line-2); border-radius: 12px; color: var(--text); padding: 11px 13px; font: inherit; outline: 0; }
.modal input:focus { border-color: rgba(90, 169, 255, .5); }
.list { overflow-y: auto; padding: 0 8px 12px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-radius: 12px; padding: 10px; text-align: start; transition: background .15s; }
.row:hover { background: rgba(61, 123, 255, .08); }
.row small { display: block; color: var(--muted); font-size: 12px; }

/* الشروط */
.terms { max-width: 720px; padding: 30px 0 60px; }
.terms h1 { font-size: 30px; }
.terms h2 { font-size: 17px; margin: 24px 0 6px; color: var(--teal); }
.terms p, .terms li { color: var(--muted); line-height: 1.9; }
.terms a { color: var(--teal); }

@media (max-width: 760px) {
  .links { display: none; }
  .features, .steps { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; }
}
@media (max-width: 420px) {
  .brand span { display: none; }
  .field-main input, .field-main .out { font-size: 25px; }
  .card { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
