/* ZohalFX — سیستم طراحی مشترک (روشن/تیره، راست‌به‌چپ) */
@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* پیش‌فرض: تم زحل — فضای قهوه‌ای تیره، طلایی کهربایی و کرم حلقه‌ها */
  --bg: #0c0704;
  --bg-wash: #1a0f06;
  --surface: #170e07;
  --surface-2: #1c1209;
  --surface-3: #26180b;
  --line: #33210f;
  --line-2: #4a3116;
  --ink: #f7ead0;
  --ink-2: #d4bd96;
  --ink-3: #9b8261;
  --gold: #e8ad48;
  --gold-ink: #1a0f06;
  --gold-soft: #2e1c0a;
  --gold-mid: #5c3a13;
  --gold-deep: #f3c66a;
  --buy: #1fb874;
  --buy-soft: #0f2a1d;
  --sell: #ef5350;
  --sell-soft: #321515;
  --warn: #e0a030;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, .8);
  --font: "Vazirmatn", Tahoma, sans-serif;
  --wrap: 1250px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbf6ec; --bg-wash: #f6ead3; --surface: #fffdf8; --surface-2: #f8f0e1; --surface-3: #f1e5cd;
  --line: #ebdfc6; --line-2: #dcc8a2; --ink: #2a1a0b; --ink-2: #6a5236; --ink-3: #9c8566;
  --gold: #c9862a; --gold-ink: #1a0f06; --gold-soft: #f8e7c4; --gold-mid: #edc98a; --gold-deep: #a35f12;
  --buy: #0f9d58; --buy-soft: #e3f4ea; --sell: #d12f2f; --sell-soft: #fbe7e3; --warn: #b7791f;
  --shadow: 0 1px 0 rgba(42, 26, 11, .05), 0 10px 26px -12px rgba(90, 55, 20, .18); color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--font);
  background: radial-gradient(1100px 620px at 88% -12%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 62%),
    radial-gradient(900px 520px at -10% 110%, color-mix(in srgb, #b4651f 7%, transparent), transparent 60%) fixed, var(--bg);
  font-size: 15px; line-height: 1.8; direction: rtl; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
td.num, th.num { display: table-cell; text-align: right; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: #f3c66a; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--surface-3); }
.btn-ghost { background: var(--surface-3); color: var(--ink); }
.btn-ghost:hover { background: var(--line-2); }
.btn-buy { background: var(--buy); color: #fff; }
.btn-sell { background: var(--sell); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-3); }

/* ---------- top bar + header ---------- */
.topbar { background: var(--surface-3); color: var(--ink-2); font-size: 13.5px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; }
.topbar strong { color: var(--ink); font-weight: 700; }
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: block; height: 40px; flex: none; }
.brand-mark img { height: 100%; width: auto; }
.brand-mark .lg-l { display: none; }
:root[data-theme="light"] .brand-mark .lg-l { display: block; }
:root[data-theme="light"] .brand-mark .lg-d { display: none; }
.on-dark .brand-mark .lg-d { display: block !important; } .on-dark .brand-mark .lg-l { display: none !important; }
.brand-text b { color: var(--gold); }
/* illustration palette */
.ill { --ill-s: #e9dfc2; --ill-w: #26180b; }
:root[data-theme="light"] .ill { --ill-s: #1c1c1a; --ill-w: #ffffff; }
.ill .s { fill: none; stroke: var(--ill-s); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ill .w, .ill .g, .ill .g2 { stroke: var(--ill-s); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ill .w { fill: var(--ill-w); }
.ill .g { fill: #e8ad48; }
.ill .g2 { fill: #f6cf7a; }
.ill .k { fill: var(--ill-s); }
.ill .halo { fill: var(--gold-soft); }
.ill .ground { fill: var(--surface-3); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.brand-text small { font-size: 10.5px; color: var(--ink-3); }
.nav { display: flex; gap: 22px; font-size: 14.5px; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .nav { display: none; position: absolute; inset: 76px 0 auto 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .menu-toggle { display: grid; }
  .topbar .hide-sm { display: none; }
}

/* ---------- forms ---------- */
.field { display: flex; align-items: center; background: var(--surface-3); border-radius: var(--radius-sm); border: 1px solid transparent; min-height: 48px; }
.field:focus-within { border-color: var(--gold-deep); background: var(--surface); }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 14px; height: 46px; outline: none; }
.field input::placeholder { color: var(--ink-3); }
.field .unit { padding: 0 14px; border-inline-start: 1px solid var(--line-2); color: var(--ink-2); font-size: 14px; line-height: 24px; }
.field .step { width: 40px; height: 46px; border: 0; background: transparent; cursor: pointer; font-size: 20px; color: var(--ink-2); }
.field .step:hover { color: var(--ink); }
.input-ltr { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
label.lbl { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 5px; accent-color: var(--gold-deep); width: 16px; height: 16px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; }
.tab { border: 0; background: transparent; padding: 10px 18px 12px; font-size: 16px; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; font-weight: 600; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }

/* ---------- status ---------- */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.dot.live { background: #2fbf71; box-shadow: 0 0 0 4px color-mix(in srgb, #2fbf71 25%, transparent); }
.dot.down { background: var(--sell); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sell) 25%, transparent); }
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); }
.badge-demo { background: var(--gold-soft); color: #7a5a00; }
:root[data-theme="dark"] .badge-demo { color: var(--gold); }
.badge-sim { background: var(--sell-soft); color: var(--sell); }
.up { color: var(--buy); }
.down-c { color: var(--sell); }

/* ---------- toast / modal ---------- */
.toasts { position: fixed; z-index: 100; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100% - 40px)); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); }
.toast.err { background: var(--sell); color: #fff; }
.toast.ok { background: var(--buy); color: #fff; }
.modal-back { position: fixed; inset: 0; background: rgba(20,20,18,.45); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: min(460px, 100%); padding: 22px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow: auto; }
.modal h3 { margin: 0 0 12px; font-size: 18px; }
.modal .rows { display: grid; gap: 6px; margin: 12px 0 18px; font-size: 14px; }
.modal .rows div { display: flex; justify-content: space-between; gap: 12px; }
.modal .actions { display: flex; gap: 10px; }
.modal .actions .btn { flex: 1; }

/* ---------- footer ---------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--surface-2); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 48px 0 32px; }
.site-footer h4 { margin: 0 0 12px; font-size: 15px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.site-footer ul a:hover { color: var(--ink); }
.site-footer p { color: var(--ink-2); font-size: 14px; margin: 12px 0 0; max-width: 46ch; }
.footer-bar { background: var(--gold-mid); color: var(--ink); }
:root[data-theme="dark"] .footer-bar { color: #fff; }
.footer-bar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 14px 0; font-size: 13.5px; }
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .site-footer .cols { grid-template-columns: 1fr; } }

.fab { position: fixed; left: 20px; bottom: 20px; width: 54px; height: 54px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; box-shadow: var(--shadow); z-index: 40; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

[hidden] { display: none !important; }
.brand-text b { white-space: nowrap; }
@media (max-width: 520px) {
  .site-header .wrap { gap: 10px; height: 64px; }
  .site-header .brand-text small { display: none; }
  .site-header .brand-mark { height: 34px; }
  .header-actions { gap: 4px; }
  .header-actions .btn { min-height: 40px; padding: 0 12px; font-size: 13.5px; }
  .header-actions .btn svg { display: none; }
  .nav { inset: 64px 0 auto 0; }
}

/* ---------- لودر زحل ---------- */
.sat-loader { position: relative; width: 64px; height: 64px; margin: 0 auto 12px; display: block; }
.sat-loader::before { content: ""; position: absolute; inset: 18px; border-radius: 50%;
  background: radial-gradient(circle at 65% 30%, #fde3a7, #e3a246 45%, #8c4f17 85%);
  box-shadow: 0 0 18px rgba(232,173,72,.45); }
.sat-loader .ring { position: absolute; left: 2px; right: 2px; top: 24px; height: 16px; border-radius: 50%; border: 2px solid rgba(246,207,122,.85); border-top-color: transparent; transform: rotate(-22deg); }
.sat-loader .ring.back { border: 2px solid rgba(246,207,122,.35); border-bottom-color: transparent; }
.sat-loader .mx { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(-22deg); }
.sat-loader .mx i { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #f6cf7a; box-shadow: 0 0 8px #f6cf7a;
  animation: sat-x 1.6s ease-in-out infinite alternate, sat-y 1.6s ease-in-out -0.8s infinite alternate; }
@keyframes sat-x { from { left: -30px; } to { left: 30px; } }
@keyframes sat-y { from { top: -9px; } to { top: 9px; } }
@media (prefers-reduced-motion: reduce) { .sat-loader .mx i { animation: none; left: 26px; } }
.loading-s { padding: 40px 16px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
/* ---------- share image preview ---------- */
.share-prev { display: grid; place-items: center; min-height: 220px; background: var(--bg-2, #0c0704); border-radius: 14px; overflow: hidden; }
.share-prev img { display: block; width: 100%; max-height: 58vh; object-fit: contain; }
.btn-share { display: inline-flex; align-items: center; gap: 4px; }
.btn-share svg { width: 15px; height: 15px; }
