/* ============================================================
   محاسبو — استایل پایه
   پالت از UI تأییدشدهٔ مالک:
     ملک  : آبی    #1e5cff
     خودرو: کهربایی #f59e0b
     طلا  : نارنجی #f97316
   ============================================================ */

:root {
    --blue: #1e5cff;
    --blue-dark: #1746cc;
    --amber: #f59e0b;
    --orange: #f97316;
    --ink: #0f172a;
    --ink-2: #475569;
    --muted: #94a3b8;
    --line: #e6eaf2;
    --bg: #f6f8fc;
    --card: #ffffff;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 4px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Vazir", Tahoma, system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.8;
    font-size: 15px;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------------- Header ---------------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; gap: 16px;
}
.brand {
    display: inline-flex; align-items: center; gap: 9px;
    text-decoration: none; color: var(--blue); font-weight: 800; font-size: 20px;
}
.brand-logo { height: 36px; width: auto; display: block; border-radius: 8px; }
.brand-fallback { display: none; letter-spacing: -.3px; }
/* اگر تصویر لوگو موجود نبود، متن نمایش داده می‌شود */
.brand:has(.brand-logo[style*="display: none"]) .brand-fallback { display: inline; }

.brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), #4d84ff);
    color: #fff; display: grid; place-items: center;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { letter-spacing: -.3px; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
    text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600;
    padding: 8px 13px; border-radius: 10px; transition: .15s;
}
.site-nav a:hover { background: #f1f5fd; color: var(--blue); }
.site-nav a.on { background: #eaf0ff; color: var(--blue); }

/* ---------------- Notice ---------------- */
.notice {
    margin-top: 16px; padding: 13px 16px;
    background: #fff8e6; border: 1px solid #ffe4a3;
    border-radius: var(--radius-sm); color: #7a5200; font-size: 13.5px;
}
.notice code {
    background: #fff3cf; padding: 1px 6px; border-radius: 5px;
    font-family: Consolas, monospace; direction: ltr; display: inline-block;
}

/* ---------------- Hero ---------------- */
.hero { padding: 44px 0 28px; text-align: center; }
.hero h1 {
    margin: 0 0 12px; font-size: 30px; font-weight: 800;
    letter-spacing: -.5px; line-height: 1.5;
    overflow-wrap: break-word; word-break: break-word;
}
.hero p {
    margin: 0 auto; max-width: 620px; color: var(--ink-2); font-size: 15px;
    display: block; line-height: 2;
}

/* ---------------- Cards (home) ---------------- */
.cards {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 16px; padding: 12px 0 48px;
}
.card {
    display: block; text-decoration: none; color: inherit;
    background: var(--card); border-radius: var(--radius);
    padding: 24px 22px; box-shadow: var(--shadow);
    border: 1px solid var(--line);
    transition: transform .18s, box-shadow .18s;
    position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card::after {
    content: ""; position: absolute; inset: auto -30px -50px auto;
    width: 130px; height: 130px; border-radius: 50%;
    opacity: .07; background: currentColor;
}
.card-icon {
    width: 52px; height: 52px; border-radius: 15px;
    display: grid; place-items: center; margin-bottom: 14px;
    background: #eef3ff; color: var(--blue);
}
.card-icon svg { width: 27px; height: 27px; }
.card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.card p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.card .arrow { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--blue); text-align: left; }

.card.car { color: var(--amber); }
.card.car .card-icon { background: #fff7e6; color: var(--amber); }
.card.car .arrow { color: var(--amber); }

.card.gold { color: var(--orange); }
.card.gold .card-icon { background: #fff2e8; color: var(--orange); }
.card.gold .arrow { color: var(--orange); }

/* ---------------- Calculator ---------------- */
.calc-page { padding: 28px 0 56px; }
.calc-head { text-align: center; margin-bottom: 22px; }
.calc-head h1 { margin: 0 0 8px; font-size: 25px; font-weight: 800; }
.calc-head p { margin: 0; color: var(--ink-2); font-size: 14px; }

.panel {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--line);
    padding: 24px; margin-bottom: 16px;
}
.panel-title {
    margin: 0 0 16px; font-size: 15px; font-weight: 800;
    display: flex; align-items: center; gap: 8px;
}
.panel-title::before {
    content: ""; width: 4px; height: 17px; border-radius: 3px; background: var(--blue);
}
.car-theme .panel-title::before { background: var(--amber); }
.gold-theme .panel-title::before { background: var(--orange); }

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field label {
    display: block; font-size: 13.5px; font-weight: 700;
    margin-bottom: 7px; color: var(--ink);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.input-row { display: flex; gap: 8px; }
.input-row input, .field input, .field select {
    width: 100%; padding: 13px 14px; font-size: 15px; font-family: inherit;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: #fbfcfe; color: var(--ink); transition: .15s; text-align: right;
}
.field input:focus, .field select:focus {
    outline: none; border-color: var(--blue); background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 92, 255, .08);
}
.car-theme .field input:focus, .car-theme .field select:focus {
    border-color: var(--amber); box-shadow: 0 0 0 4px rgba(245, 158, 11, .10);
}
.gold-theme .field input:focus, .gold-theme .field select:focus {
    border-color: var(--orange); box-shadow: 0 0 0 4px rgba(249, 115, 22, .10);
}

/* tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
    flex: 1 1 120px; text-align: center; padding: 11px 12px; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: #fbfcfe; font-size: 13.5px; font-weight: 700; color: var(--ink-2);
    transition: .15s; font-family: inherit;
}
.tab:hover { border-color: #c9d6f5; }
.tab.on { background: #eaf0ff; border-color: var(--blue); color: var(--blue); }
.car-theme .tab.on { background: #fff7e6; border-color: var(--amber); color: #b47405; }
.gold-theme .tab.on { background: #fff2e8; border-color: var(--orange); color: #c2560a; }

/* checkbox */
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.car-theme .check input { accent-color: var(--amber); }
.gold-theme .check input { accent-color: var(--orange); }

/* button */
.btn {
    display: block; width: 100%; padding: 15px; margin-top: 18px;
    font-size: 15.5px; font-weight: 800; font-family: inherit;
    color: #fff; background: linear-gradient(135deg, var(--blue), #3d74ff);
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    transition: .18s; box-shadow: 0 6px 18px rgba(30, 92, 255, .25);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(30, 92, 255, .32); }
.btn:active { transform: translateY(0); }
.car-theme .btn {
    background: linear-gradient(135deg, var(--amber), #fbbf24);
    box-shadow: 0 6px 18px rgba(245, 158, 11, .28);
}
.gold-theme .btn {
    background: linear-gradient(135deg, var(--orange), #fb923c);
    box-shadow: 0 6px 18px rgba(249, 115, 22, .28);
}

/* result */
.result { display: none; }
.result.show { display: block; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.result-table { width: 100%; border-collapse: collapse; }
.result-table td { padding: 11px 4px; font-size: 14px; border-bottom: 1px dashed var(--line); }
.result-table tr:last-child td { border-bottom: none; }
.result-table td:last-child {
    text-align: left; font-weight: 700; white-space: nowrap;
    font-variant-numeric: tabular-nums; direction: ltr;
}
.result-table .lbl { color: var(--ink-2); }
.result-table .sub { font-size: 11.5px; color: var(--muted); display: block; }
.result-table tr.total td {
    background: #f2f6ff; font-weight: 800; font-size: 15.5px; color: var(--blue);
    padding: 14px 12px; border-radius: 10px; border-bottom: none;
}
.car-theme .result-table tr.total td { background: #fffaef; color: #a86f05; }
.gold-theme .result-table tr.total td { background: #fff5ee; color: #b45309; }
.result-table tr.total td:first-child { border-radius: 0 10px 10px 0; }
.result-table tr.total td:last-child { border-radius: 10px 0 0 10px; }

.result-note {
    margin-top: 14px; font-size: 12px; color: var(--muted);
    padding-top: 12px; border-top: 1px solid var(--line);
}
.warn {
    margin-top: 12px; padding: 11px 14px; border-radius: 10px;
    background: #fff8e6; border: 1px solid #ffe4a3; color: #7a5200; font-size: 12.5px;
}
.err {
    margin-top: 12px; padding: 11px 14px; border-radius: 10px;
    background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 13px;
}

/* rate chip */
.rate-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #eaf0ff; color: var(--blue);
    padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
    margin-bottom: 14px;
}
.car-theme .rate-chip { background: #fff7e6; color: #a86f05; }
.gold-theme .rate-chip { background: #fff2e8; color: #b45309; }

/* ---------------- Footer ---------------- */
.site-footer {
    border-top: 1px solid var(--line); background: #fff;
    padding: 26px 0 34px; margin-top: 20px;
}
.site-footer p { margin: 0 0 6px; font-size: 13.5px; }
.site-footer .muted { color: var(--muted); font-size: 12px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 760px) {
    .cards { grid-template-columns: 1fr; }
    .hero { padding: 30px 0 20px; }
    .hero h1 { font-size: 20px; line-height: 1.6; }
    .brand-logo { height: 32px; }
    .site-nav { display: none; }
    .panel { padding: 18px; }
    .calc-head h1 { font-size: 20px; }
    body { font-size: 14.5px; }
}

/* ============================================================
   بنر اسلایدر
   ============================================================ */
.slider {
    position: relative; overflow: hidden;
    border-radius: var(--radius);
    margin: 0 auto 8px;
    box-shadow: var(--shadow);
    background: #eef3ff;
    aspect-ratio: 1200 / 440;
    max-height: 300px;
}
.slider-track {
    display: flex;
    transition: transform .5s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}
.slider-slide { min-width: 100%; display: block; line-height: 0; height: 100%; }
.slider-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 760px) {
    .slider { aspect-ratio: 16 / 10; max-height: 230px; }
}

.slider-dots {
    display: flex; justify-content: center; gap: 7px;
    padding: 12px 0 0;
}
.slider-dots button {
    width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0;
    background: #cbd5e1; cursor: pointer; transition: .2s;
}
.slider-dots button.on { background: var(--blue); width: 22px; border-radius: 4px; }

.slider-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.86); color: var(--ink);
    cursor: pointer; display: grid; place-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.14); font-size: 17px; line-height: 1;
    transition: .15s;
}
.slider-nav:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.slider-nav.prev { right: 12px; }
.slider-nav.next { left: 12px; }
@media (max-width: 760px) { .slider-nav { display: none; } }

/* ============================================================
   هیرو ویدیویی هر ابزار
   ============================================================ */
.hero-video {
    position: relative; overflow: hidden;
    border-radius: var(--radius);
    margin: 0 0 18px;
    background: linear-gradient(135deg, #eef3ff, #f8fbff);
    box-shadow: var(--shadow);
    min-height: 180px;
    display: grid; place-items: center;
}
.hero-video video {
    width: 100%; height: auto; display: block;
    object-fit: cover;
}
/* نسخهٔ موبایل: ویدیو با ارتفاع محدود */
@media (max-width: 760px) {
    .hero-video video { max-height: 210px; object-fit: cover; }
}

/* اگر کاربر prefers-reduced-motion دارد یا ویدیو پخش نشد */
.hero-video .video-fallback {
    position: absolute; inset: 0; display: none;
    align-items: center; justify-content: center;
    color: var(--ink-2); font-size: 13px;
}

/* ============================================================
   کارت‌های صفحهٔ اصلی — با آیکون تصویری مالک
   ============================================================ */
.card-icon-img {
    width: 76px; height: 76px;
    border-radius: 20px;
    display: grid; place-items: center;
    margin-bottom: 16px;
    background: #eef3ff;
    box-shadow: inset 0 0 0 1px rgba(30,92,255,.06);
}
.card-icon-img img { width: 52px; height: 52px; object-fit: contain; display: block; }
.card.car .card-icon-img { background: #fff8ea; box-shadow: inset 0 0 0 1px rgba(245,158,11,.10); }
.card.gold .card-icon-img { background: #fff4ec; box-shadow: inset 0 0 0 1px rgba(249,115,22,.10); }

/* چیدمان افقی کارت‌ها مطابق ماکاپ موبایل مالک */
.card-row { display: flex; align-items: center; gap: 16px; }
.card-row .card-body { flex: 1 1 auto; min-width: 0; }
.card-chev { font-size: 20px; color: var(--muted); flex: 0 0 auto; line-height: 1; }
.card.car .card-chev { color: #f0b429; }
.card.gold .card-chev { color: var(--orange); }
.card:hover .card-chev { color: currentColor; }

/* ============================================================
   نمایش حروفی مبلغ زیر فیلد
   ============================================================ */
.words {
    margin-top: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--blue);
    min-height: 18px;
    line-height: 1.6;
    transition: opacity .15s;
}
.words:empty { display: none; }
.car-theme .words { color: #b47405; }
.gold-theme .words { color: #c2560a; }
