/* =====================================================================
   TousanSSL — پایه‌ی ظاهری
   هویت: «تأییدشده/رمزنگاری». پایه‌ی روشن و خنک، سبزِ زمرّدی به‌عنوان
   سیگنالِ وضعیت (نه پُرکردنِ کل صفحه)، مونو برای مقادیر فنی. RTL.
   ===================================================================== */

/* فونتِ فارسیِ Vazirmatn — آفلاین، داخلِ پروژه (بدونِ نیاز به CDN) */
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/Vazirmatn-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/Vazirmatn-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/Vazirmatn-Bold.woff2") format("woff2");
}

:root {
  /* رنگ‌ها */
  --bg:        #eef3f1;   /* پایه‌ی خنکِ سبز-خاکستری (نه کرم) */
  --surface:   #ffffff;
  --surface-2: #f5f9f7;
  --ink:       #0c2a22;   /* متنِ اصلی: سبزِ تیره‌ی عمیق */
  --muted:     #5d7a71;   /* متنِ کم‌رنگ */
  --line:      #d3e2dc;   /* خطوطِ مویی */
  --accent:    #06a66b;   /* سبزِ زمرّدی — سیگنالِ verified */
  --accent-ink:#047a4d;
  --accent-2:  #e6f6ef;   /* پس‌زمینه‌ی ملایمِ accent */
  --warn:      #b8791a;   /* در انتظار */
  --warn-2:    #fbf1de;
  --danger:    #c0392b;
  --danger-2:  #fdecea;   /* پس‌زمینه‌ی ملایمِ danger */
  --nav-bg:    rgba(255,255,255,.86); /* نوارِ ناوبریِ landing */

  /* تایپ */
  --font-body: "Vazirmatn", "IRANSans", Tahoma, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* فاصله/شعاع */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(12,42,34,.05), 0 8px 30px rgba(12,42,34,.07);
  --maxw: 1180px;        /* عرضِ اصلی — جادارتر */
  --maxw-narrow: 480px;  /* صفحاتِ متمرکز: ورود/ثبت‌نام/خطا */
  color-scheme: light;
}

/* ---------- حالتِ تاریک (دارک) ---------- */
/* پالتِ دارک را یک‌جا تعریف می‌کنیم و از دو راه فعالش می‌کنیم:
   ۱) خودکار از رویِ تنظیمِ سیستم (مگر کاربر دستی «روشن» را انتخاب کرده باشد)
   ۲) انتخابِ دستیِ کاربر با data-theme="dark" روی <html> */
