:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --ink: #0f172a;
    --ink-soft: #334155;
    --ink-faint: #64748b;
    --line: #e2e8f0;
    --purple: #635bff;
    --purple-dark: #4f46e5;
    --teal: #00d4b6;
    --blue: #2563eb;
    --green: #10b981;
    --orange: #f59e0b;
    --red: #ef4444;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px;
}

.app-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 24px;
    z-index: 900;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 2px rgba(10, 37, 64, 0.02), 0 4px 12px rgba(10, 37, 64, 0.04);
}

.app-topbar.hide {
    transform: translateY(-100%);
}

.app-topbar-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}

.scroll-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--purple), var(--teal));
    width: 0%;
    transition: width 0.1s ease-out;
}

.app-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 440px;
    height: 72px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 32px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 950;
    padding: 0 8px;
    box-shadow: 0 24px 48px -12px rgba(10, 37, 64, 0.18), inset 0 1.5px 0 rgba(255, 255, 255, 1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 800;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    width: 64px;
    height: 60px;
    position: relative;
}

.nav-item svg {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item.active {
    color: var(--ink);
}

.nav-item.active svg {
    transform: translateY(-4px);
    stroke-width: 2.3;
    color: var(--purple);
    filter: drop-shadow(0 4px 8px rgba(99, 91, 255, 0.35));
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--purple);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item.active::after {
    transform: translateX(-50%) scale(1);
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 12px;
    background: var(--purple);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 40px !important;
        padding-right: 84px;
    }
    .app-nav {
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 24px;
        gap: 12px;
        top: 0; right: 0; bottom: 0; left: auto;
        width: 84px;
        height: 100vh;
        border-radius: 0;
        transform: none;
        max-width: none;
        background: #fff;
        border-left: 1px solid var(--line);
        box-shadow: -4px 0 20px rgba(0,0,0,0.02);
    }
    .nav-item {
        width: 68px;
        height: 68px;
        border-radius: 16px;
        font-size: 0.75rem;
    }
    .nav-item::after { display: none; }
    .nav-item:hover { background: var(--bg); color: var(--purple); }
}

.tg-label {
    margin: 24px 8px 10px;
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--purple);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tg-group {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(10, 37, 64, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.85);
    margin-bottom: 20px;
}

.tg-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: transparent;
    width: 100%;
    text-align: right;
    border-top: none; border-left: none; border-right: none;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.tg-item:last-child { border-bottom: none; }
