/* 🌟 تزریق اجباری فونت قالب به کل سیستم، دکمه‌ها و فرم‌ها (بدون خرابی آیکون‌ها) */
.vt-spa-wrapper, .vt-spa-wrapper *, .vt-modal-overlay, .vt-modal-overlay *, .vt-lightbox-overlay, .vt-lightbox-overlay * { font-family: inherit !important; }
.vt-spa-wrapper button, .vt-spa-wrapper input, .vt-spa-wrapper select, .vt-spa-wrapper textarea, .vt-modal-overlay button, .vt-modal-overlay input { font-family: inherit !important; }
.vt-spa-wrapper .dashicons, .vt-modal-overlay .dashicons { font-family: dashicons !important; }

.vt-spa-wrapper { background-color: transparent !important; padding: 10px 0 !important; }

/* ساختار شبکه ۳ باکسی هدر بالایی - استایل جدید فین‌تک */
.vt-app-header-grid { display: grid; grid-template-columns: 260px 1fr 340px; gap: 20px; margin-bottom: 20px; }
.vt-app-grid { display: grid; grid-template-columns: 260px 1fr 340px; gap: 20px; align-items: stretch; }

/* مهندسی کارت‌های تفکیک شده با ظاهر نرم و سایه‌های فین‌تک */
.vt-card { background: #ffffff; border-radius: 16px; box-shadow: 0 12px 32px -8px rgba(30, 58, 138, 0.08); border: 1px solid #e2e8f0; overflow: visible !important; }
.vt-sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid #f1f5f9; }

/* دکمه تاریخچه - استایل جدید */
.vt-history-btn { background: #f8fafc; border: 1px solid #e2e8f0; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; color: #64748b; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s ease; }
.vt-history-btn:hover, .vt-history-btn.active { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }

.vt-search-box { padding: 15px 20px; position: relative; border-bottom: 1px solid #f1f5f9; }
.vt-search-box input { width: 100%; padding: 12px 12px 12px 38px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px; transition: 0.2s; color: #0f172a; }
.vt-search-box input:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.vt-search-icon { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 18px; }

/* 🔴 ضدگلوله کردن تب‌های متای پایینی و تب‌های داشبورد در برابر استایل‌های مخرب قالب آسترا */
.vt-meta-tab-btn, .vt-dash-tab { background-color: transparent !important; box-shadow: none !important; border: none !important; border-radius: 0 !important; padding: 12px 20px !important; font-size: 15px !important; font-weight: 700 !important; color: #64748b !important; cursor: pointer !important; transition: 0.2s !important; border-bottom: 3px solid transparent !important; white-space: nowrap !important; flex-shrink: 0 !important; width: auto !important; margin: 0 !important; outline: none !important; }
.vt-meta-tab-btn:hover, .vt-dash-tab:hover { color: #0f172a !important; background-color: transparent !important; }
.vt-meta-tab-btn.active, .vt-dash-tab.active { color: #0f172a !important; border-bottom: 3px solid #2563eb !important; background-color: transparent !important; }
.vt-step-indicator { white-space: nowrap !important; flex-shrink: 0 !important; }

/* ستاره‌های امتیازدهی ستاره‌ای */
.vt-stars-row span { font-size: 18px; color: #e2e8f0; cursor: pointer; transition: 0.2s; }
.vt-stars-row span.filled { color: #f59e0b; }

.vt-accordion-header { display: flex; justify-content: space-between; padding: 16px 20px; cursor: pointer; font-weight: 700; font-size: 14px; border-bottom: 1px solid #f8fafc; color: #334155; transition: 0.2s; }
.vt-accordion-header:hover { background: #f8fafc; }
.vt-accordion-header.active { color: #2563eb; }
.vt-accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background: #ffffff; }

/* کپسول اسکرول سایدبار */
.vt-doc-list { list-style: none; margin: 0; padding: 0; max-height: 350px; overflow-y: auto; }
.vt-doc-list::-webkit-scrollbar { width: 6px; }
.vt-doc-list::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; margin: 5px 0; }
.vt-doc-list::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 4px; }
.vt-doc-list::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }

.vt-doc-item { padding: 14px 20px 14px 45px; border-bottom: 1px solid #f8fafc; cursor: pointer; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px; color: #475569; transition: 0.2s; }
.vt-doc-item:hover, .vt-doc-item.active { background: #eff6ff; color: #2563eb; border-right: 3px solid #2563eb; }
.vt-flag { width: 24px; height: 18px; object-fit: cover; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-radius: 3px; }

#vt-form-workspace { padding: 35px; min-height: 380px; display: flex; flex-direction: column; }
.vt-empty-state { text-align: center; color: #94a3b8; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; font-weight: 600; }

.vt-preview-canvas { background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 12px; min-height: 350px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; transition: 0.2s; }
.vt-preview-canvas:hover { border-color: #94a3b8; }
.vt-preview-canvas img { max-width: 100%; height: auto; border-radius: 8px; }

/* سیستم پاپ‌آپ‌ها مودال */
.vt-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 99999; }
.vt-modal-card { background: #ffffff; padding: 40px; border-radius: 20px; width: 100%; max-width: 420px; box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25); border: 1px solid #e2e8f0; }
.vt-modal-tabs { display: flex; border-bottom: 2px solid #f1f5f9; margin-bottom: 30px; }
.vt-modal-tab-btn { flex: 1; background: none; border: none; padding: 14px; font-size: 16px; font-weight: 700; color: #94a3b8; cursor: pointer; transition: 0.2s; border-bottom: 3px solid transparent; }
.vt-modal-tab-btn:hover { color: #475569; }
.vt-modal-tab-btn.active { color: #0f172a; border-bottom-color: #2563eb; margin-bottom: -2px; }
.vt-modal-card input { width: 100%; padding: 14px 16px; margin-bottom: 18px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 15px; color: #0f172a; transition: 0.2s; }
.vt-modal-card input:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.vt-modal-submit-btn { width: 100%; background: #2563eb; color: #ffffff; padding: 15px; border: none; border-radius: 10px; font-weight: 700; font-size: 16px; cursor: pointer; margin-bottom: 15px; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); transition: all 0.2s ease; }
.vt-modal-submit-btn:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 6px 15px rgba(37, 99, 235, 0.35); }
.vt-modal-cancel-btn { width: 100%; background: none; border: none; color: #64748b; font-size: 14px; font-weight: 600; cursor: pointer; padding: 10px; border-radius: 8px; transition: 0.2s; }
.vt-modal-cancel-btn:hover { background: #f1f5f9; color: #0f172a; }

/* سیستم Tooltip راهنمای فیلدها */
.vt-tooltip { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; background-color: #3b82f6; color: #fff; border-radius: 50%; font-size: 13px; font-weight: bold; margin-left: 8px; cursor: help; position: relative; font-family: Arial, sans-serif; box-shadow: 0 2px 5px rgba(59, 130, 246, 0.3); }
.vt-tooltip::after { content: attr(data-tooltip); position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%) translateY(10px); background-color: #0f172a; color: #f8fafc; padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; white-space: pre-wrap; min-width: 250px; max-width: 400px; text-align: center; line-height: 1.5; opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 1000; pointer-events: none; }
.vt-tooltip::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(10px); border-width: 7px; border-style: solid; border-color: #0f172a transparent transparent transparent; opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 1000; pointer-events: none; }
.vt-tooltip:hover::after, .vt-tooltip:hover::before { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* تراز کردن و کششِ محتوای داخلی ستون‌ها */
.vt-main-area, .vt-result-area { display: flex; flex-direction: column; height: 100%; }
#vt-form-workspace { flex-grow: 1; display: flex; flex-direction: column; }

/* گالری تصاویر محصول */
.vt-gallery-container { display: flex; gap: 12px; margin-top: 15px; padding: 5px 2px 10px 2px; overflow-x: auto; scroll-behavior: smooth; width: 100%; scrollbar-width: thin; scrollbar-color: #94a3b8 transparent; }
.vt-gallery-container::-webkit-scrollbar { height: 6px; }
.vt-gallery-container::-webkit-scrollbar-track { background: transparent; }
.vt-gallery-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.vt-gallery-container::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.vt-gallery-thumb { width: 70px; height: 70px; min-width: 70px; object-fit: cover; background: #ffffff; border-radius: 10px; cursor: pointer; border: 2px solid transparent; opacity: 0.5; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 2px 5px rgba(0,0,0,0.05); flex-shrink: 0 !important; }
.vt-gallery-thumb:hover { opacity: 1; transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,0.08); }
.vt-gallery-thumb.active { opacity: 1; border-color: #2563eb; box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25); transform: translateY(-2px); }

/* Elementor Accordion SPA Fixes */
.vt-meta-tab-content-node .elementor-accordion-item { margin-bottom: 15px !important; border: 1px solid #e2e8f0 !important; border-radius: 12px !important; overflow: hidden !important; box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important; }
.vt-meta-tab-content-node .elementor-tab-title .elementor-accordion-icon-opened { display: none !important; }
.vt-meta-tab-content-node .elementor-tab-title.elementor-active .elementor-accordion-icon-closed { display: none !important; }
.vt-meta-tab-content-node .elementor-tab-title.elementor-active .elementor-accordion-icon-opened { display: inline-block !important; }
.vt-meta-tab-content-node .elementor-accordion { width: 100% !important; max-width: 100% !important; }
.vt-meta-tab-content-node .elementor-tab-title { background-color: #f8fafc !important; padding: 20px 25px !important; border: none !important; color: #0f172a !important; font-weight: 700 !important; font-size: 15px !important; display: flex !important; align-items: center !important; justify-content: space-between !important; transition: 0.2s !important; }
.vt-meta-tab-content-node .elementor-tab-title:hover { background-color: #f1f5f9 !important; }
.vt-meta-tab-content-node .elementor-tab-title .elementor-accordion-icon { order: 2 !important; margin-left: 15px !important; margin-right: 0 !important; color: #3b82f6 !important; }
.vt-meta-tab-content-node .elementor-tab-title .elementor-accordion-title { order: 1 !important; margin: 0 !important; }
.vt-meta-tab-content-node .elementor-tab-content { background-color: #ffffff !important; padding: 25px 30px 35px 30px !important; border: none !important; border-top: 1px solid #e2e8f0 !important; color: #475569 !important; line-height: 1.8 !important; font-size: 15px !important; }

/* Astra & Theme Compatibility Fixes */
body.single-verif_template .site-content > div, body.tax-vt_category .site-content > div, body.single-verif_template .ast-container, body.tax-vt_category .ast-container { width: 100% !important; max-width: 100% !important; display: block !important; }
.vt-isolated-canvas, .vt-spa-wrapper { width: 100% !important; max-width: 1200px !important; margin-left: auto !important; margin-right: auto !important; }

/* 🔴 دسکتاپ: قفل کردنِ ستون وسط برای جلوگیری از مچاله شدن */
@media (min-width: 1025px) {
    .vt-app-header-grid, .vt-app-grid {
        width: 100% !important; display: grid !important;
        grid-template-columns: 260px minmax(0, 1fr) 340px !important;
        gap: 20px !important; align-items: stretch !important;
    }
}

/* ==========================================
   📱 موبایل ریسپانسیو (Mobile UI/UX Overhaul)
   ========================================== */
@media (max-width: 1024px) { 
    .vt-app-header-grid { grid-template-columns: 1fr !important; gap: 15px; } 
    /* 🔴 جابجایی هوشمند ستون‌ها در تبلت و موبایل */
    .vt-app-grid { 
        display: flex !important; 
        flex-direction: column !important; 
        gap: 20px; 
    }
    .vt-main-area { order: 1 !important; }   /* اول فرم */
    .vt-result-area { order: 2 !important; } /* دوم عکس پیش‌نمایش */
    .vt-sidebar { order: 3 !important; }     /* سوم لیست مدارک (سایدبار) */
    
    .vt-box-logo { text-align: center; justify-content: center !important; }
}

@media (max-width: 768px) {
    /* ۱. رژیم پدینگ‌ها (آزادسازی فضای صفحه) */
    #vt-form-workspace, 
    .vt-result-area, 
    .vt-bottom-meta-panel, 
    .vt-modal-card { padding: 15px !important; }
    
    /* ۲. اصلاح ظرافت هدرها (جلوگیری از بلوک‌های غول‌پیکر) */
    .vt-box-wallet { 
        padding: 15px !important; 
        flex-direction: row !important; 
        justify-content: space-between !important;
        align-items: center !important; 
    }
    .vt-balance-text { font-size: 13px !important; }
    .vt-balance-text strong { font-size: 15px !important; }
    .vt-topup-btn { padding: 8px 14px !important; font-size: 13px !important; }

    .vt-box-title-node { padding: 15px !important; }
    #vt-header-doc-title { font-size: 18px !important; text-align: center; }

    .vt-sidebar-header { flex-direction: row !important; align-items: center !important; padding: 15px; }
    .vt-history-btn { width: auto !important; padding: 6px 12px; font-size: 12px; }

    /* ۳. اسکرول افقی مخفی برای تب‌ها (جلوگیری از مچاله شدن در قالب آسترا) */
    .vt-steps-header,
    .vt-tabs-nav-row,
    .vt-dash-tabs {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        margin-bottom: 15px;
        scrollbar-width: none; 
        width: 100% !important;
    }
    .vt-steps-header::-webkit-scrollbar,
    .vt-tabs-nav-row::-webkit-scrollbar,
    .vt-dash-tabs::-webkit-scrollbar { display: none; }
    
    /* ۴. دکمه‌های ویزارد فرم در موبایل (روی هم قرار بگیرند) */
    .vt-form-nav-controls { flex-direction: column-reverse; gap: 12px !important; }
    .vt-form-nav-controls button { width: 100% !important; margin: 0 !important; }
    
    /* ۵. اصلاح کادر پیش‌نمایش تصویر (حذف پدینگ برای بزرگ‌نمایی حداکثری عکس) */
    .vt-preview-canvas { min-height: 200px; padding: 4px !important; } 
    .vt-preview-canvas img { width: 100% !important; border-radius: 8px !important; object-fit: contain; }

    /* ۶. گالری امضاها در موبایل (۲ ستونه به جای ۳ ستونه) */
    div[id^="vt-sig-samples-box"] > div { grid-template-columns: repeat(2, 1fr) !important; }
}