:root {
    --color-black: #1C1C1C;
    --color-cream: #F5F1E9;
    --color-taupe: #A68A74;
    --color-rosegold: #B76E79;

    --radius: 14px;
    --shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

/* بک‌گراند سفید ساده (زیر هدر/فوتر) */
.terms-page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: #fff;
}

/* ظرف صفحه */
.tr-terms-page .container {
    max-width: 1100px;
    margin-inline: auto;
    padding: 2rem 1rem 3rem;
}

/* هدر */
.tr-terms__header {
    text-align: center;
    margin-bottom: 1rem;
}

.tr-terms__title {
    margin: 0 0 .5rem;
    font-size: clamp(1.6rem, 1.1rem + 2vw, 2.2rem);
    color: var(--color-black);
    font-weight: 900;
}

.tr-terms__intro {
    color: #4b4b4b;
}

/* ریبن با Swiper */
.tr-terms__ribbon {
    margin-top: .75rem;
    --h: 36px;
    height: var(--h);
    border-radius: 999px;
    background: rgba(183, 110, 121, .08);
    display: flex;
    align-items: center;
    padding-inline: .25rem;
    overflow: hidden;
}

.tr-terms__ribbon .swiper-slide {
    width: auto;
    padding: 0 .8rem;
    line-height: var(--h);
    color: var(--color-rosegold);
    font-weight: 700;
    opacity: .85;
}

/* لیست قوانین */
.tr-terms__list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: .9rem;
    counter-reset: termsNo;
}

.tr-terms__list > li {
    counter-increment: termsNo;
}

/* کارت قانون */
.term {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    outline: 0;
    overflow: hidden;
}

/* سربرگ آکاردئون */
.term__head {
    width: 100%;
    display: grid;
    grid-template-columns:auto 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    background: linear-gradient(180deg, #fff, #fff);
    border: none;
    cursor: pointer;
    text-align: right;
}

/* یک کانتر سفارشی با اعداد فارسی بساز */
@counter-style persian {
    system: numeric;
    symbols: '۰' '۱' '۲' '۳' '۴' '۵' '۶' '۷' '۸' '۹';
    suffix: "";
}

/* همین یک خط را در rule شماره‌گذارت جایگزین کن */
.term__no::before {
    content: counter(termsNo, persian);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-rosegold);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(183, 110, 121, .25);
}

.term__title {
    margin: 0;
    color: #1f1f1f;
    font-size: 1.06rem;
    font-weight: 800;
}

.term__caret {
    /* مثل یک مثلث رو به پایین */
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 10px solid var(--color-rosegold);
    transition: transform .25s ease;
}

/* محتوای بازشو */
.term__detail {
    padding: 0 1rem 1rem;
    color: #3c3c3c;
    line-height: 1.9;
    font-size: .96rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .28s ease, opacity .2s ease;
    border-top: 1px solid rgba(0, 0, 0, .04);
}

/* حالت باز */
.term[aria-expanded="true"] .term__detail {
    opacity: 1;
}

.term[aria-expanded="true"] .term__caret {
    transform: rotate(180deg);
}

/* فوکوس دسترس‌پذیری */
.term:focus-visible {
    outline: 3px solid rgba(183, 110, 121, .25);
    outline-offset: 2px;
}

/* موبایل ریزتر */
@media (max-width: 575.98px) {
    .term__title {
        font-size: 1rem;
    }

    .term__no::before {
        width: 32px;
        height: 32px;
    }
}