.tg-item:hover { background: #f8fafc; }

.tg-icon {
    width: 36px; height: 36px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    margin-left: 14px;
    flex-shrink: 0;
}

.tg-icon.purple { background: linear-gradient(135deg, #7a6bff, var(--purple)); }
.tg-icon.teal { background: linear-gradient(135deg, #54e0d1, var(--teal)); }
.tg-icon.green { background: linear-gradient(135deg, #34d399, #059669); }
.tg-icon.blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.tg-icon.orange { background: linear-gradient(135deg, #fbbf24, #d97706); }
.tg-icon.red { background: linear-gradient(135deg, #f87171, #dc2626); }

.tg-content { flex: 1; min-width: 0; }
.tg-title { font-weight: 800; font-size: 0.95rem; display: block; color: var(--ink); }
.tg-subtitle { font-size: 0.78rem; color: var(--ink-faint); margin-top: 2px; display: block; }
.tg-chevron { color: #cbd5e1; margin-right: 8px; flex-shrink: 0; }

.hero-banner {
    position: relative;
    padding: 40px 16px 20px;
    text-align: center;
    margin: 10px 0 32px 0;
    z-index: 1;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 180px;
    background: radial-gradient(ellipse at center, rgba(99, 91, 255, 0.12) 0%, rgba(0, 212, 182, 0.05) 45%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(20px);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--purple);
    border: 1px solid rgba(99, 91, 255, 0.15);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.06);
    margin-bottom: 20px;
}

.hero-pulse {
    width: 8px; height: 8px;
    background: var(--teal);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 212, 182, 0.4);
    animation: heroPulse 2s infinite;
}

@keyframes heroPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 212, 182, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(0, 212, 182, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 212, 182, 0); }
}

.hero-title {
    font-size: 2.6rem;
    font-weight: 900;
    margin: 0 0 8px 0;
    letter-spacing: 1px;
    color: var(--ink);
    text-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.hero-desc {
    font-size: 0.95rem;
    color: var(--ink-faint);
    margin: 0;
    max-width: 90%;
    line-height: 1.8;
    font-weight: 600;
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.product-card {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 14px rgba(10, 37, 64, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-align: right;
    padding: 10px;
    width: 100%;
    font-family: inherit;
    display: block;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(10, 37, 64, 0.08);
}

.product-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 16px;
    background: #f1f5f9;
    display: block;
}

.product-body {
    padding: 14px 10px 8px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--ink);
    margin: 0 0 6px 0;
}

.product-short {
    font-size: 0.84rem;
    color: var(--ink-faint);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.7;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.price-tag {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--ink);
}

.price-tag small {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink-faint);
    margin-right: 3px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #7a6bff, var(--purple));
    color: #fff;
    box-shadow: 0 6px 16px rgba(99, 91, 255, 0.28);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    transform: translateY(-1px);
}

.btn-outline {
    background: #f8fafc;
    color: var(--ink);
    border: 1.5px solid var(--line);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-danger {
    background: #fef2f2;
    color: var(--red);
    border: 1px solid #fecaca;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 12px;
}

.btn-block {
    width: 100%;
}

.modern-input {
    width: 100%;
    padding: 15px 18px;
    border-radius: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 14px;
    color: var(--ink);
    font-weight: 600;
    transition: all 0.2s ease;
}

.modern-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--purple);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.1);
}

.input-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.modern-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modern-sheet {
    position: fixed;
    bottom: -100%;
    left: 0; right: 0;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 32px 32px 0 0;
    padding: 16px 24px 40px;
    z-index: 1001;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
}

.modern-overlay.show { opacity: 1; pointer-events: auto; }
.modern-sheet.show { bottom: 0; }

.sheet-dragger {
    width: 42px; height: 5px;
    background: #cbd5e1;
    border-radius: 99px;
    margin: 0 auto 20px;
}

.sheet-view { display: none; }
.sheet-view.active {
    display: block;
    animation: sheetFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheetFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.bank-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%);
    border-radius: 22px;
    padding: 22px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: 0 12px 28px rgba(49, 46, 129, 0.28);
}

.bank-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.bank-chip {
    width: 36px; height: 26px;
    border-radius: 6px;
    background: linear-gradient(135deg, #fde047, #ca8a04);
}

.bank-number {
    font-family: monospace;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    margin: 20px 0;
    direction: ltr;
}

.bank-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 800;
}

.status-pill.green { background: #d1fae5; color: #065f46; }
.status-pill.orange { background: #fef3c7; color: #92400e; }
.status-pill.red { background: #fee2e2; color: #991b1b; }

.step-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 24px 0;
}

.step-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--ink-faint);
}

.step-circle {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-faint);
}

.step-box.done { color: var(--purple); }
.step-box.done .step-circle {
    background: rgba(99, 91, 255, 0.12);
    border-color: var(--purple);
    color: var(--purple);
}

.step-box.rejected { color: var(--red); }
.step-box.rejected .step-circle {
    background: #fee2e2;
    border-color: var(--red);
    color: var(--red);
}

.upload-box {
    border: 2px dashed #94a3b8;
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    display: block;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.upload-box:hover {
    border-color: var(--purple);
    background: rgba(99, 91, 255, 0.04);
}

.toast {
    position: fixed;
    bottom: 108px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 99px;
    color: #fff;
    font-weight: 800;
    font-size: 0.88rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    pointer-events: none;
}

.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }