/* صندوق حمایت — تم آزادی نرم‌افزار آزاد */
:root {
  --bg: #0b1220;
  --bg-elev: #121a2b;
  --bg-card: #162033;
  --border: rgba(148, 163, 184, 0.18);
  --text: #e8eef9;
  --muted: #94a3b8;
  --brand: #f1592d;
  --brand-2: #ff8a5c;
  --accent: #3dd6c6;
  --accent-2: #7c9cff;
  --ok: #34d399;
  --fail: #fb7185;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Vazirmatn", "Tahoma", system-ui, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(241, 89, 45, 0.18), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(61, 214, 198, 0.12), transparent 50%),
    radial-gradient(800px 400px at 50% 100%, rgba(124, 156, 255, 0.1), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: clip;
}

/* فقط رسانه — نه همه چیز فشرده به حاشیه */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* همان مدل قبلی: حاشیهٔ متقارن بدون padding اضافه روی container */
.container {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

/* Header + mobile nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 18, 32, 0.88);
  border-bottom: 1px solid var(--border);
}
/* چیدمان هدر: لوگو چپ · منو راست (مستقل از dir صفحه) */
.header-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0;
  position: relative;
  direction: ltr;
}
.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  z-index: 2;
  direction: rtl; /* متن فارسی برند درست بماند */
}
.brand:hover { text-decoration: none; opacity: 0.95; }
.brand-logo {
  width: 42px; height: 42px;
  object-fit: contain;
  display: block;
  /* بدون کادر/کاور مربعی — فقط خود لوگو */
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #ffb089);
  display: grid; place-items: center; font-weight: 900; color: #1a0a04;
  box-shadow: 0 8px 24px rgba(241, 89, 45, 0.35);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: right;
}
.brand-text strong { font-size: 1rem; }
.brand-text span { font-size: 0.72rem; color: var(--muted); }

.header-end {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-inline-start: auto;
  min-width: 0;
}

/* دکمه همبرگری — فقط موبایل */
.nav-toggle {
  display: none;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  order: 2;
}
.nav-toggle:hover {
  border-color: rgba(241, 89, 45, 0.45);
  background: rgba(241, 89, 45, 0.08);
}
.nav-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.25rem;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.2rem 0.15rem;
  font-size: 0.92rem;
  align-items: center;
  justify-content: flex-end;
  direction: rtl; /* ترتیب منطقی فارسی در سمت راست */
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.nav-cta {
  color: #ffffff !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #c94a2a, #f1592d 45%, #ff7a45) !important;
  box-shadow: 0 6px 16px rgba(241, 89, 45, 0.28);
}
.nav-cta:hover {
  filter: brightness(1.05);
  color: #ffffff !important;
}
.nav-logout { color: #fecdd3 !important; }
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(5, 8, 16, 0.55);
  backdrop-filter: blur(2px);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.nav-backdrop[hidden] { display: none !important; }
body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .header-inner {
    flex-wrap: nowrap;
  }
  .header-end {
    position: static;
  }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    z-index: 55;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 0.75rem;
    margin: 0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    max-height: min(78vh, 28rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    direction: rtl;
  }
  .site-header.nav-open .nav,
  .nav.is-open {
    display: flex;
  }
  .nav a {
    white-space: normal;
    padding: 0.85rem 1rem;
    font-size: 0.98rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 12px;
    text-align: right;
  }
  .nav a:hover,
  .nav a:focus-visible {
    background: rgba(241, 89, 45, 0.1);
    border-color: rgba(241, 89, 45, 0.25);
    color: var(--text);
  }
  .nav-cta {
    text-align: center;
    justify-content: center;
    margin-top: 0.35rem;
    padding: 0.9rem 1rem !important;
  }
  .nav-logout {
    margin-top: 0.25rem;
    border-color: rgba(251, 113, 133, 0.25) !important;
  }
  body.nav-open .nav-backdrop {
    display: block;
  }
  body.nav-open .nav-backdrop[hidden] {
    display: block !important;
  }
}

/* Hero */
.hero { padding: 3.5rem 0 2rem; }
.hero-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.35rem 0.75rem; border-radius: 999px;
  background: rgba(241, 89, 45, 0.12);
  color: var(--brand-2); border: 1px solid rgba(241, 89, 45, 0.35);
  font-size: 0.82rem; margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.55rem);
  line-height: 1.35; margin: 0 0 1rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--brand-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); font-size: 1.05rem; max-width: 38rem; }
