/* ==============================================================
   🎨  متغیرهای سراسری (Colors, Radii, Shadows, …)
   ============================================================== */
:root {
    /* رنگ‌های اصلی برند */
    --ri-blue     : #0d47a1;   /* اصلی */
    --ri-blue-2   : #1565c0;   /* هوور/اکتیو */
    --ri-gray     : #f6f7fb;   /* پس‌زمینه‌ی خنثی */

    /* سایه و گردی */
    --radius      : 16px;
    --shadow      : 0 10px 30px rgba(13,71,161,.12);

    /* حاشیه‌های داخلی (padding) پیش‌فرض */
    --p-lg        : 22px;   /* بزرگ (کارت)   */
    --p-md        : 18px;   /* متوسط (پاپ‑اپ) */
    --p-sm        : 14px;   /* کوچک (دکمه، ورودی) */

    /* خطوط گرافیکی */
    --border      : #e8ebf3;
    --border‑light: #dbe3ef;
}

/* ==============================================================
   🎯  فونت‌های سفارشی
   ============================================================== */
@font-face {
    font-family: 'BNazaninWeb';
    src: url('/assets/fonts/B-NAZANIN-BOLD.woff2') format('woff2'),
         url('/assets/fonts/B-NAZANIN-BOLD.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'BrandHead';
    src: url('/assets/fonts/BrandHead.woff2') format('woff2'),
         url('/assets/fonts/BrandHead.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ==============================================================
   🌍  ریست‌ها و تنظیمات پایه
   ============================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: #fff;
    color: #111;
    direction: rtl;               /* راست‌به‌چپ برای فارسی */
    font-family: 'BNazaninWeb', system-ui, -apple-system,
                 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

/* لینک‌ها */
a {
    color: var(--ri-blue);
    text-decoration: none;
    transition: color .15s;
}
a:hover,
a:focus { text-decoration: underline; }

/* ==============================================================
   📦  ساختار کلی (Container, Brandbar, Footer)
   ============================================================== */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
}

/* هدر برند */
.brandbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 2px solid #e9eef7;
}
.brandbar img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}
.brandtitle {
    line-height: 1.1;
}
.brandtitle .t1 {
    font-family: 'BrandHead', 'BNazaninWeb', sans-serif;
    font-size: 26px;
}
.brandtitle .t2 {
    opacity: .8;
    font-size: 16px;
}

/* کارت‌ها */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--p-lg);
    margin-bottom: 24px;
}

/* فوتر */
.footer {
    opacity: .6;
    margin-top: 24px;
    text-align: center;
}

/* ==============================================================
   📐  فرم‌ها (input, button, utilities)
   ============================================================== */
.input {
    width: 100%;
    padding: var(--p-sm) var(--p-sm);
    border: 1px solid var(--border‑light);
    border-radius: 12px;
    outline: none;
    font-size: 16px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.input:focus-visible {
    border-color: var(--ri-blue);
    box-shadow: 0 0 0 3px rgba(13,71,161,.15);
}

/* دکمه‌ها */
.btn {
    background: var(--ri-blue);
    color: #fff;
    border: none;
    padding: var(--p-sm) var(--p-sm);
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    transition: background .2s, transform .1s;
}
.btn:hover { background: var(--ri-blue-2); }
.btn:active {
    transform: translateY(1px);
    background: #0b3a8c;
}

/* مرکز/راست چین (utility) */
.center { text-align: center; }
.right  { text-align: right; }

/* Badge (وضعیت پرداخت) */
.badge {
    display: inline-block;
    background: #eef3ff;
    color: var(--ri-blue);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

/* ==============================================================
   📊  جدول‌ها
   ============================================================== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 12px;
}
.table th,
.table td {
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--border);
}
.table th { background: #f3f6fb; }

/* جدول واکنش‌گرا (mobile) */
@media (max-width: 600px) {
    .table,
    .table thead,
    .table tbody,
    .table th,
    .table td,
    .table tr {
        display: block;
        width: 100%;
    }
    .table tr { margin-bottom: 12px; }
    .table th {
        text-align: right;
        background: none;
        border: none;
        padding-bottom: 4px;
    }
    .table td {
        border-top: none;
        position: relative;
        padding-left: 50%;
    }
    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 14px;
        width: calc(50% - 28px);
        font-weight: 600;
        white-space: nowrap;
    }
}

/* ==============================================================
   📱  ریسپانسیو عمومی
   ============================================================== */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .brandtitle .t1 { font-size: 22px; }
    .brandtitle .t2 { font-size: 14px; }
}

/* ==============================================================
   📦  PWA Prompt (قالب پیش‌فرض)
   ============================================================== */
.pwa-prompt {
    position: fixed;
    inset: auto 16px 16px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--p-md);
    display: none;
    z-index: 9999;
}
.pwa-prompt.show { display: block; }

.pwa-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: flex-end;
}
.pwa-btn {
    background: var(--ri-blue);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s;
}
.pwa-btn:hover { background: var(--ri-blue-2); }
.pwa-ghost {
    background: #eef3ff;
    color: var(--ri-blue);
}

/* ==============================================================
   🎉  نکات تکمیلی (optional)
   ============================================================== */
/* حالت انتخاب متن داخل input */
::selection {
    background: rgba(13,71,161,.2);
}

/* حذف حاشیه‌ها در iOS */
input,
button,
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* جلوگیری از زوم در موبایل زمانی که فیلدهای ورودی فوکوس دارند */
html {
    touch-action: manipulation;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}
