/* =========================================================
   قوانین و مقررات (صفحه عمومی + ویرایشگر ادمین)
   ========================================================= */

.terms-page { padding-top: 40px; padding-bottom: 64px; }
.terms-card {
    max-width: 820px; margin: 0 auto; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 36px 40px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.terms-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--grad-brand); }
.terms-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.terms-head h1 { font-size: 1.6rem; line-height: 1.5; margin: 0; }
.terms-updated { margin: 0; font-size: .82rem; color: var(--text-faint); }

/* متن رندرشده */
.terms-content { font-size: .98rem; line-height: 2.05; color: var(--text); }
.terms-content h2 { font-size: 1.12rem; margin: 28px 0 8px; color: var(--primary-dark); }
.terms-content h2:first-child { margin-top: 0; }
.terms-content h3 { font-size: 1rem; margin: 18px 0 6px; }
.terms-content p { margin: 0 0 12px; color: var(--text-soft); }
.terms-content ul { margin: 0 0 14px; padding-inline-start: 22px; color: var(--text-soft); list-style: disc; }
.terms-content li { margin-bottom: 4px; }
.terms-content li::marker { color: var(--primary); }
.terms-content strong { color: var(--text); }

/* ادمین */
.terms-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.terms-editor { font-family: inherit; font-size: .9rem; line-height: 1.9; min-height: 420px; resize: vertical; }
.terms-help { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .8rem; color: var(--text-soft); }
.terms-help code { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-family: inherit; direction: rtl; }
.terms-reset { margin-top: 14px; }
.terms-preview { max-height: 720px; overflow-y: auto; padding-inline-end: 6px; font-size: .9rem; }

@media (max-width: 1000px) {
    .terms-admin-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .terms-page { padding-top: 20px; }
    .terms-card { padding: 26px 18px; }
    .terms-head h1 { font-size: 1.3rem; }
}
