/* ============================================================
   SELECTI — Shared Design Tokens
   Source of truth for color, type, and core components.
   Include this file on every page, then page-specific CSS after.
   ============================================================ */

@import url('https://cdn.jsdelivr.net/npm/vazirmatn@33.0.3/Vazirmatn-font-face.css');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    /* Color — derived from logo gradient */
    --ink:        #0B0F2E;
    --ink-soft:   #2A3163;
    --teal:       #2DD4C4;
    --teal-deep:  #0E6E8C;
    --paper:      #F7F8FC;
    --surface:    #FFFFFF;
    --line:       #E3E6F0;
    --line-soft:  #EEF0F7;
    --muted:      #767C99;
    --positive:   #1FAE6E;
    --positive-bg:#EAF8F1;
    --negative:   #E25555;
    --negative-bg:#FCEAEA;
    --warn:       #DD9A22;
    --warn-bg:    #FBF3E2;

    /* Type */
    --font-fa: 'Vazirmatn', Tahoma, sans-serif;
    --font-num: 'IBM Plex Mono', monospace;

    /* Radius / shadow */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(11,15,46,0.06);
    --shadow-md: 0 6px 24px rgba(11,15,46,0.08);
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-fa);
    background: var(--paper);
    color: var(--ink);
    direction: rtl;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Keyboard focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Header ───────────────────────────────────────────────── */
.s-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.s-header .logo-mark {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 19px;
    color: var(--ink);
}
.s-header .logo-mark .dot { color: var(--teal); }
.s-header nav { display: flex; gap: 20px; font-size: 13px; color: var(--muted); }
.s-header nav a:hover { color: var(--ink); }

/* ── Number formatting (Persian digit prices) ───────────────── */
.s-num {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
}

/* ── Price-spread bar — THE signature element ────────────────
   Usage: <div class="s-spread"><div class="s-spread-fill" style="width:X%"></div></div>
   Place a low/avg/high price label set around it via .s-spread-labels
*/
.s-spread {
    height: 6px;
    border-radius: 4px;
    background: var(--line-soft);
    overflow: hidden;
    position: relative;
}
.s-spread-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--teal-deep), var(--teal));
    width: 0%;
    transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}
.s-spread.in-view .s-spread-fill { /* triggered by IntersectionObserver in JS */ }
.s-spread-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    font-family: var(--font-num);
}

/* ── Buttons ──────────────────────────────────────────────── */
.s-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: var(--r-sm);
    font-family: var(--font-fa);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.s-btn-primary { background: var(--ink); color: #fff; }
.s-btn-primary:hover { background: var(--ink-soft); }
.s-btn-teal { background: var(--teal); color: var(--ink); }
.s-btn-teal:hover { filter: brightness(0.95); }
.s-btn:active { transform: scale(0.98); }

/* ── Cards ────────────────────────────────────────────────── */
.s-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}

/* ── Score ring ───────────────────────────────────────────── */
.s-score-ring {
    --pct: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-num);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
    background:
        conic-gradient(var(--teal) calc(var(--pct) * 1%), var(--line-soft) 0);
    position: relative;
}
.s-score-ring::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--surface);
}
.s-score-ring span { position: relative; z-index: 1; }

/* ── Footer ───────────────────────────────────────────────── */
.s-footer {
    margin-top: 60px;
    padding: 28px 24px;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}