/* قالب‌های سایت (jinja2/). رنگ و اندازه فقط از توکن‌ها؛ فقط ویژگی‌های منطقی برای چپ‌چین و راست‌چین.
   تم: <html data-theme="light|dark">، و بدون آن پیروی از سیستم (اسکیل rebate81-conventions بخش «تم»). */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.f6d31671339d.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root,
[data-theme="light"] {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eaeef3;
  --ink: #0d1726;
  --ink-2: #485469;
  --line: #d9dfe7;
  --gain: #0e9f6e;
  --gain-ink: #04754f;
  --gain-soft: #ddf3ea;
  --on-gain: #ffffff;
  --rest: #cbd3de;
  --focus: #1f56d6;
  --shadow: 0 1px 2px rgb(13 23 38 / 0.05), 0 18px 40px -24px rgb(13 23 38 / 0.28);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0e13;
  --surface: #141920;
  --surface-2: #1d242e;
  --ink: #e9eef5;
  --ink-2: #9eaabb;
  --line: #29313d;
  --gain: #2bc78f;
  --gain-ink: #4ddba6;
  --gain-soft: #12271f;
  --on-gain: #062419;
  --rest: #333c4a;
  --focus: #8db4ff;
  --shadow: none;
  color-scheme: dark;
}

/* همان مقدارهای [data-theme="dark"] بالا؛ اگر یکی عوض شد، این هم عوض شود (برای وقتی که اسکریپت تم اجرا نشده). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e13;
    --surface: #141920;
    --surface-2: #1d242e;
    --ink: #e9eef5;
    --ink-2: #9eaabb;
    --line: #29313d;
    --gain: #2bc78f;
    --gain-ink: #4ddba6;
    --gain-soft: #12271f;
    --on-gain: #062419;
    --rest: #333c4a;
    --focus: #8db4ff;
    --shadow: none;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  inline-size: 100%;
  max-inline-size: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* ---------------------------------------------------------------- هدر */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: 4rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-block-size: 44px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  flex: none;
}

.brand-mark-bg {
  fill: var(--ink);
}

.brand-mark-rest {
  fill: var(--bg);
  opacity: 0.35;
}

.brand-mark-gain {
  fill: var(--gain);
}

[dir="rtl"] .brand-mark {
  transform: scaleX(-1);
}

.tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-menu {
  position: relative;
}

.lang-menu summary,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-block-size: 44px;
  min-inline-size: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.lang-menu summary {
  padding-inline: 0.75rem;
  list-style: none;
}

/* موبایل: فقط آیکون کره؛ نام زبان از 640px به بالا */
.lang-menu summary span {
  display: none;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu svg,
.theme-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.theme-toggle .fill {
  fill: currentColor;
  stroke: none;
}

.lang-list {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 0.5rem);
  z-index: 10;
  min-inline-size: 12rem;
  max-block-size: 70vh;
  overflow: auto;
  margin: 0;
  padding: 0.375rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  box-shadow: var(--shadow);
}

.lang-list a {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
}

.lang-list a:hover,
.lang-list a[aria-current] {
  background: var(--surface-2);
}

.lang-list a[aria-current] {
  font-weight: 700;
}

/* ---------------------------------------------------------------- صفحه‌ی «به‌زودی» */

.cs {
  flex: 1;
  display: grid;
  align-content: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(2rem, 7vw, 5.5rem);
}

.cs-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0.3rem 0.875rem;
  border-radius: 999px;
  background: var(--gain-soft);
  color: var(--gain-ink);
  font-size: 0.9375rem;
  font-weight: 700;
}

.dot {
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.125rem, 1.35rem + 3.4vw, 3.875rem);
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
}

[dir="ltr"] h1 {
  letter-spacing: -0.028em;
  line-height: 1.04;
}

.lead {
  margin: 0;
  max-inline-size: 36rem;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
}

.cs-card {
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.cs-card h2 {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

/* نوار تقسیم کمیسیون: نماد اصلی صفحه (همان نماد لوگو) */
.split {
  display: flex;
  gap: 4px;
  block-size: 3rem;
}

.split-you,
.split-us {
  border-radius: 0.875rem;
}

.split-you {
  flex: 0 0 calc(81% - 2px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-inline: 1rem;
  background: var(--gain);
  color: var(--on-gain);
  font-size: 1.375rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  animation: split-grow 1.1s cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.split-us {
  flex: 1;
  background: var(--rest);
}

@keyframes split-grow {
  from {
    flex-basis: 3.5rem;
    color: transparent;
  }
}

.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0.875rem 0 2rem;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.split-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.split-legend li::before {
  content: "";
  inline-size: 0.75rem;
  block-size: 0.75rem;
  border-radius: 0.25rem;
}

.legend-you::before {
  background: var(--gain);
}

.legend-us::before {
  background: var(--rest);
}

.ledger {
  margin: 0;
}

.ledger div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  border-block-end: 1px dashed var(--line);
}

.ledger dt {
  color: var(--ink-2);
}

.ledger dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ledger .ledger-total {
  border-block-end: 0;
}

.ledger-total dt,
.ledger-total dd {
  color: var(--gain-ink);
  font-weight: 800;
}

.ledger-total dd {
  font-size: 1.375rem;
}

.note {
  margin: 1rem 0 0;
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ---------------------------------------------------------------- 404 */

.nf {
  flex: 1;
  padding-block: clamp(3rem, 10vw, 7rem);
}

.nf .lead {
  margin-block-end: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-block-size: 48px;
  padding-inline: 1.375rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

/* ---------------------------------------------------------------- فوتر */

.foot {
  padding-block: 1.5rem 2rem;
  border-block-start: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.6;
}

.foot p {
  margin: 0.25rem 0;
}

.foot .contact {
  margin-block-end: 0.75rem;
  color: var(--ink);
}

.foot .contact a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;           /* هدف لمسی ۴۴ پیکسل در موبایل */
  color: var(--gain-ink);
  font-weight: 600;
  text-underline-offset: 3px;
}

.foot .copy {
  margin-block-start: 0.75rem;
}

/* ---------------------------------------------------------------- اندازه‌ها (mobile-first) */

@media (min-width: 640px) {
  .lang-menu summary {
    padding-inline: 0.875rem;
  }

  .lang-menu summary span {
    display: inline;
  }

  .split {
    block-size: 3.5rem;
  }

  .split-you {
    font-size: 1.625rem;
  }
}

@media (min-width: 1024px) {
  .cs {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .split-you {
    animation: none;
  }
}
