/* ============================================
   TERMS PAGE - FINAL COMPLETE STYLES
   ============================================ */

/* ===== PAGE HERO ===== */
.terms-hero {
    position: relative;
    min-height: 450px;
    display: flex;
    align-items: center;
    background: url('../images/Building Architecture.jpg') center center/cover no-repeat;
    padding: 140px 0 80px;
    overflow: hidden;
}

.terms-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 20, 46, 0.95) 0%, rgba(6, 20, 46, 0.75) 100%);
    z-index: 1;
}

.terms-hero .container {
    position: relative;
    z-index: 2;
}

.terms-hero .page-hero-content {
    max-width: 800px;
    color: var(--white);
}

.terms-hero .breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.terms-hero .breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.terms-hero .breadcrumb a:hover {
    color: var(--primary);
}

.terms-hero .breadcrumb i {
    color: var(--primary);
    font-size: 0.75rem;
}

.terms-hero .breadcrumb span {
    color: var(--primary);
    font-weight: 700;
}

.terms-hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.terms-hero p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.9;
    margin-bottom: 25px;
    max-width: 700px;
}

.hero-meta {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.hero-meta i {
    color: var(--primary);
}

/* ===== TERMS SECTION ===== */
.terms-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.terms-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    align-items: start;
}

/* --- Sidebar --- */
.terms-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--white);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

.sidebar-card h3,
.sidebar-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-card h3 i,
.sidebar-card h4 i {
    color: var(--primary);
}

/* TOC Navigation */
.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.toc-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.toc-link.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.toc-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--white);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
}

.toc-link.active .toc-number {
    background: var(--white);
    color: var(--primary);
}

.toc-text {
    flex: 1;
    line-height: 1.4;
}

/* Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.action-btn:last-child {
    margin-bottom: 0;
}

/* Help Card */
.help-card p {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 18px;
}

.help-card .btn {
    width: 100%;
    justify-content: center;
}

/* Reading Progress */
.reading-progress {
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
}

.progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #94a3b8);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* --- Terms Content --- */
.terms-content {
    background: var(--white);
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

/* Introduction */
.terms-intro {
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 3px solid var(--bg-light);
}

.intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(246, 199, 68, 0.1);
    color: var(--primary);
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 20px;
    border: 2px solid rgba(246, 199, 68, 0.2);
}

.terms-intro h2 {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.4;
}

.terms-intro > p {
    font-size: 1.1rem;
    color: var(--text);
    line-height: 2;
    margin-bottom: 25px;
}

.highlight-box {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-right: 4px solid #64748b;
    border-radius: 10px;
    margin-top: 25px;
}

.highlight-box i {
    font-size: 1.5rem;
    color: #64748b;
    margin-top: 3px;
}

.highlight-box strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 5px;
}

.highlight-box p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.7;
    margin: 0;
}

/* Articles */
.terms-article {
    margin-bottom: 50px;
    scroll-margin-top: 100px;
}

.article-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.article-number {
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
}

.article-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    flex: 1;
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin: 30px 0 15px;
    padding-right: 15px;
    border-right: 4px solid var(--primary);
}

.article-content p {
    font-size: 1.05rem;
    color: var(--text);
    line-height: 2;
    margin-bottom: 15px;
}

.article-content ul,
.article-content ol {
    margin: 15px 0;
    padding-right: 25px;
    list-style: none;
}

.article-content ul li,
.article-content ol li {
    font-size: 1.02rem;
    color: var(--text);
    line-height: 2;
    margin-bottom: 10px;
    padding: 10px 35px 10px 10px;
    position: relative;
    background: var(--bg-light);
    border-radius: 8px;
    border-right: 3px solid var(--primary);
}

.article-content ul li::before {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.article-content ol {
    counter-reset: terms-counter;
}

.article-content ol li {
    counter-increment: terms-counter;
}

.article-content ol li::before {
    content: counter(terms-counter);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}

.article-content strong {
    color: var(--dark);
    font-weight: 700;
}

/* Payment Schedule */
.payment-schedule {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px 0;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 12px;
}

.payment-item {
    text-align: center;
    padding: 20px;
    background: var(--white);
    border-radius: 10px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.payment-item:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.payment-percent {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 10px;
}

.payment-desc strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.payment-desc span {
    font-size: 0.88rem;
    color: var(--text-light);
}

/* Warning Box */
.warning-box {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #f8d7da;
    border-right: 4px solid #ef4444;
    border-radius: 10px;
    margin: 25px 0;
}

.warning-box i {
    font-size: 1.5rem;
    color: #ef4444;
    margin-top: 3px;
}

.warning-box strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #721c24;
    margin-bottom: 5px;
}

.warning-box p {
    font-size: 0.95rem;
    color: #721c24;
    line-height: 1.7;
    margin: 0;
}

/* Final Section */
.terms-final {
    margin-top: 60px;
    padding: 50px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    border-radius: 16px;
    text-align: center;
    color: var(--white);
}

.final-content h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 20px;
}

