/* ===========================
   Terms & Conditions Page Styles
   FinPluss Design System
   =========================== */

/* Reset & Base */
.terms-content * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main Content */
.terms-content {
    padding: 60px 0;
    background-color: #FFF8F0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
}

/* Container */
.terms-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Lazy Loading Styles */
.terms-lazy-load {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.terms-lazy-load.terms-lazy-loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Loading State Skeleton */
.terms-lazy-load:not(.terms-lazy-loaded) .terms-section-content {
    position: relative;
    min-height: 120px;
}

.terms-lazy-load:not(.terms-lazy-loaded) .terms-section-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Page Header */
.terms-page-header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 2px solid #E5E5E5;
}

.terms-page-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #243E93;
    margin-bottom: 8px;
}

.terms-page-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #F36D21;
    margin-bottom: 12px;
}

.terms-last-updated {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Introduction Section */
.terms-intro-section {
    background: white;
    padding: 32px;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
    margin-bottom: 48px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.terms-intro-section p {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #333;
    line-height: 1.8;
}

.terms-intro-section strong {
    font-weight: 600;
    color: #243E93;
}

/* Table of Contents */
.terms-toc-nav {
    background: white;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
    margin-bottom: 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.terms-toc-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #243E93;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terms-toc-title i {
    color: #F36D21;
}

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

.terms-toc-list li {
    margin-bottom: 8px;
}

.terms-toc-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    padding: 4px 0;
    transition: all 0.3s ease;
}

.terms-toc-list a:hover {
    color: #F36D21;
    padding-left: 8px;
}

.terms-toc-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #FFF8F0;
    color: #243E93;
    text-align: center;
    line-height: 24px;
    border-radius: 50%;
    margin-right: 12px;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s ease;
}

/* Terms Sections */
.terms-section {
    background: white;
    padding: 32px;
    margin-bottom: 24px;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    min-height: 150px;
}

/* Placeholder for lazy loading */
.terms-section.terms-lazy-load:not(.terms-lazy-loaded) {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #f8f8f8 100%
    );
}

/* Section Number Badge */
.terms-section-number {
    position: absolute;
    left: -20px;
    top: 28px;
    width: 40px;
    height: 40px;
    background: #F36D21;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(243, 109, 33, 0.3);
}

/* Section Headings */
.terms-section h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #243E93;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #F36D21;
    padding-left: 30px;
}

.terms-section h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #243E93;
    margin-top: 24px;
    margin-bottom: 16px;
}

/* Section Content */
.terms-section-content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.terms-section p {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.8;
}

.terms-section ul {
    margin: 16px 0 16px 24px;
}

.terms-section li {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.8;
}

.terms-section li strong {
    font-weight: 600;
    color: #243E93;
}

/* Important Text */
.terms-important-text {
    color: #F36D21;
    font-weight: 600;
}

/* Agreement Box */
.terms-agreement-box {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFFFFF 100%);
    border: 2px solid #F36D21;
    border-radius: 8px;
    padding: 24px;
    margin: 32px 0;
    text-align: center;
}

.terms-agreement-box p {
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #243E93;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.terms-agreement-box i {
    color: #10b981;
    font-size: 20px;
}

/* Contact Section */
.terms-contact-section {
    background: linear-gradient(135deg, #243E93 0%, #1a2d6d 100%);
    color: white;
    padding: 48px;
    border-radius: 8px;
    margin-top: 48px;
    text-align: center;
}

.terms-contact-section h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: white;
    margin-bottom: 24px;
    border: none;
    padding-left: 0;
}

.terms-contact-section p {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: white;
    margin-bottom: 16px;
}

.terms-contact-info {
    margin-top: 24px;
}

.terms-contact-info p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.terms-contact-info i {
    color: #F36D21;
    font-size: 18px;
}

.terms-contact-info a {
    color: #F36D21;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.terms-contact-info a:hover {
    text-decoration: underline;
    color: #ff8c4f;
}

/* Loading Shimmer Effect */
.terms-shimmer {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Responsive Design - Tablet */
@media (max-width: 768px) {
    .terms-content {
        padding: 40px 0;
    }
    
    .terms-container {
        padding: 0 16px;
    }
    
    .terms-page-header {
        margin-bottom: 40px;
        padding-bottom: 20px;
    }
    
    .terms-page-title {
        font-size: 24px;
    }
    
    .terms-page-subtitle {
        font-size: 16px;
    }
    
    .terms-toc-nav {
        position: sticky;
        top: 20px;
        z-index: 10;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .terms-section h2 {
        font-size: 18px;
        padding-left: 30px;
    }
    
    .terms-section-number {
        left: 10px;
        top: 20px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .terms-section,
    .terms-intro-section {
        padding: 24px 16px;
        padding-left: 50px;
    }
    
    .terms-contact-section {
        padding: 32px 24px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .terms-content {
        padding: 30px 0;
    }
    
    .terms-page-header {
        margin-bottom: 30px;
    }
    
    .terms-page-title {
        font-size: 20px;
    }
    
    .terms-page-subtitle {
        font-size: 14px;
    }
    
    .terms-last-updated {
        font-size: 12px;
    }
    
    /* Hide TOC on mobile */
    .terms-toc-nav {
        display: none;
    }
    
    .terms-intro-section {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .terms-section {
        margin-bottom: 16px;
        padding: 20px 16px 20px 40px;
    }
    
    .terms-section-number {
        left: 8px;
        top: 16px;
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .terms-section h2 {
        font-size: 16px;
        padding-left: 10px;
        margin-bottom: 16px;
    }
    
    .terms-section p,
    .terms-section li,
    .terms-intro-section p {
        font-size: 14px;
    }
    
    .terms-agreement-box {
        padding: 16px;
        margin: 24px 0;
    }
    
    .terms-agreement-box p {
        font-size: 14px;
        flex-direction: column;
        gap: 4px;
    }
    
    .terms-contact-section {
        padding: 24px 16px;
    }
    
    .terms-contact-section h2 {
        font-size: 20px;
    }
    
    .terms-contact-info p {
        font-size: 14px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    /* Reduce lazy load animation on mobile */
    .terms-lazy-load {
        transform: translateY(10px);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .terms-section,
    .terms-intro-section {
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
        page-break-inside: avoid;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .terms-section-number {
        position: static;
        display: inline-block;
        margin-right: 10px;
    }
    
    .terms-contact-section {
        background: #f5f5f5;
        color: #333;
    }
    
    .terms-contact-section h2 {
        color: #243E93;
    }
    
    .terms-toc-nav {
        display: none;
    }
    
    .terms-lazy-load {
        opacity: 1 !important;
        transform: none !important;
    }
}