/* ==========================================================================
   Tolbakter - Terms & Conditions (Syarat & Ketentuan) Styles
   One-Page Layout with Sticky TOC Sidebar & Modern Card Sections
   ========================================================================== */

:root {
    --terms-primary: #bd0808;
    --terms-primary-dark: #8c0505;
    --terms-primary-light: #fef2f2;
    --terms-primary-border: #fecaca;
    --terms-text-main: #1f2937;
    --terms-text-muted: #4b5563;
    --terms-border-color: #e5e7eb;
    --terms-card-bg: #ffffff;
    --terms-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --terms-shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --terms-radius: 16px;
    --terms-radius-sm: 10px;
}

html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Page Header Extensions
   ========================================================================== */
.terms-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 12px;
    backdrop-filter: blur(8px);
}

.terms-header-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    max-width: 720px;
    margin: 8px 0 16px;
    line-height: 1.6;
}

/* ==========================================================================
   Main Wrapper & Grid Layout
   ========================================================================== */
.terms-page-wrapper {
    background-color: #f8fafc;
    padding: 3.5rem 0 5rem;
    position: relative;
}

.terms-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
}

/* ==========================================================================
   Sticky Sidebar & Table of Contents (TOC)
   ========================================================================== */
.terms-sidebar-col {
    position: relative;
    height: 100%;
}

.terms-sticky-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: top 0.2s ease;
}

.admin-bar .terms-sticky-sidebar {
    top: 135px;
}

.terms-toc-card {
    background: var(--terms-card-bg);
    border: 1px solid var(--terms-border-color);
    border-radius: var(--terms-radius);
    padding: 1.5rem;
    box-shadow: var(--terms-shadow-sm);
    transition: box-shadow 0.3s ease;
}

.terms-toc-card:hover {
    box-shadow: var(--terms-shadow-md);
}