.hero-points {
  display: grid; gap: 0.75rem; margin: 1.5rem 0 0; padding: 0; list-style: none;
}
.hero-points li {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.85rem 1rem; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
}
.hero-points .dot {
  width: 10px; height: 10px; margin-top: 0.55rem; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(61, 214, 198, 0.15);
}

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}
.card h2 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.card .sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.1rem; }

/* Form */
.amounts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin-bottom: 0.9rem;
}
@media (max-width: 480px) { .amounts { grid-template-columns: repeat(2, 1fr); } }
.amount-btn {
  appearance: none; border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--text); border-radius: 12px; padding: 0.7rem 0.4rem; cursor: pointer;
  font: inherit; font-size: 0.9rem; transition: 0.15s ease;
}
.amount-btn:hover { border-color: rgba(241, 89, 45, 0.5); }
.amount-btn.active {
  border-color: var(--brand); background: rgba(241, 89, 45, 0.15);
  box-shadow: inset 0 0 0 1px rgba(241, 89, 45, 0.35);
}
label { display: block; font-size: 0.88rem; color: var(--muted); margin: 0.75rem 0 0.35rem; }
input, select, textarea {
  width: 100%; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); padding: 0.75rem 0.9rem;
  font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(61, 214, 198, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.12);
}
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }

/* ========== سیستم دکمه (یکپارچه) ==========
   پایه: همه دکمه‌ها اندازهٔ یکسان (auto width).
   تمام‌عرض فقط با .btn-block یا داخل .form-card
*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 12px;
  padding: 0.65rem 1.2rem;
  min-height: 2.75rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  box-sizing: border-box;
  width: auto;
  margin: 0;
  vertical-align: middle;
  white-space: nowrap;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #c94a2a, #f1592d 45%, #ff7a45);
  color: #ffffff !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
  box-shadow: 0 8px 22px rgba(241, 89, 45, 0.32);
  -webkit-font-smoothing: antialiased;
}
.btn-primary,
.btn-primary:visited,
a.btn-primary {
  color: #ffffff !important;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; filter: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn-ghost:hover {
  border-color: rgba(241, 89, 45, 0.45);
  background: rgba(241, 89, 45, 0.06);
}
.btn-danger-ghost {
  background: transparent;
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.45);
  box-shadow: none;
}
.btn-danger-ghost:hover {
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.65);
}
/* تمام‌عرض — فقط وقتی صریحاً خواسته شود یا دکمهٔ submit فرم کارت */
.btn-block {
  display: flex;
  width: 100%;
  margin-top: 1rem;
}
.form-card > .btn-primary,
.form-card > button.btn-primary,
.form-card > a.btn-primary,
#donate-form > .btn-primary,
#donate-form > button.btn-primary {
  display: flex;
  width: 100%;
  margin-top: 1rem;
}
/* فشرده — جدول، نوار ابزار، اکشن‌های ردیفی */
.btn-sm {
  min-height: 2.4rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
}
.btn-primary.btn-sm {
  box-shadow: 0 4px 12px rgba(241, 89, 45, 0.22);
}
/* نوار ابزار / پنل / ادمین / hero / otp */
.btn-toolbar,
.dash-actions,
.admin-actions,
.hero-actions,
.otp-row,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.btn-toolbar { margin-top: 0.85rem; }
.hero-actions {
  gap: 0.75rem;
  margin-top: 1.5rem;
  align-items: stretch;
}
.btn-toolbar form,
.admin-actions form,
.inline-actions form,
.data-table form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.btn-toolbar .btn,
.dash-actions .btn,
.admin-actions .btn,
.hero-actions .btn,
.otp-row .btn,
.inline-actions .btn,
.data-table .btn {
  width: auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.hero-actions .btn {
  min-height: 2.85rem;
  padding: 0.7rem 1.25rem;
}
.otp-row .btn {
  flex-shrink: 0;
}
/* دکمه‌های داخل کارت فهرست: پایین کارت بچسبند ولی اندازهٔ پایه بمانند */
.activist-card .btn,
.product-card .btn {
  width: 100%;
  margin-top: auto;
}
.form-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.75rem; text-align: center; }
.form-msg {
  display: none; margin-top: 0.85rem; padding: 0.75rem 0.9rem; border-radius: 12px; font-size: 0.9rem;
}
.form-msg.show { display: block; }
.form-msg.error { background: rgba(251, 113, 133, 0.12); border: 1px solid rgba(251, 113, 133, 0.35); color: #fecdd3; }
.form-msg.ok { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35); color: #bbf7d0; }
.form-msg.manual { background: rgba(124, 156, 255, 0.12); border: 1px solid rgba(124, 156, 255, 0.35); }

/* Sections */
section { padding: 2.75rem 0; }
.section-title {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem); margin: 0 0 0.5rem;
}
.section-lead { color: var(--muted); max-width: 40rem; margin-bottom: 1.5rem; }

