:root {
    /* --- متغیرهای دارک مود --- */
    --terms-bg-page: #0d0d12;
    --terms-card-bg: #1A1D2E;
    --terms-border: rgba(255, 255, 255, 0.08);
    --terms-text-main: #ffffff;
    --terms-text-body: #A0A3B1;
    --terms-title-gradient: linear-gradient(135deg, #fff 30%, #3E69FE 100%);
    
    --terms-section-bg: rgba(255, 255, 255, 0.02);
    --terms-icon-bg: rgba(62, 105, 254, 0.15);
    --terms-icon-color: #3E69FE;
    --terms-highlight: #eab308;
    --terms-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* --- متغیرهای لایت مود --- */
:root[data-theme="light"] {
    --terms-bg-page: #f3f4f6;
    --terms-card-bg: #ffffff;
    --terms-border: rgba(0, 0, 0, 0.08);
    --terms-text-main: #1f2937;
    --terms-text-body: #4b5563;
    --terms-title-gradient: linear-gradient(135deg, #3E69FE 0%, #111827 100%);
    
    --terms-section-bg: #f9fafb;
    --terms-icon-bg: rgba(62, 105, 254, 0.1);
    --terms-icon-color: #3E69FE;
    --terms-highlight: #d97706;
    --terms-shadow: 0 15px 30px -5px rgba(62, 105, 254, 0.1);
}

/* --- لی‌اوت اصلی --- */
.terms-page-main {
    background-color: var(--terms-bg-page);
    /* پدینگ کمتر در موبایل، بیشتر در دسکتاپ */
    padding: clamp(2rem, 5vw, 5rem) 1rem;
    min-height: 80vh;
    background-image: radial-gradient(circle at 100% 0%, rgba(62, 105, 254, 0.08) 0%, transparent 50%);
    transition: background-color 0.4s ease;
}

.terms-container {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}

/* --- هدر --- */
.terms-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 0.8s ease-out;
}

.terms-header h1 {
    font-size: clamp(1.8rem, 6vw, 3rem); /* فونت داینامیک */
    font-weight: 900;
    margin-bottom: 1rem;
    background: var(--terms-title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.last-update {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--terms-section-bg);
    border: 1px solid var(--terms-border);
    border-radius: 50px;
    color: var(--terms-text-body);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* --- کارت اصلی قوانین --- */
.terms-content-wrapper {
    background-color: var(--terms-card-bg);
    border: 1px solid var(--terms-border);
    border-radius: 24px;
    /* پدینگ هوشمند: در موبایل کم، در دسکتاپ زیاد */
    padding: clamp(1.5rem, 5vw, 3.5rem); 
    box-shadow: var(--terms-shadow);
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.2s;
}

/* --- بخش‌های قوانین --- */
.terms-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--terms-border);
}

.terms-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* تیتر هر بخش */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.title-icon {
    width: 40px;
    height: 40px;
    background: var(--terms-icon-bg);
    color: var(--terms-icon-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0; /* جلوگیری از جمع شدن آیکون */
}

.section-title h2 {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    font-weight: 800;
    color: var(--terms-text-main);
    margin: 0;
    line-height: 1.4;
}

/* متن قوانین */
.section-body {
    color: var(--terms-text-body);
    line-height: 1.9;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    text-align: justify;
    /* این خط در دسکتاپ متن را جلو می‌برد، در موبایل صفر می‌شود */
    padding-right: 3.2rem; 
}

.section-body p {
    margin-bottom: 1rem;
}

/* لیست‌های داخلی */
.section-body ul {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
}

.section-body li {
    position: relative;
    padding-right: 1.2rem; /* فضای کافی برای بولت */
    margin-bottom: 0.8rem;
}

/* بولت‌های سفارشی */
.section-body li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 11px;
    width: 6px;
    height: 6px;
    background-color: var(--terms-icon-color);
    border-radius: 50%;
}

/* متن‌های مهم (هایلایت) */
.important-note {
    background-color: var(--terms-section-bg);
    border-right: 3px solid var(--terms-highlight);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    color: var(--terms-text-main);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.important-note i {
    color: var(--terms-highlight);
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.highlight-text {
    color: var(--terms-highlight);
    font-weight: 700;
}

/* --- انیمیشن‌ها --- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --- مدیا کوئری اختصاصی موبایل (اصلاحات اصلی) --- */
@media (max-width: 768px) {
    /* تنظیم پدینگ صفحه */
    .terms-page-main {
        padding: 2rem 1rem;
    }

    /* تنظیم کارت */
    .terms-content-wrapper {
        padding: 1.5rem; /* فضای داخلی کمتر */
        border-radius: 16px;
    }

    /* حذف تورفتگی متن در موبایل */
    .section-body {
        padding-right: 0; 
    }

    /* کوچک کردن آیکون */
    .title-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* تنظیم تیتر */
    .section-title {
        gap: 10px;
        margin-bottom: 0.8rem;
    }

    /* اصلاح فاصله لیست */
    .section-body li {
        padding-right: 1rem;
    }
}