/* =====================================================================
   تم سایت — همهٔ رنگ‌های برند فقط در این فایل (برای تغییر ساده‌ی برند)
   رنگ اصلی: آبی تلگرامی، سرمه‌ای تیره، رنگ تأکید گرم برای CTA
   ===================================================================== */
:root {
    --brand-primary: #229ED9;
    --brand-primary-dark: #1A86BA;
    --brand-primary-soft: rgba(34, 158, 217, .12);
    --brand-navy: #0F1B2D;
    --brand-navy-2: #16263D;
    --brand-accent: #FF8A3D;
    --brand-accent-dark: #E9732A;
    --surface: #FFFFFF;
    --surface-2: #F4F7FB;
    --text: #1B2533;
    --text-muted: #6B7785;
    --border: #E3E9F0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 6px rgba(15, 27, 45, .06);
    --shadow: 0 8px 24px rgba(15, 27, 45, .08);
    --sidebar-width: 260px;

    /* هماهنگی با متغیرهای Bootstrap */
    --bs-primary: var(--brand-primary);
    --bs-primary-rgb: 34, 158, 217;
    --bs-link-color: var(--brand-primary-dark);
    --bs-link-color-rgb: 26, 134, 186;
    --bs-border-radius: var(--radius-sm);
}

/* حالت تاریک */
[data-bs-theme="dark"] {
    --surface: #132235;
    --surface-2: #0B1624;
    --text: #E6EDF5;
    --text-muted: #93A1B2;
    --border: #22344B;
    --brand-primary-soft: rgba(34, 158, 217, .18);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .3);
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --bs-body-bg: var(--surface-2);
    --bs-body-color: var(--text);
    --bs-link-color: #5BC0EE;
    --bs-link-color-rgb: 91, 192, 238;
}

/* ---------- تایپوگرافی ---------- */
html[lang="fa"] body { font-family: 'Vazirmatn', Tahoma, sans-serif; }
html[lang="en"] body { font-family: 'Inter', 'Segoe UI', Roboto, sans-serif; }
body { background: var(--surface-2); color: var(--text); }
.text-muted-2 { color: var(--text-muted) !important; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* ---------- دکمه‌ها ---------- */
.btn-primary {
    --bs-btn-bg: var(--brand-primary); --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary-dark); --bs-btn-hover-border-color: var(--brand-primary-dark);
    --bs-btn-active-bg: var(--brand-primary-dark); --bs-btn-active-border-color: var(--brand-primary-dark);
}
.btn-accent {
    --bs-btn-color: #fff; --bs-btn-bg: var(--brand-accent); --bs-btn-border-color: var(--brand-accent);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-accent-dark); --bs-btn-hover-border-color: var(--brand-accent-dark);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--brand-accent-dark);
}
.btn { border-radius: var(--radius-sm); }

/* ---------- کارت‌ها ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-stat .stat-icon {
    width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-primary-soft); color: var(--brand-primary); font-size: 1.35rem;
}
.card-stat .stat-value { font-size: 1.4rem; font-weight: 700; }

/* ---------- سایت عمومی ---------- */
.public-navbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.public-navbar .navbar-brand { font-weight: 800; color: var(--brand-navy); }
[data-bs-theme="dark"] .public-navbar .navbar-brand { color: #fff; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; background: var(--brand-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
}
.hero {
    background: radial-gradient(1200px 400px at 80% -10%, rgba(34,158,217,.35), transparent),
                linear-gradient(135deg, var(--brand-navy), var(--brand-navy-2));
    color: #fff; border-radius: 0 0 32px 32px;
}
.hero .lead { color: rgba(255,255,255,.8); }
.feature-icon {
    width: 54px; height: 54px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-primary-soft); color: var(--brand-primary); font-size: 1.5rem;
}
.site-footer { background: var(--brand-navy); color: rgba(255,255,255,.75); }
.site-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* پیش‌نمایش تبلیغ شبیه تلگرام */
.tg-preview {
    background: #fff; color: #000; border-radius: 16px; padding: 14px; max-width: 360px;
    box-shadow: var(--shadow); font-size: .92rem;
}
.tg-preview .tg-sponsored { color: var(--brand-primary); font-weight: 600; font-size: .8rem; }
.tg-preview .tg-button {
    display: block; margin-top: 10px; text-align: center; padding: 8px; border-radius: 10px;
    background: var(--brand-primary-soft); color: var(--brand-primary); font-weight: 600;
}