.freedoms {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) { .freedoms { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .freedoms { grid-template-columns: 1fr; } }
.freedom {
  padding: 1.15rem; border-radius: 16px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.03); min-height: 100%;
}
.freedom .num {
  font-weight: 900; color: var(--brand); font-size: 1.4rem; line-height: 1;
  margin-bottom: 0.5rem;
}
.freedom h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.freedom p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.causes {
  display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 800px) { .causes { grid-template-columns: 1fr; } }
.cause {
  padding: 1.2rem; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg-elev);
}
.cause h3 { margin: 0 0 0.45rem; }
.cause p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* باکس «چطور شروع کنم؟» — لیست عمودی با عنوان + توضیح */
.steps {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}
.step {
  position: relative;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}
.step-num {
  flex-shrink: 0;
  width: 1.75rem; height: 1.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, #c94a2a, #f1592d);
  box-shadow: 0 4px 12px rgba(241,89,45,.25);
}
.step strong {
  display: block;
  width: auto;
  height: auto;
  margin: 0 0 0.2rem;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
  place-items: unset;
}

.trust {
  display: grid; gap: 1rem; grid-template-columns: 1.1fr 0.9fr;
}
@media (max-width: 800px) { .trust { grid-template-columns: 1fr; } }
.trust ul { margin: 0; padding: 0 1.1rem 0 0; color: var(--muted); }
.trust li { margin: 0.4rem 0; }

.quote {
  border-right: 3px solid var(--brand);
  padding: 0.2rem 1rem; margin: 0; color: var(--text);
  font-size: 1.05rem;
}
.quote footer { color: var(--muted); font-size: 0.88rem; margin-top: 0.5rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem; padding: 2rem 0 2.5rem;
  color: var(--muted); font-size: 0.9rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
}
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