:root[data-theme="dark"] {
  --bg:        #0b1512;
  --surface:   #12211c;
  --surface-2: #0f1b17;
  --ink:       #e8f2ee;
  --muted:     #93a89f;
  --line:      #24382f;
  --accent:    #14c084;   /* زمرّدیِ کمی روشن‌تر برای کنتراست روی تیره */
  --accent-ink:#35d99a;
  --accent-2:  #17281f;
  --warn:      #e0a44a;
  --warn-2:    #2a2113;
  --danger:    #e5675b;
  --danger-2:  #2c1614;
  --nav-bg:    rgba(18,33,28,.86);
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 10px 34px rgba(0,0,0,.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b1512;
    --surface:   #12211c;
    --surface-2: #0f1b17;
    --ink:       #e8f2ee;
    --muted:     #93a89f;
    --line:      #24382f;
    --accent:    #14c084;
    --accent-ink:#35d99a;
    --accent-2:  #17281f;
    --warn:      #e0a44a;
    --warn-2:    #2a2113;
    --danger:    #e5675b;
    --danger-2:  #2c1614;
    --nav-bg:    rgba(18,33,28,.86);
    --shadow:    0 1px 2px rgba(0,0,0,.3), 0 10px 34px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* کارت مرکزی */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.card h1 {
  margin: 14px 0 6px;
  font-size: 1.9rem;
  letter-spacing: -.01em;
}

/* مهرِ امضا — حلقه‌ی تأیید با قفل (signature element) */
.lock {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  font-size: 28px;
  border-radius: 50%;
  background: var(--accent-2);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 6px rgba(6,166,107,.08);
}

.muted { color: var(--muted); margin: 6px 0; }
.small { font-size: .86rem; }

.ok {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-2);
  color: var(--accent-ink);
  font-size: .9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

/* مقادیر فنی (دامنه، رکوردِ TXT) — همیشه مونو و LTR */
.mono, code, .value {
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: plaintext;
}

@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise .4s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ===================================================================
   اجزای اپ (قدم ۲): نوار بالا، فرم‌ها، جدول‌ها، آمار، alert
   =================================================================== */

/* --- چیدمان‌های صفحه --- */
body.centered { display: flex; align-items: center; justify-content: center; }
.stack { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
body.app { display: block; min-height: 100dvh; }

/* --- نوار بالا (بازطراحی + رسپانسیو) --- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff;
}
.brand-name { letter-spacing: -.01em; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a, .nav .linkbtn {
  color: var(--muted); font-size: .94rem; padding: 8px 12px; border-radius: 9px;
  transition: background .12s, color .12s; line-height: 1;
}
.nav a:hover { color: var(--accent-ink); background: var(--surface-2); text-decoration: none; }
.nav .nav-admin { color: var(--accent-ink); font-weight: 600; }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: none; cursor: pointer; font: inherit; }
.linkbtn:hover { color: var(--danger); background: var(--surface-2); }

/* دکمه‌ی همبرگری — فقط موبایل */
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--ink);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle:hover { background: var(--surface-2); }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 60px; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 10px 14px 16px; box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a, .nav .linkbtn { padding: 12px 10px; font-size: 1rem; text-align: right; width: 100%; }
  .nav .inline { display: block; width: 100%; }
  .nav .linkbtn { text-align: right; }
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 26px 24px 64px; }
.container.narrow { max-width: var(--maxw-narrow); }
.container.medium { max-width: 880px; }

/* --- سرصفحه‌ی صفحه --- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 2px; font-size: 1.5rem; }

/* --- پنل --- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 22px; margin-bottom: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 1.05rem; }
.empty { padding: 10px 0; }

/* --- جدول --- */
.tbl { width: 100%; border-collapse: collapse; font-size: .94rem; }
.tbl th { text-align: right; color: var(--muted); font-weight: 600; font-size: .82rem;
  border-bottom: 1px solid var(--line); padding: 0 8px 9px; }
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--surface-2); }
.tbl tr:last-child td { border-bottom: none; }

/* --- badge وضعیت --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; border: 1px solid transparent; }
.b-issued { background: var(--accent-2); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.b-failed, .b-expired { background: var(--danger-2); color: var(--danger); }
.b-new, .b-pending_txt, .b-txt_seen, .b-issuing { background: var(--warn-2); color: var(--warn); }

/* --- آمار ادمین --- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px; text-align: center; box-shadow: var(--shadow); }
.stat .n { font-size: 1.8rem; font-weight: 700; color: var(--accent-ink); }
.stat .l { color: var(--muted); font-size: .85rem; margin-top: 2px; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* --- فرم --- */
.form-card { max-width: 420px; }
.form { display: flex; flex-direction: column; gap: 14px; text-align: right; margin-top: 8px; }
.form.wide { max-width: 100%; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--ink); font-weight: 600; }
.form input, .form select {
  font: inherit; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(6,166,107,.12); background: var(--surface);
}
.panel h2 + label, .form h2 { margin-top: 6px; }
.form h2 { font-size: .95rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.form h2:first-of-type { border-top: none; padding-top: 0; }

/* --- دکمه --- */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-align: center;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--accent-ink); }
.btn.ghost:hover { background: var(--accent-2); }
.btn.xs { padding: 5px 12px; font-size: .82rem; }
.cta { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.center { text-align: center; }

/* --- alert --- */
.alert { padding: 11px 16px; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid transparent; }
.alert-ok  { background: var(--accent-2); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.alert-err { background: var(--danger-2); color: var(--danger); border-color: #f5c6c0; }

/* --- مهرِ ادمین --- */
.lock.admin { background: #eef2fb; border-color: #4a6fd0; }

/* ===================================================================
   فلوی صدور (قدم ۳): رکورد TXT، کپی، تب مقصد، فیلد PEM، دانلود
   =================================================================== */

/* رکورد TXT */
.record { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.rrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.rk { color: var(--muted); font-size: .82rem; min-width: 86px; }
.rv { flex: 1; direction: ltr; word-break: break-all; font-size: .9rem; }

/* دکمه‌ی کپی */
.copy { font: inherit; font-size: .8rem; cursor: pointer; border: 1px solid var(--line);
  background: var(--surface); color: var(--accent-ink); border-radius: 7px; padding: 5px 11px; text-decoration: none; }
.copy:hover { background: var(--accent-2); border-color: var(--accent); text-decoration: none; }

/* اکشن‌های ردیفی */
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* تب‌های مقصد */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); font-size: .9rem; }
.tab:hover { text-decoration: none; border-color: var(--accent); color: var(--accent-ink); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* فیلد PEM */
.field { margin-bottom: 14px; }
.field-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: .88rem; font-weight: 600; }
.field-actions { display: flex; gap: 8px; }
.pem { width: 100%; font-family: var(--font-mono); font-size: .8rem; direction: ltr;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  padding: 10px 12px; resize: vertical; color: var(--ink); }

/* شبکه‌ی دانلود */
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .dl-grid { grid-template-columns: 1fr; } }
.sep { border: none; border-top: 1px solid var(--line); margin: 18px 0 14px; }

/* انتخابِ روش (manual/cname) */
.modes { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 4px 0; }
.modes legend { padding: 0 6px; color: var(--muted); font-size: .85rem; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-weight: 400; font-size: .9rem; }
.radio input { margin-top: 4px; }
/* چک‌باکس‌های سفارشی و زیبا (سراسری) */
.check, .form label.check {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 11px; font-weight: 400; cursor: pointer; user-select: none; line-height: 1.5;
  text-align: right; width: 100%;
}
.check input[type="checkbox"], input[type="checkbox"].styled {
  appearance: none; -webkit-appearance: none; margin: 0; padding: 0; flex: 0 0 auto;
  width: 22px; height: 22px; min-width: 22px; min-height: 22px; max-width: 22px; box-sizing: border-box;
  border: 1.5px solid var(--line); border-radius: 7px;
  background: var(--surface); cursor: pointer; position: relative; vertical-align: middle;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.check input[type="checkbox"]:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.check input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
.check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 6px; top: 2.5px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.check input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(6,166,107,.22); }
.check input[type="checkbox"]:active { transform: scale(.94); }

/* ===================================================================
   کارت‌های انتخابِ روش (بازطراحی) — هویتِ «تأییدشده/رمزنگاری»
   =================================================================== */
.issue-form .methods { border: none; padding: 0; margin: 6px 0 4px; display: grid; gap: 12px; }
.issue-form .methods legend { padding: 0; margin-bottom: 4px; color: var(--ink); font-weight: 700; font-size: .95rem; }

.method { display: block; cursor: pointer; }
/* رادیوِ بومی را پنهان ولی قابلِ‌دسترس نگه می‌داریم */
.method > input { position: absolute; opacity: 0; pointer-events: none; }

.method-card {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 16px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); transition: border-color .15s, box-shadow .15s, background .15s, transform .05s;
}
.method-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* آیکونِ روش */
.method-glyph {
  flex: 0 0 auto;
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); transition: all .15s;
}
.method-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.method-title { font-weight: 700; font-size: .98rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.method-desc { color: var(--ink); font-size: .88rem; opacity: .85; }
.method-hint { color: var(--muted); font-size: .8rem; }

/* برچسبِ نوعِ رکورد — مونو، هم‌خوان با هویتِ فنی */
.tag {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--muted);
}

/* مهرِ تأیید (نشانه‌ی انتخاب) */
.method-check {
  flex: 0 0 auto; align-self: center;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); color: transparent; background: var(--surface);
  transition: all .15s;
}

