@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@500;700;900&display=swap');

:root {
    --bg: #0a0e14;
    --bg-panel: #111826;
    --grid-line: #1b2333;
    --accent: #c6ff3d;
    --accent-dim: #8fce1f;
    --text: #e8ecf4;
    --text-dim: #7c869c;
    --danger: #ff4d6d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--text);
}

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

.site-header {
    border-bottom: 1px solid var(--grid-line);
    padding: 18px 0;
}

.site-header-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.site-header .brand {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: .5px;
    color: var(--accent);
    text-transform: uppercase;
    text-decoration: none;
}

.quick-search { flex: 1; min-width: 200px; }
.quick-search input {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--grid-line);
    border-radius: 2px;
    padding: 9px 14px;
    color: var(--text);
    font-family: inherit;
}

.site-nav { display: flex; gap: 18px; align-items: center; }
.site-nav a, .link-button {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    font-size: 1rem;
}
.inline-form { display: inline; }

main.container {
    padding: 48px 16px;
    min-height: 60vh;
}

.hero h1 {
    margin-top: 0;
    font-weight: 900;
    font-size: 2rem;
}

.muted { color: var(--text-dim); }

.pay-box, .result-box {
    background: var(--bg-panel);
    border: 1px solid var(--grid-line);
    border-radius: 2px;
    padding: 28px;
    position: relative;
}

.pay-box::before, .result-box::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
}

dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-family: 'Vazirmatn', monospace; }
dt { color: var(--text-dim); text-transform: uppercase; font-size: .8rem; letter-spacing: .5px; }
dd { margin: 0; font-weight: 700; }

.pay-actions { display: flex; gap: 12px; margin-top: 24px; }

.btn {
    border: 2px solid transparent;
    border-radius: 2px;
    padding: 13px 22px;
    font-size: .95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.btn-success { background: var(--accent); color: #08240a; }
.btn-success:hover { background: var(--accent-dim); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }

.result-success h1 { color: var(--accent); }
.result-failed h1 { color: var(--danger); }

.site-footer {
    border-top: 1px solid var(--grid-line);
    padding: 20px 0;
    color: var(--text-dim);
    font-size: .8rem;
}

/* --- Slider / Banner --- */
.hero-slider {
    background: var(--bg-panel);
    border: 1px solid var(--grid-line);
    padding: 48px 32px;
    margin-bottom: 16px;
}
.hero-slider h1 { margin: 0 0 8px; font-size: 2.2rem; }
.promo-banner {
    background: var(--accent);
    color: #08240a;
    padding: 12px 20px;
    font-weight: 700;
    margin-bottom: 32px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* --- Category grid --- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 40px; }
.category-tile {
    background: var(--bg-panel);
    border: 1px solid var(--grid-line);
    color: var(--text);
    text-decoration: none;
    padding: 20px 12px;
    text-align: center;
    font-weight: 700;
}
.category-tile:hover { border-color: var(--accent); }

/* --- Product rails / grid / card --- */
.rail { margin-bottom: 40px; }
.rail-title { font-weight: 900; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .4px; }
.rail-items, .product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }

.product-card {
    display: block;
    background: var(--bg-panel);
    border: 1px solid var(--grid-line);
    color: var(--text);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.product-card:hover { border-color: var(--accent); }
.product-card-cover { aspect-ratio: 1.4; background: var(--grid-line); display: flex; align-items: center; justify-content: center; }
.product-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.product-card-cover-placeholder { font-weight: 700; color: var(--text-dim); padding: 12px; text-align: center; }
.product-card-body { padding: 14px; }
.product-card-name { margin: 0 0 8px; font-size: .95rem; font-weight: 700; }
.product-card-price { margin-bottom: 8px; }
.price-old { text-decoration: line-through; color: var(--text-dim); font-size: .85rem; margin-inline-end: 8px; }
.price-final { color: var(--accent); font-weight: 900; }

.badge-discount {
    position: absolute; top: 10px; inset-inline-start: 10px;
    background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700;
    padding: 3px 8px; border-radius: 2px; z-index: 1;
}
.badge-stock { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 2px; }
.badge-stock.in-stock { background: rgba(198,255,61,.15); color: var(--accent); }
.badge-stock.out-of-stock { background: rgba(255,77,109,.15); color: var(--danger); }

/* --- Popular brands --- */
.popular-brands { margin-bottom: 40px; }
.brand-list { display: flex; flex-wrap: wrap; gap: 12px; }
.brand-chip {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-panel); border: 1px solid var(--grid-line);
    padding: 10px 16px; font-weight: 700;
}
.brand-chip img { width: 24px; height: 24px; object-fit: contain; }

/* --- Category / listing page --- */
.category-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.filters-sidebar {
    background: var(--bg-panel); border: 1px solid var(--grid-line);
    padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.filters-sidebar label { font-size: .85rem; color: var(--text-dim); margin-top: 8px; }
.filters-sidebar select, .filters-sidebar input {
    background: var(--bg); border: 1px solid var(--grid-line); color: var(--text);
    padding: 8px; font-family: inherit;
}
.category-toolbar { margin-bottom: 16px; }

/* --- Product details --- */
.product-details { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.product-details-cover { background: var(--bg-panel); border: 1px solid var(--grid-line); aspect-ratio: 1; }
.product-details-cover img { width: 100%; height: 100%; object-fit: cover; }
.product-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text-dim); }
.brand-logo { width: 28px; height: 28px; object-fit: contain; }
.product-price-box { margin: 16px 0; font-size: 1.3rem; }
.product-spec-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 20px 0; }
.product-spec-list dt { color: var(--text-dim); font-size: .8rem; }
.product-spec-list dd { margin: 0; }
.add-to-cart-form { display: flex; gap: 12px; margin-top: 24px; align-items: center; }
.qty-input { width: 70px; background: var(--bg); border: 1px solid var(--grid-line); color: var(--text); padding: 10px; font-family: inherit; }