/* Result page */
.result-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
}
.result-card {
  width: min(460px, 100%); text-align: center; padding: 2rem 1.5rem;
  border-radius: 20px; border: 1px solid var(--border); background: var(--bg-card);
  box-shadow: var(--shadow);
}
.result-card.ok { border-color: rgba(52, 211, 153, 0.35); }
.result-card.fail { border-color: rgba(251, 113, 133, 0.35); }
.result-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.8rem; font-weight: 900;
}
.result-card.ok .result-icon { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.result-card.fail .result-icon { background: rgba(251, 113, 133, 0.15); color: var(--fail); }
.result-actions { display: grid; gap: 0.6rem; margin-top: 1.25rem; }
.ref code {
  display: inline-block; margin-top: 0.25rem; padding: 0.25rem 0.5rem;
  background: var(--bg); border-radius: 8px; direction: ltr;
}

/* Decorative freedom glyph strip */
.glyph-strip {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.25rem;
}
.glyph {
  font-family: ui-monospace, monospace; font-size: 0.78rem;
  padding: 0.3rem 0.55rem; border-radius: 8px;
  background: rgba(124, 156, 255, 0.1); color: #c7d2fe;
  border: 1px solid rgba(124, 156, 255, 0.2); direction: ltr;
}

/* App pages */
.page-section { padding: 2.5rem 0 3rem; }
.page-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 0.5rem; }
.page-lead { color: var(--muted); margin: 0 0 1.25rem; max-width: 40rem; }
.narrow { max-width: 640px; }
.form-card { box-shadow: var(--shadow); }
.form-subhead { margin: 1.25rem 0 0.35rem; font-size: 1.05rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.input-prefix {
  display: flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
  padding-inline-start: 0.75rem; overflow: hidden;
}
.input-prefix span, .input-prefix__host {
  color: var(--muted); font-size: 0.85rem; white-space: nowrap; direction: ltr; flex-shrink: 0;
}
.input-prefix input {
  border: 0; background: transparent; border-radius: 0; flex: 1; min-width: 0;
}
.check-line {
  display: flex; gap: 0.65rem; align-items: flex-start;
  margin: 1rem 0; color: var(--text); font-size: 0.92rem; cursor: pointer;
}
.check-line input { width: auto; margin-top: 0.35rem; }
.policy-box {
  background: rgba(241, 89, 45, 0.08);
  border: 1px solid rgba(241, 89, 45, 0.28);
  border-radius: 16px; padding: 1.15rem 1.25rem; margin-bottom: 1.25rem;
}
.policy-box h2 { margin: 0 0 0.6rem; font-size: 1.1rem; }
.policy-box ul { margin: 0; padding: 0 1.1rem 0 0; color: var(--muted); }
.policy-box li { margin: 0.45rem 0; }
.badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700;
}
.badge-ok { background: rgba(52,211,153,.15); color: #6ee7b7; }
.badge-warn { background: rgba(251,191,36,.12); color: #fcd34d; }
.badge-err { background: rgba(251,113,133,.15); color: #fda4af; }
.dash-head {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1rem;
}
.tg-settings-form {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.tg-settings-form label { display: block; margin-bottom: 0.35rem; font-weight: 600; }
.tg-settings-form input[type="text"],
.tg-settings-form input:not([type]),
.tg-settings-form input[type="email"],
.tg-settings-form #announce_cta {
  width: 100%;
  box-sizing: border-box;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.stats-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .stats-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .stats-grid,
  .stats-grid--3 { grid-template-columns: 1fr; }
}
.stat-label { color: var(--muted); font-size: 0.88rem; }
.stat-value { font-size: 1.45rem; font-weight: 900; margin-top: 0.25rem; }
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.table-wrap .data-table { min-width: 36rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td {
  text-align: right; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--muted); font-weight: 600; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.filter-tabs a {
  padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); text-decoration: none; font-size: 0.9rem;
}
.filter-tabs a.active, .filter-tabs a:hover {
  color: var(--text); border-color: rgba(241,89,45,.45); background: rgba(241,89,45,.1);
}
.admin-user { margin-bottom: 1rem; }
.admin-user-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem;
}
.admin-bank {
  display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.75rem 0;
  padding: 0.75rem; border-radius: 12px; background: var(--bg); font-size: 0.9rem;
}
.admin-actions {
  margin-top: 0.75rem;
}
.activist-card { display: flex; flex-direction: column; }

/* پیوندها و شبکه‌ها — کارت چیپ‌ها */
.links-card .social-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}
.social-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.15rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  text-decoration: none !important;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  overflow: hidden;
}
a.social-chip:hover {
  border-color: rgba(241, 89, 45, 0.45);
  background: rgba(241, 89, 45, 0.08);
  transform: translateY(-1px);
  color: var(--text);
}
.social-chip--static { cursor: default; }
.social-chip__icon {
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent);
}
.social-chip--matrix .social-chip__icon { background: rgba(0,0,0,.25); color: #fff; }
.social-chip--mastodon .social-chip__icon { background: rgba(99,100,255,.18); color: #858AFA; }
.social-chip--telegram .social-chip__icon { background: rgba(36,161,222,.18); color: #5ac8fa; }
.social-chip--x .social-chip__icon { background: rgba(255,255,255,.08); color: #e7e9ea; }
.social-chip--codeberg .social-chip__icon { background: rgba(33,133,208,.18); color: #4da3e8; }
.social-chip--github .social-chip__icon { background: rgba(255,255,255,.1); color: #f0f6fc; }
.social-chip--peertube .social-chip__icon { background: rgba(241,89,45,.16); color: #ff8a5c; }
.social-chip--pixelfed .social-chip__icon { background: rgba(236,72,153,.16); color: #f472b6; }
.social-chip--git .social-chip__icon { background: rgba(240,80,50,.16); color: #f05033; }
.social-chip--web .social-chip__icon { background: rgba(124,156,255,.16); color: #93b4ff; }
.social-chip--contact .social-chip__icon { background: rgba(52,211,153,.14); color: #6ee7b7; }
.social-chip__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: right;
}
.social-chip__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.2;
}
.social-chip__text {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--text);
}
.page-link {
  color: var(--brand-2) !important;
  text-decoration: underline !important;
  font-weight: 700;
  direction: ltr;
  display: inline-block;
}
.page-link:hover { color: var(--accent) !important; }

/* Products & contact for PayPing review */
.product-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.product-card { display: flex; flex-direction: column; gap: 0.5rem; }
.product-sku {
  font-size: 0.75rem; color: var(--muted); direction: ltr; text-align: left;
  font-family: ui-monospace, monospace;
}
.product-title { margin: 0; font-size: 1.1rem; line-height: 1.4; }
.product-short { margin: 0; color: var(--brand-2); font-size: 0.92rem; }
.product-desc { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }
.product-features { margin: 0.35rem 0; padding: 0 1.1rem 0 0; color: var(--muted); font-size: 0.88rem; }
.product-features li { margin: 0.25rem 0; }
.product-meta { margin: 0.5rem 0; }
.product-price { font-size: 1.35rem; font-weight: 900; color: var(--text); }


.footer-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.3fr 1fr 1.15fr 1fr;
  padding-bottom: 1.25rem;
}
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand { font-weight: 800; margin-bottom: 0.35rem; }
.footer-heading { font-weight: 700; margin-bottom: 0.5rem; }
.footer-muted { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0; }
.footer-about .footer-muted {
  line-height: 1.75;
  max-width: 34rem;
}
.footer-about .footer-muted + .footer-muted {
  margin-top: 0.55rem;
}
.footer-about strong {
  color: var(--text);
  font-weight: 600;
}
.footer-links-col { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-links-col a { color: var(--muted); text-decoration: none; }
.footer-links-col a:hover { color: var(--text); }
.footer-contact { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 0.9rem; }
.footer-contact li { margin: 0.4rem 0; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem;
  border-top: 1px solid var(--border); padding-top: 1rem; color: var(--muted); font-size: 0.85rem;
}
.contact-table th { width: 40%; color: var(--muted); font-weight: 600; vertical-align: top; }
.contact-table td { color: var(--text); }


/* فوتر: حامی (شیرازوب) جدا از نماد اعتماد (اینماد) */
.footer-meta-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem 3.5rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding: 1.35rem 0 0.35rem;
  border-top: 1px solid var(--border);
}
.footer-sponsors,
.footer-trust {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 8rem;
}
.footer-meta-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.footer-sponsors a,
.footer-trust a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.footer-sponsors img {
  max-width: 150px;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}
.footer-trust img {
  max-width: 125px;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}
@media (max-width: 520px) {
  .footer-meta-row {
    gap: 1.5rem 1rem;
  }
}

/* LTR fields (password, email, phone) */
.ltr-field, input.password-field, input[type="password"], input[type="email"], input[type="tel"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}
.pass-warn { color: #fcd34d !important; }
.otp-row { display: flex; gap: .5rem; align-items: center; }
.otp-row input { flex: 1; }
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: .65rem;
  margin: .5rem 0 1rem;
}
.avatar-option {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: .5rem; border-radius: 12px; border: 1px solid var(--border);
  cursor: pointer; font-size: .72rem; color: var(--muted); text-align: center;
}
.avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-option:has(input:checked), .avatar-option:hover {
  border-color: var(--brand); background: rgba(241,89,45,.08); color: var(--text);
}
.avatar-option img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  padding: 4px;
}
.post-list .post-item { border-right: 3px solid var(--brand); }

.filter-tabs { display:flex; flex-wrap:wrap; gap:.5rem; }
.filter-tabs a {
  padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); text-decoration: none; font-size: .9rem;
}
.filter-tabs a.active, .filter-tabs a:hover {
  color: var(--text); border-color: var(--brand); background: rgba(241,89,45,.12);
}
.money-input, .jalali-date { letter-spacing: 0.02em; }

/* کپچا — چالش همیشه LTR (جلوگیری از جابه‌جایی در RTL) */
.captcha-box {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(241, 89, 45, 0.35);
  background:
    linear-gradient(135deg, rgba(241,89,45,.12), transparent 55%),
    rgba(15, 23, 42, 0.65);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.captcha-box--ok {
  border-color: rgba(52, 211, 153, 0.45);
  background:
    linear-gradient(135deg, rgba(52,211,153,.12), transparent 55%),
    rgba(15, 23, 42, 0.65);
}
.captcha-box__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  margin-bottom: .75rem;
}
.captcha-box--ok .captcha-box__head { margin-bottom: 0; }
.captcha-box__badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700;
  background: rgba(241,89,45,.2); color: var(--brand-2);
  border: 1px solid rgba(241,89,45,.4);
}
.captcha-box__badge--ok {
  background: rgba(52,211,153,.18);
  color: #6ee7b7;
  border-color: rgba(52,211,153,.45);
}
.captcha-box__hint { color: var(--muted); font-size: .85rem; }
.captcha-box__challenge {
  /* مهم: LTR isolate تا «a + b = ?» در صفحهٔ RTL وارونه نشود */
  direction: ltr !important;
  unicode-bidi: isolate;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.9rem 1rem;
  margin-bottom: 0.85rem;
  border-radius: 12px;
  background: #0b1220;
  border: 1px dashed rgba(148,163,184,.35);
  color: #f8fafc;
  user-select: none;
}
.captcha-box__challenge > span {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  line-height: 1;
}
.captcha-box__op,
.captcha-box__eq {
  color: #f59e0b;
  font-weight: 800;
}
.captcha-box__q {
  color: var(--brand-2, #ff8a5c);
}
.captcha-box__label { display:block; margin-bottom:.35rem; font-size:.92rem; }
.captcha-box__input-wrap {
  display: flex;
  justify-content: flex-start; /* در RTL = سمت راست فرم، کنار لیبل */
}
.captcha-box__input {
  width: 100%;
  max-width: 220px;
  font-size: 1.15rem !important;
  font-weight: 700;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
}


/* —— UX icons —— */
.icon-arrow {
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  margin-inline: 0.2em;
  flex-shrink: 0;
}
.link-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}
.link-with-icon .icon-arrow {
  transition: transform .15s ease;
}
.link-with-icon:hover .icon-arrow {
  transform: translateX(-3px);
}

/* —— OTP / register steps —— */
.reg-step {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
}
.reg-step__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
  font-weight: 800;
}
.reg-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem; height: 1.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(241,89,45,.2);
  color: #fff;
  border: 1px solid rgba(241,89,45,.4);
  flex-shrink: 0;
}
.reg-step .captcha-box { margin: 0.5rem 0 0.75rem; }
.otp-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(124,156,255,.12);
  border: 1px solid rgba(124,156,255,.35);
  color: #c7d2fe;
  direction: ltr;
}
.otp-timer[hidden] { display: none !important; }
.otp-timer.is-expired {
  background: rgba(251,113,133,.12);
  border-color: rgba(251,113,133,.35);
  color: #fecdd3;
}
#otp-status { min-height: 1.4em; }

/* public donation filters */
.don-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}
.don-filters button {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 2.4rem;
}
.don-filters button.active,
.don-filters button[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(241,89,45,.5);
  background: rgba(241,89,45,.18);
}
.post-item.is-featured {
  border-color: rgba(241,89,45,.45);
  background: linear-gradient(135deg, rgba(241,89,45,.08), transparent 55%);
}
.post-item .feat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffb089;
  background: rgba(241,89,45,.15);
  border: 1px solid rgba(241,89,45,.35);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}

