@import url("tokens.css");

/* =========================================================
   قوانین و مقررات
   =========================================================
   متنِ حقوقیِ بلند با تمِ تیره‌ی سایت: همان سرمه‌ای، فیروزه‌ای و صورتیِ
   لندینگ. چیدمان دو ستونه است — فهرستِ چسبان کنار و متن در ستونی که
   عرضش برای خواندن تنظیم شده — و روی گوشی فهرست به چیپ‌های افقی
   تبدیل می‌شود.
========================================================= */

:root {
    --terms-ground: #05070f;
    --terms-surface: rgba(255, 255, 255, .035);
    --terms-ink: #eef2fb;
    --terms-ink-2: #c7d0e4;
    --terms-muted: #8d99b4;
    --terms-rule: rgba(255, 255, 255, .10);
    --terms-cyan: #22d3ee;
    --terms-pink: #ec4899;
}

body {
    margin: 0;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(34, 211, 238, .10), transparent 60%),
        radial-gradient(120% 80% at 0% 10%, rgba(236, 72, 153, .10), transparent 60%),
        linear-gradient(180deg, #080b18, var(--terms-ground));
    background-attachment: fixed;
    color: var(--terms-ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 2;
    padding-inline: 20px;
    padding-block: 0 80px;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

.terms-wrap {
    max-width: 1140px;
    margin-inline: auto;
}

a {
    color: var(--terms-cyan);
}

:focus-visible {
    outline: 2px solid var(--terms-cyan);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- سربرگ ---------- */

.terms-head {
    padding-block: 48px 28px;
    border-bottom: 1px solid var(--terms-rule);
}

.terms-head h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    line-height: 1.4;
    margin: 4px 0 14px;
    text-wrap: balance;
    background: linear-gradient(90deg, #fff, #67e8f9 55%, #f9a8d4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.terms-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13.5px;
    color: var(--terms-muted);
}

.terms-meta span {
    background: var(--terms-surface);
    border: 1px solid var(--terms-rule);
    border-radius: 999px;
    padding: 2px 14px;
}

.terms-lede {
    max-width: 64ch;
    color: var(--terms-ink-2);
    margin: 18px 0 0;
    font-size: 15.5px;
}

/* ---------- چیدمان ---------- */

.terms-layout {
    display: grid;
    grid-template-columns: 215px minmax(0, 1fr);
    gap: 54px;
    padding-block: 30px 0;
}

.terms-toc {
    position: sticky;
    top: 20px;
    align-self: start;
    font-size: 13.5px;
    line-height: 1.7;
}

.terms-toc h2 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--terms-muted);
    margin: 0 0 10px;
}

.terms-toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 2px;
}

.terms-toc a {
    display: block;
    padding: 5px 11px;
    border-radius: 9px;
    color: var(--terms-ink-2);
    text-decoration: none;
    transition: .18s ease;
}

.terms-toc a:hover {
    background: rgba(34, 211, 238, .10);
    color: var(--terms-cyan);
}

.terms-toc a.is-key {
    color: var(--terms-pink);
    font-weight: 700;
}

/* ---------- مواد ---------- */

.terms-body {
    max-width: 70ch;
}

.terms-body > section {
    padding-block: 28px;
    border-bottom: 1px solid var(--terms-rule);
    scroll-margin-top: 18px;
}

.terms-body > section h2 {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.55;
    margin: 0 0 8px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    text-wrap: balance;
}

.terms-body > section h2 .n {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--terms-cyan);
    white-space: nowrap;
}

.summary {
    font-size: 14.5px;
    line-height: 1.95;
    color: var(--terms-muted);
    margin: 0 0 16px;
}

.summary b {
    color: var(--terms-cyan);
    font-weight: 700;
}

/* بندها با شماره‌ی «ماده-بند»، مثل متن‌های حقوقی فارسی */
ol.clauses {
    counter-reset: cl;
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

ol.clauses > li {
    counter-increment: cl;
    display: grid;
    grid-template-columns: 3.2em minmax(0, 1fr);
    color: var(--terms-ink-2);
}

ol.clauses > li::before {
    content: counter(sec, persian) "-" counter(cl, persian);
    font-size: 13.5px;
    color: var(--terms-muted);
    padding-top: 3px;
}

.terms-body {
    counter-reset: sec;
}

.terms-body > section {
    counter-increment: sec;
}

dl.defs {
    margin: 0;
    display: grid;
    grid-template-columns: 10em minmax(0, 1fr);
    gap: 10px 18px;
}

dl.defs dt {
    font-weight: 700;
}

dl.defs dd {
    margin: 0;
    color: var(--terms-ink-2);
}

/* ماده‌ی آموزش مدل — تنها بخشی که عمداً برجسته است */
.terms-body > section.is-key {
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(236, 72, 153, .10), transparent 65%),
        var(--terms-surface);
    border: 1px solid rgba(236, 72, 153, .38);
    border-radius: 18px;
    padding: 26px 26px 28px;
    margin-block: 24px;
}

.key-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--terms-pink);
    border: 1px solid rgba(236, 72, 153, .45);
    background: rgba(236, 72, 153, .10);
    border-radius: 999px;
    padding: 1px 13px;
    margin-bottom: 12px;
}

/* فهرست محتوای ممنوع */
ul.banned {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 10px 28px;
}

ul.banned li {
    position: relative;
    padding-inline-start: 19px;
    line-height: 1.85;
    color: var(--terms-ink-2);
}

ul.banned li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: .85em;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--terms-pink);
}

.note {
    font-size: 14.5px;
    color: var(--terms-muted);
    margin: 0;
}

.terms-foot {
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--terms-muted);
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, .45);
    background: rgba(34, 211, 238, .08);
    color: var(--terms-cyan);
    text-decoration: none;
    font-weight: 700;
    transition: .2s ease;
}

.back-home:hover {
    background: rgba(34, 211, 238, .16);
    border-color: var(--terms-cyan);
}

@media (max-width: 900px) {
    .terms-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .terms-toc {
        position: static;
    }

    .terms-toc ol {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .terms-toc a {
        background: var(--terms-surface);
        border: 1px solid var(--terms-rule);
        padding: 3px 13px;
    }

    .terms-body {
        max-width: none;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15.5px;
    }

    dl.defs {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    dl.defs dd {
        margin-bottom: 10px;
    }

    ol.clauses > li {
        grid-template-columns: 2.8em minmax(0, 1fr);
    }

    .terms-body > section.is-key {
        padding: 20px 16px 22px;
    }
}