/* --- Cart / Checkout --- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th, .cart-table td { border-bottom: 1px solid var(--grid-line); padding: 10px; text-align: start; }
.cart-summary { background: var(--bg-panel); border: 1px solid var(--grid-line); padding: 20px; }
.total-line { font-size: 1.2rem; }
.discount-form { display: flex; gap: 10px; margin-bottom: 20px; }
.discount-form input { flex: 1; background: var(--bg-panel); border: 1px solid var(--grid-line); color: var(--text); padding: 10px; font-family: inherit; }
.payment-method-choice { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.alert-error { background: rgba(255,77,109,.12); border: 1px solid var(--danger); color: var(--danger); padding: 12px; margin-bottom: 16px; }

/* --- Auth forms --- */
.auth-form { max-width: 420px; margin: 0 auto; }
.auth-form label { display: block; margin-top: 14px; font-size: .85rem; color: var(--text-dim); }
.auth-form input, .auth-form .form-control {
    width: 100%; background: var(--bg-panel); border: 1px solid var(--grid-line); color: var(--text);
    padding: 10px; font-family: inherit; margin-top: 4px;
}
.auth-form button { margin-top: 20px; }

@media (max-width: 800px) {
    .category-layout, .product-details { grid-template-columns: 1fr; }
}

/* ===== ویزارد احراز هویت (مشترک همهٔ تم‌ها) ===== */
.auth-form.onboarding { max-width: 640px; }
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.4rem; }
.wizard-steps li { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: #9aa0a6; flex: 1 1 auto; }
.wizard-steps li .num { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid currentColor; font-weight: 700; }
.wizard-steps li.current { color: #1f5fd1; font-weight: 700; }
.wizard-steps li.done { color: #16a34a; }
.wizard-steps li.done .num::after { content: "✓"; }
.wizard-steps li.done .num { font-size: 0; }
.warn-box { background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1rem; line-height: 1.8; font-size: .9rem; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 8px; padding: .6rem .9rem; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
.form-grid .col-span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.camera-box { background: #000; border-radius: 12px; overflow: hidden; margin: 1rem 0; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.camera-box video, .camera-box canvas { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.capture-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.challenge-sentence { background: #f1f5f9; border-right: 4px solid #1f5fd1; border-radius: 8px; padding: 1rem 1.2rem; font-size: 1.15rem; font-weight: 700; line-height: 2; margin: 1rem 0; }
.btn-link { background: none; border: none; color: #1f5fd1; cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }
.resend-form { margin-top: .8rem; }