/* حالتِ انتخاب‌شده */
.method > input:checked + .method-card {
  border-color: var(--accent); background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(6,166,107,.10);
}
.method > input:checked + .method-card .method-glyph {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.method > input:checked + .method-card .method-check {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.method > input:checked + .method-card .tag {
  background: var(--surface); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-ink);
}

/* دسترسی‌پذیری: حلقه‌ی فوکوس روی کارت */
.method > input:focus-visible + .method-card {
  outline: 2px solid var(--accent-ink); outline-offset: 2px;
}
.method > input:active + .method-card { transform: translateY(1px); }

@media (max-width: 480px) {
  .method-card { flex-wrap: wrap; }
  .method-check { order: -1; margin-right: auto; }
}

/* بنرِ مهلتِ سفارش */
.deadline {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--warn-2); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px; font-size: .9rem;
}
.deadline .countdown { font-size: 1.05rem; font-weight: 700; }
.deadline.expired { background: var(--danger-2); color: var(--danger); border-color: #f5c6c0; }

/* کیف پول */
.wallet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wallet-balance { font-size: 1.9rem; font-weight: 700; color: var(--accent-ink); }
.wallet-balance .unit { font-size: .9rem; font-weight: 400; color: var(--muted); }
.amt-pos { color: var(--accent-ink); }
.amt-neg { color: var(--danger); }

/* اقداماتِ ادمین */
.btn.danger-btn { background: var(--danger); border-color: var(--danger); }
.btn.danger-btn:hover { filter: brightness(1.07); }
.cols { display: flex; gap: 16px; flex-wrap: wrap; }
.cols > * { flex: 1 1 300px; min-width: 0; }

.panel table.tbl th { white-space: nowrap; }

/* مبلغ‌ها: عددِ لاتین در متنِ RTL باید ایزوله بماند تا جابه‌جا نشود */
.money { direction: ltr; unicode-bidi: isolate; display: inline-block; white-space: nowrap; }
.wallet-balance { direction: rtl; }
.wallet-balance .money { font-family: var(--font-mono); }

/* جدول‌ها در موبایل: اسکرولِ افقی به‌جای سرریز */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .tbl { min-width: 460px; font-size: .85rem; }
  .page-head { flex-wrap: wrap; gap: 10px; }

}

/* درخواست‌های شارژ */
.receipt-thumb {
  width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
  cursor: zoom-in; transition: transform .1s; display: block;
}
.receipt-thumb:hover { transform: scale(1.05); border-color: var(--accent); }
.count-badge {
  display: inline-block; background: var(--danger); color: #fff; font-size: .8rem; font-weight: 700;
  min-width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 11px; padding: 0 6px;
  vertical-align: middle; margin-right: 6px;
}
.review-row > td { background: var(--surface-2); }
.review-box { display: flex; gap: 18px; flex-wrap: wrap; padding: 6px 2px; }
.inline-review { flex: 1 1 280px; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.inline-review label { flex: 1 1 120px; }
.inline-review .form { margin: 0; }

/* مودالِ تصویر */
.img-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.img-modal[hidden] { display: none; }
.img-modal-bg { position: absolute; inset: 0; background: rgba(12,42,34,.72); }
.img-modal-in { position: relative; max-width: 92vw; max-height: 88vh; }
.img-modal-in img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,.4); }
.img-modal-x {
  position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: none; cursor: pointer; font-size: 16px; box-shadow: var(--shadow);
}

/* زنگوله‌ی اعلان در هدر */
.nav-bell { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.bell-badge {
  position: absolute; top: -4px; left: -6px; background: var(--danger); color: #fff;
  font-size: .68rem; font-weight: 700; min-width: 17px; height: 17px; line-height: 17px;
  text-align: center; border-radius: 9px; padding: 0 4px;
}
@media (max-width: 720px) {
  .nav-bell { justify-content: flex-start; }
  .bell-badge { position: static; margin-right: 6px; }
}

/* صفحه‌ی اعلان‌ها */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-link { display: flex; align-items: flex-start; gap: 12px; padding: 14px 6px; color: var(--ink); }
.notif-link:hover { text-decoration: none; background: var(--surface-2); border-radius: 8px; }
.notif-item.unread .notif-link { background: var(--accent-2); border-radius: 8px; }
.notif-icon { font-size: 1.25rem; line-height: 1.4; flex: 0 0 auto; }
.notif-body { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.notif-title { font-weight: 600; font-size: .95rem; }
.notif-text { color: var(--muted); font-size: .86rem; }
.notif-time { color: var(--muted); font-size: .76rem; }
.notif-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; }

/* تب‌های تنظیمات */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.stab {
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; font: inherit; font-size: .92rem;
  transition: all .12s;
}
.stab:hover { border-color: var(--accent); color: var(--accent-ink); }
.stab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.settings-form .tab-panel { display: none; }
.settings-form .tab-panel.active { display: block; }
.settings-form .tab-panel h2:first-child { margin-top: 0; }

/* گفتگوی تیکت */
.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; position: relative; }
.bubble-who { font-size: .74rem; font-weight: 600; margin-bottom: 4px; opacity: .75; }
.bubble-body { font-size: .95rem; line-height: 1.7; word-break: break-word; }
.bubble-time { font-size: .7rem; opacity: .6; margin-top: 5px; }
.bubble-me { align-self: flex-start; background: var(--accent-2); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-bottom-right-radius: 4px; }
.bubble-admin { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.reply-form { border-top: 1px solid var(--line); padding-top: 14px; }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 4px; vertical-align: middle; }