/* ---------- پنل‌ها (کاربر و ادمین) ---------- */
.panel-wrapper { display: flex; min-height: 100vh; }
.panel-sidebar {
    width: var(--sidebar-width); flex-shrink: 0; background: var(--surface); border-inline-end: 1px solid var(--border);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.panel-sidebar .nav-link {
    color: var(--text); border-radius: var(--radius-sm); padding: .55rem .85rem; display: flex; gap: .6rem; align-items: center;
}
.panel-sidebar .nav-link:hover { background: var(--brand-primary-soft); }
.panel-sidebar .nav-link.active { background: var(--brand-primary); color: #fff; }
.panel-sidebar .nav-section { font-size: .75rem; color: var(--text-muted); padding: .9rem .85rem .3rem; text-transform: uppercase; }
.panel-main { flex: 1; min-width: 0; }
.panel-topbar { background: var(--surface); border-bottom: 1px solid var(--border); }

/* sidebar تیرهٔ ادمین */
.admin-sidebar { background: var(--brand-navy); border-inline-end: none; }
.admin-sidebar .nav-link { color: rgba(255,255,255,.78); }
.admin-sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-sidebar .nav-link.active { background: var(--brand-primary); color: #fff; }
.admin-sidebar .nav-section { color: rgba(255,255,255,.45); }
.admin-sidebar .sidebar-brand { color: #fff; }

@media (max-width: 991.98px) {
    .panel-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1045; transform: translateX(-100%); transition: transform .2s; }
    html[dir="rtl"] .panel-sidebar { transform: translateX(100%); }
    .panel-sidebar.show { transform: translateX(0) !important; }
}

/* ---------- Mini App (هماهنگ با themeParams تلگرام) ---------- */
.miniapp-body {
    background: var(--tg-theme-bg-color, var(--surface-2));
    color: var(--tg-theme-text-color, var(--text));
}
.miniapp-body .card { background: var(--tg-theme-secondary-bg-color, var(--surface)); }
.miniapp-body a { color: var(--tg-theme-link-color, var(--brand-primary)); }

/* ---------- فرم‌ها ---------- */
.form-control, .form-select { border-radius: var(--radius-sm); }
.auth-card { max-width: 440px; margin: 3rem auto; }

/* ---------- فاز ۱۱: صفحهٔ اصلی و محتوای CMS ---------- */
.tg-phone { max-width: 340px; border-radius: 28px; padding: 14px; background: #dfe7ef; box-shadow: 0 20px 50px rgba(15, 27, 45, .35); }
[data-bs-theme="dark"] .tg-phone { background: #1c2733; }
.tg-phone-bar { font-size: .85rem; padding: 4px 8px 10px; color: var(--brand-navy); }
[data-bs-theme="dark"] .tg-phone-bar { color: #e6eef5; }
.tg-msg { background: #fff; color: #0F1B2D; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; font-size: .9rem; }
[data-bs-theme="dark"] .tg-msg { background: #24303d; color: #e6eef5; }
.step-badge { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-primary); color: #fff; font-weight: 800; font-size: 1.15rem; }
.stats-band { background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-2)); color: #fff; }
.cta-card { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark)); color: #fff; border: 0; }
.cms-content { line-height: 2; }
.cms-content img { max-width: 100%; height: auto; border-radius: .5rem; }
.cms-content table { width: 100%; margin-bottom: 1rem; }
.cms-content blockquote { border-inline-start: 4px solid var(--brand-primary); padding-inline-start: 1rem; color: var(--bs-secondary-color); }