.final-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 2;
    margin-bottom: 35px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.final-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== FAQ SECTION ===== */
.terms-faq {
    padding: 100px 0;
    background: var(--white);
}

.faq-centered {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-item.active {
    border-color: var(--primary);
    background: #fffdf8;
    box-shadow: 0 10px 30px rgba(246, 199, 68, 0.12);
}

.faq-question {
    width: 100%;
    padding: 22px 25px;
    background: none;
    border: none;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    text-align: right;
}

.question-text {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    text-align: right;
    transition: color 0.3s ease;
}

.faq-item.active .question-text {
    color: var(--primary);
}

.faq-question > i {
    color: var(--primary);
    font-size: 0.85rem;
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question > i {
    transform: rotate(180deg);
    background: var(--primary);
    color: var(--white);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.answer-content {
    padding: 0 30px 25px 30px;
    color: var(--text);
    font-size: 1rem;
    line-height: 2;
    text-align: right;
    direction: rtl;
}

.answer-content p {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 1rem;
    line-height: 2;
}

.answer-content p:last-child {
    margin-bottom: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .terms-layout {
        grid-template-columns: 1fr;
    }

    .terms-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .toc-card {
        grid-column: 1 / -1;
    }

    .toc-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .terms-content {
        padding: 35px;
    }

    .payment-schedule {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .terms-hero {
        padding: 120px 0 60px;
        min-height: 380px;
    }

    .terms-hero h1 {
        font-size: 2.2rem;
    }

    .terms-hero p {
        font-size: 1rem;
    }

    .hero-meta {
        flex-direction: column;
        gap: 10px;
    }

    .terms-sidebar {
        grid-template-columns: 1fr;
    }

    .toc-nav {
        grid-template-columns: 1fr;
    }

    .terms-content {
        padding: 25px;
    }

    .article-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .article-header h2 {
        font-size: 1.4rem;
    }

    .article-content h3 {
        font-size: 1.15rem;
    }

    .article-content p,
    .article-content ul li,
    .article-content ol li {
        font-size: 0.95rem;
    }

    .terms-intro h2 {
        font-size: 1.6rem;
    }

    .terms-final {
        padding: 30px 20px;
    }

    .final-content h2 {
        font-size: 1.5rem;
    }

    .final-actions {
        flex-direction: column;
    }

    .final-actions .btn {
        width: 100%;
    }

    .highlight-box,
    .warning-box {
        flex-direction: column;
    }

    .faq-question {
        padding: 18px 18px;
        gap: 10px;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .faq-question > i {
        width: 28px;
        height: 28px;
    }

    .answer-content {
        padding: 0 18px 20px;
        font-size: 0.92rem;
    }
}

@media (max-width: 480px) {
    .terms-section {
        padding: 40px 0;
    }

    .terms-content {
        padding: 20px;
    }

    .article-number {
        font-size: 0.85rem;
        padding: 8px 15px;
    }

    .payment-percent {
        font-size: 2rem;
    }

    .terms-faq {
        padding: 60px 0;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .terms-sidebar,
    .faq,
    .cta,
    .back-to-top {
        display: none !important;
    }

    .terms-layout {
        grid-template-columns: 1fr;
    }

    .terms-content {
        padding: 20px;
        box-shadow: none;
        border: none;
    }

    .terms-article {
        page-break-inside: avoid;
    }

    .article-header {
        page-break-after: avoid;
    }
}
/* Force override برای دکمه بازگشت */
.terms-final .btn-outline,
.terms-final a.btn-outline {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: transparent !important;
}

.terms-final .btn-outline:hover,
.terms-final a.btn-outline:hover {
    color: #06142E !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

/* =========================================================
   TERMS PAGE — FAQ SECTION TITLE CONTRAST FIX
   Keep the FAQ heading readable on the dark navy section.
========================================================= */
body[data-brand="sazeh-sazan"] .terms-faq .section-header .section-title {
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}