/* بنرِ هشدارِ تأییدِ ایمیل */
.alert-warn { background: var(--warn-2); border:1px solid color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }
.verify-banner { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.verify-banner .linkbtn { color: var(--warn); text-decoration:underline; }

/* کارت‌های آمارِ خبرنامه */
.stat-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:8px; }
.stat-card { flex:1; min-width:120px; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:16px; text-align:center; }
.stat-num { font-size:1.8rem; font-weight:700; color:var(--accent-ink); }
.stat-lbl { font-size:.85rem; color:var(--muted); margin-top:4px; }

/* ============================ صفحه‌ی فرود (Landing) ============================ */
body.landing {
  background: var(--surface); color: var(--ink);
  display: block;            /* خنثی‌کردنِ flex-center پایه که باعثِ روی‌هم‌افتادنِ بخش‌ها می‌شد */
  align-items: initial; justify-content: initial;
  padding: 0; min-height: 100dvh;
}
.lp-container { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ناوبری */
.lp-nav { position: sticky; top: 0; z-index: 20; background: var(--nav-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.lp-nav-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.lp-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.lp-brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #fff; }
.lp-nav-links { display: flex; align-items: center; gap: 22px; }
.lp-nav-links a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; transition: color .15s; }
.lp-nav-links a:hover { color: var(--accent-ink); }
.lp-btn { display: inline-block; background: var(--accent); color: #fff !important; padding: 9px 18px; border-radius: 10px; font-weight: 700; text-decoration: none; transition: transform .12s, background .15s; }
.lp-btn:hover { background: var(--accent-ink); transform: translateY(-1px); }
.lp-btn-lg { padding: 13px 28px; font-size: 1.02rem; border-radius: 12px; }
.lp-btn-ghost { background: transparent; color: var(--accent-ink) !important; border: 1.5px solid var(--line); }
.lp-btn-ghost:hover { background: var(--accent-2); border-color: var(--accent); }

/* Hero */
.lp-hero { position: relative; overflow: hidden; background:
    radial-gradient(1200px 400px at 85% -10%, var(--accent-2), transparent 60%),
    linear-gradient(180deg, #f3faf7, var(--surface)); }
.lp-hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 74px 22px 84px; }
.lp-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--accent-ink); font-size: .85rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; }
.lp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-2); }
.lp-hero-text h1 { font-size: 2.7rem; line-height: 1.35; margin: 18px 0 0; font-weight: 800; letter-spacing: -.5px; }
.lp-hl { color: var(--accent); }
.lp-lead { font-size: 1.12rem; color: var(--muted); line-height: 2.1; margin: 18px 0 26px; max-width: 34em; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-trust { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; padding: 0; margin: 26px 0 0; color: var(--accent-ink); font-weight: 600; font-size: .92rem; }

/* تصویرِ hero: سپر + نوارِ آدرس */
.lp-hero-visual { display: grid; place-items: center; gap: 22px; }
.lp-shield { width: 210px; height: 210px; border-radius: 50%; display: grid; place-items: center; color: var(--accent);
  background: radial-gradient(circle at 50% 40%, var(--surface), var(--accent-2));
  box-shadow: 0 20px 60px rgba(6,166,107,.18), inset 0 0 0 1px var(--line); animation: lp-float 4s ease-in-out infinite; }
@keyframes lp-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.lp-url-bar { display: inline-flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; box-shadow: var(--shadow); }
.lp-url-txt { color: var(--ink); font-family: var(--font-mono); font-size: .9rem; }
.lp-url-verified { background: var(--accent-2); color: var(--accent-ink); font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }

/* بخش‌ها */
.lp-section { padding: 74px 0; }
.lp-section-alt { background: var(--surface-2); }
.lp-h2 { text-align: center; font-size: 2rem; font-weight: 800; margin: 0 0 6px; }
.lp-sub { text-align: center; color: var(--muted); margin: 0 0 44px; font-size: 1.05rem; }

/* گرید امکانات */
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-feat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; text-align: center; transition: transform .15s, box-shadow .15s, border-color .15s; }
.lp-feat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.lp-feat-ic { width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.6rem; background: var(--accent-2); border-radius: 13px; margin: 0 auto 14px; }
.lp-feat h3 { margin: 0 0 8px; font-size: 1.16rem; }
.lp-feat p { margin: 0; color: var(--muted); line-height: 2; font-size: .96rem; }