/* —— Mobile polish (سبک، بدون فشردن به حاشیه) —— */
@media (max-width: 900px) {
  .hero { padding: 2.5rem 0 1.5rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .page-section .hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .hero { padding: 2rem 0 1.25rem; }
  .hero h1 { font-size: clamp(1.45rem, 7vw, 1.85rem); }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    width: 100% !important;
    justify-content: center;
  }
  .otp-row {
    flex-direction: column;
    align-items: stretch;
  }
  .otp-row .btn { width: 100% !important; }
  .dash-head {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
  }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1 1 auto; }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .table-wrap .data-table { min-width: 36rem; }
  .btn { white-space: normal; text-align: center; }
  input, select, textarea { font-size: 16px !important; }
  .stats-grid,
  .stats-grid--3 { grid-template-columns: 1fr !important; }
  .page-section { padding-block: 1.5rem 2rem; }
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* hero-grid پروفایل روی دسکتاپ */
.page-section .hero-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
}
@media (max-width: 900px) {
  .page-section .hero-grid { grid-template-columns: 1fr; }
}


/* حمایت خارجی (ثبت دستی — خارج از یاور) */
.badge-ext {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #c4b5fd;
  background: rgba(124, 156, 255, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  vertical-align: middle;
  margin-inline-start: 0.35rem;
  white-space: nowrap;
}
.badge-ext::before {
  content: "↗";
  font-weight: 900;
  opacity: 0.9;
}
.ext-import-form label { display: block; margin: 0.65rem 0 0.3rem; font-weight: 600; }
.ext-import-form .grid-2 { margin-bottom: 0.25rem; }
.ext-import-form .btn { margin-top: 1rem; }
.don-ops form { margin-bottom: 0.25rem; }