.terms-toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.toc-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--terms-primary-light);
    color: var(--terms-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.terms-toc-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.terms-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.terms-toc-list li {
    margin: 0;
    padding: 0;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.35;
    transition: all 0.22s ease-in-out;
    border-left: 3px solid transparent;
}

.toc-link .toc-number {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.toc-link .toc-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-link:hover {
    color: var(--terms-primary);
    background: #fdf2f2;
}

.toc-link:hover .toc-number {
    color: var(--terms-primary);
    background: #fecaca;
}

.toc-link.active {
    color: var(--terms-primary) !important;
    background: var(--terms-primary-light) !important;
    border-left-color: var(--terms-primary) !important;
    font-weight: 700 !important;
    padding-left: 12px;
}

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

/* ==========================================================================
   Content Area & Sections
   ========================================================================== */
.terms-content-col {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    min-width: 0;
}

/* Intro Banner */
.terms-intro-card {
    background: linear-gradient(to right, #ffffff, #fdfbfb);
    border: 1px solid #fee2e2;
    border-left: 5px solid var(--terms-primary);
    border-radius: var(--terms-radius);
    padding: 2rem;
    box-shadow: var(--terms-shadow-sm);
}

.intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--terms-primary-light);
    color: var(--terms-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.intro-heading {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 0.85rem 0;
}

.intro-desc {
    color: var(--terms-text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
    margin: 0 0 1.25rem 0;
}

.intro-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #64748b;
}

.intro-meta-info .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.intro-meta-info i {
    color: var(--terms-primary);
}

/* Standard Section Cards */
.terms-section-card {
    background: var(--terms-card-bg);
    border: 1px solid var(--terms-border-color);
    border-radius: var(--terms-radius);
    padding: 2.25rem;
    box-shadow: var(--terms-shadow-sm);
    scroll-margin-top: 110px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.terms-section-card:hover {
    box-shadow: var(--terms-shadow-md);
    border-color: #cbd5e1;
}

.section-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.section-number-pill {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 12px;
    background: var(--terms-primary-light);
    color: var(--terms-primary);
    border: 1px solid var(--terms-primary-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: -0.5px;
    line-height: 1;
    align-self: center;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 !important;
    padding: 0;
    line-height: 1.35;
    flex: 1;
    align-self: center;
}

.section-card-body {
    color: var(--terms-text-main);
    font-size: 0.98rem;
    line-height: 1.75;
}

.section-card-body p {
    margin-top: 0;
    margin-bottom: 1.15rem;
}

.section-card-body p:last-child {
    margin-bottom: 0;
}

.terms-lead-text {
    font-weight: 600;
    color: #1e293b;
}

/* ==========================================================================
   Callout Boxes (Warning, Danger/Disclaimer, Info)
   ========================================================================== */
.terms-callout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 1.25rem 1.5rem;
    border-radius: var(--terms-radius-sm);
    margin: 1.5rem 0 1rem;
    line-height: 1.65;
    font-size: 0.95rem;
}

.terms-callout .callout-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.terms-callout .callout-content {
    flex: 1;
}

.terms-callout .callout-label {
    display: inline-block;
    margin-right: 6px;
    font-weight: 800;
}

/* Warning Callout */
.terms-callout-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.terms-callout-warning .callout-icon {
    color: #d97706;
}

/* Danger / Legal Disclaimer Callout */
.terms-callout-danger {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.terms-callout-danger .callout-icon {
    color: #dc2626;
}

/* Info Callout */
.terms-callout-info {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    border-left: 4px solid #16a34a;
    color: #166534;
}

.terms-callout-info .callout-icon {
    color: #16a34a;
}

/* ==========================================================================
   Dual Rules Grid (Allowed vs Prohibited)
   ========================================================================== */
.terms-rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.rule-box {
    border-radius: var(--terms-radius-sm);
    padding: 1.35rem;
    transition: transform 0.2s ease;
}

.rule-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}

.rule-box-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.rule-box-title {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0;
}

.rule-box-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Allowed Box */
.rule-box-allowed {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.rule-box-allowed .rule-box-icon {
    color: #16a34a;
}

.rule-box-allowed .rule-box-title {
    color: #14532d;
}

/* Prohibited Box */
.rule-box-prohibited {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.rule-box-prohibited .rule-box-icon {
    color: #dc2626;
}

.rule-box-prohibited .rule-box-title {
    color: #7f1d1d;
}

/* ==========================================================================
   Feature List Items (CCTV Rules)
   ========================================================================== */
.terms-feature-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.terms-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--terms-radius-sm);
    padding: 1.15rem 1.25rem;
}

.feature-bullet-icon {
    width: 36px;
    height: 36px;
    background: var(--terms-primary-light);
    color: var(--terms-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.feature-content {
    flex: 1;
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--terms-text-main);
}

.feature-content strong {
    display: block;
    color: #0f172a;
    margin-bottom: 2px;
    font-weight: 700;
}

/* ==========================================================================
   Step Process (Dispute Resolution)
   ========================================================================== */
.terms-steps-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.terms-step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--terms-radius-sm);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.step-badge {
    width: 36px;
    height: 36px;
    background: var(--terms-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 3px 8px rgba(189, 8, 8, 0.3);
}

.step-body {
    flex: 1;
}

.step-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.step-desc {
    font-size: 0.92rem;
    color: var(--terms-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   Footer Notice Card
   ========================================================================== */
.terms-footer-notice {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: var(--terms-radius);
    padding: 1.25rem 1.5rem;
    text-align: center;
}

.terms-footer-notice p {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.terms-footer-notice i {
    color: var(--terms-primary);
}

/* Optional Custom Content */
.terms-editor-content {
    background: #ffffff;
    border: 1px solid var(--terms-border-color);
    border-radius: var(--terms-radius);
    padding: 1.75rem;
    color: var(--terms-text-main);
    line-height: 1.7;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .site-header,
    .page-header,
    .terms-sidebar-col,
    .site-footer,
    .back-to-top {
        display: none !important;
    }

    .terms-page-wrapper {
        background: #ffffff !important;
        padding: 0 !important;
    }

    .terms-grid {
        display: block !important;
    }

    .terms-section-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 20px !important;
    }
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    .terms-grid {
        grid-template-columns: 280px 1fr;
        gap: 1.75rem;
    }

    .terms-toc-card {
        padding: 1.25rem;
    }

    .terms-section-card {
        padding: 1.75rem;
    }

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

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

    .terms-sticky-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .terms-toc-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .terms-page-wrapper {
        padding: 2.25rem 0 3.5rem;
    }

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

    .terms-intro-card,
    .terms-section-card {
        padding: 1.35rem;
    }

    .section-card-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .section-number-pill {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 0.95rem;
        border-radius: 10px;
        align-self: center;
        flex-shrink: 0;
    }

    .section-title {
        font-size: 1.15rem;
        line-height: 1.35;
        margin: 0 !important;
        padding: 0;
        align-self: center;
        flex: 1;
    }

    .terms-callout {
        padding: 1rem 1.15rem;
        font-size: 0.88rem;
    }
}
