:root {
    --primary-color: #e4393c;
    --primary-dark: #c81623;
    --text-color: #333;
    --text-secondary: #666;
    --light-gray: #f5f5f5;
    --border-color: #eee;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* Base styles */
.terms-container {
    padding: 40px 0;
    margin: 30px auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 1100px;
}

.terms-container h1 {
    font-size: 32px;
    color: var(--text-color);
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    font-weight: 700;
    position: relative;
}

.terms-container h1::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Table of contents */
.toc {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 20px 30px;
    margin-bottom: 30px;
}

.toc h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-color);
}

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

.toc li {
    margin-bottom: 10px;
}

.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 5px 0;
}

.toc a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Content styles */
.terms-content {
    padding: 0 40px;
}

.terms-content h2 {
    font-size: 24px;
    color: var(--text-color);
    margin: 40px 0 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
    position: relative;
    padding-left: 20px;
}

.terms-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25px;
    width: 8px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 4px;
}

.terms-content h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.terms-content h3 {
    font-size: 20px;
    color: var(--text-color);
    margin: 30px 0 15px;
    font-weight: 600;
}

.terms-content p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
}

.terms-content ul {
    margin: 20px 0 20px 20px;
    padding-left: 15px;
}

.terms-content li {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
    position: relative;
    padding-left: 15px;
}

.terms-content li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.terms-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px dotted var(--primary-color);
}

.terms-content a:hover {
    color: var(--primary-dark);
    border-bottom: 1px solid var(--primary-dark);
}

/* Highlight box */
.highlight-box {
    background-color: rgba(228, 57, 60, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.highlight-box p {
    margin-bottom: 0;
    color: var(--text-color);
}

/* Responsive design */
@media (max-width: 992px) {
    .terms-container {
        padding: 30px 0;
        margin: 20px;
    }

    .terms-content {
        padding: 0 30px;
    }
}

@media (max-width: 768px) {
    .terms-container {
        padding: 25px 0;
        margin: 15px;
    }

    .terms-container h1 {
        font-size: 28px;
    }

    .terms-content h2 {
        font-size: 22px;
        padding-left: 15px;
    }

    .terms-content h3 {
        font-size: 18px;
    }

    .terms-content {
        padding: 0 20px;
    }

    .toc {
        padding: 15px 20px;
    }
}

@media (max-width: 576px) {
    .terms-container h1 {
        font-size: 24px;
    }

    .terms-content h2 {
        font-size: 20px;
    }

    .terms-content p,
    .terms-content li {
        font-size: 15px;
    }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px);
}

.back-to-top::after {
    content: '↑';
    font-size: 20px;
    font-weight: bold;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.terms-content h2,
.terms-content h3,
.terms-content p,
.terms-content ul {
    animation: fadeIn 0.6s ease forwards;
}

.terms-content h2 { animation-delay: 0.1s; }
.terms-content h3 { animation-delay: 0.2s; }
.terms-content p { animation-delay: 0.3s; }
.terms-content ul { animation-delay: 0.4s; }

/* Contact page styles */
.contact-info {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
}

.contact-item {
    margin-bottom: 20px;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item strong {
    display: block;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 16px;
}

.contact-item p {
    margin-bottom: 0;
}

/* Highlight boxes */
.note {
    background-color: rgba(51, 153, 255, 0.05);
    border-left: 4px solid #3399ff;
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.note strong {
    color: #3399ff;
    display: block;
    margin-bottom: 10px;
}

.tip {
    background-color: rgba(128, 128, 0, 0.05);
    border-left: 4px solid #808000;
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.tip strong {
    color: #808000;
    display: block;
    margin-bottom: 10px;
}

.important {
    background-color: rgba(228, 57, 60, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.important strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 10px;
}

/* List styles enhancements */
.terms-content ol {
    margin: 20px 0 20px 20px;
    padding-left: 15px;
}

.terms-content ol li {
    counter-increment: item;
    list-style-type: none;
    position: relative;
}

.terms-content ol li::before {
    content: counter(item) ".";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -25px;
}

/* Print styles */
@media print {
    .terms-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }

    .back-to-top,
    .toc {
        display: none;
    }

    .terms-content {
        padding: 0;
    }
}