/* مراحل */
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.lp-step { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; text-align: center; }
.lp-step-n { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 1.2rem; }
.lp-step h3 { margin: 0 0 8px; font-size: 1.12rem; }
.lp-step p { margin: 0; color: var(--muted); line-height: 2; font-size: .95rem; }

/* FAQ */
.lp-faq-wrap { max-width: 760px; }
.lp-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; margin-bottom: 12px; }
.lp-faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; position: relative; padding-left: 28px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::before { content: "+"; position: absolute; left: 0; top: 12px; width: 20px; height: 20px; display: grid; place-items: center; color: var(--accent); font-weight: 800; font-size: 1.2rem; }
.lp-faq details[open] summary::before { content: "−"; }
.lp-faq p { margin: 0 0 16px; color: var(--muted); line-height: 2.1; }

/* CTA پایانی */
.lp-final { padding: 72px 0; background: linear-gradient(135deg, var(--accent-ink), var(--accent)); color: #fff; text-align: center; }
.lp-final h2 { font-size: 2rem; margin: 0 0 10px; font-weight: 800; }
.lp-final p { margin: 0 0 26px; opacity: .92; font-size: 1.08rem; }
.lp-final .lp-btn { background: #fff; color: var(--accent-ink) !important; }
.lp-final .lp-btn:hover { background: #f0f0f0; }

/* فوتر */
.lp-footer { background: #08211b; color: #cfe6dd; padding: 26px 0; }
.lp-footer-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.lp-footer .lp-brand { color: #fff; font-size: 1rem; }
.lp-footer .lp-brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.lp-copy { color: #8fb3a8; font-size: .85rem; }

/* موبایل */
@media (max-width: 860px) {
  body.landing { overflow-x: hidden; }
  .lp-hero-in { grid-template-columns: 1fr; text-align: center; padding: 48px 22px 60px; }
  .lp-hero-text h1 { font-size: 1.9rem; }
  .lp-lead { margin-inline: auto; }
  .lp-cta { flex-direction: column; }
  .lp-cta .lp-btn-lg { width: 100%; text-align: center; }
  .lp-trust { justify-content: center; }
  .lp-hero-visual { order: -1; }
  .lp-shield { width: 150px; height: 150px; }
  .lp-url-bar { max-width: 100%; padding: 8px 12px; }
  .lp-url-txt { font-size: .8rem; }
  .lp-grid, .lp-steps { grid-template-columns: 1fr; }
  .lp-nav-links { gap: 12px; }
  .lp-nav-links a:not(.lp-btn) { display: none; }
  .lp-h2 { font-size: 1.6rem; }
}

/* ---------- دکمه‌ی سوییچِ تم ---------- */
.theme-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; transition: border-color .15s, transform .12s;
}
.theme-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-btn-float { position: fixed; top: 16px; left: 16px; z-index: 50; box-shadow: var(--shadow); }
.lp-nav .theme-btn { width: 36px; height: 36px; }

/* کدهای بازیابیِ 2FA */
.recovery-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:10px; }
.recovery-grid .rv { text-align:center; padding:8px; font-size:1.05rem; letter-spacing:1px; }
.ok-text { color: var(--accent-ink); font-weight:600; }
