/* ===================================
   Legal Pages - Terms & Privacy CSS
   =================================== */

/* ===== Legal Page Layout ===== */
.legal-page {
    padding: 120px 0 80px;
    background: var(--bg-light);
    min-height: 100vh;
}

/* ===== Legal Header ===== */
.legal-header {
    text-align: center;
    margin-bottom: 40px;
}

.legal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

.legal-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.legal-header h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.legal-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.legal-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.legal-meta-item svg {
    width: 16px;
    height: 16px;
}

/* ===== Legal Card ===== */
.legal-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ===== Legal Navigation ===== */
.legal-nav {
    padding: 32px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.legal-nav-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.legal-nav-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.legal-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legal-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.legal-nav-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.legal-nav-num {
    font-weight: 700;
    color: var(--primary);
}

/* ===== Legal Body ===== */
.legal-body {
    padding: 40px;
}

/* ===== Legal Chapter ===== */
.legal-chapter {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    margin: 48px 0 32px;
}

.legal-chapter:first-child {
    margin-top: 0;
}

.legal-chapter-num {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.legal-chapter-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

/* ===== Legal Section ===== */
.legal-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.legal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legal-section-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.legal-section-num {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: 800;
    border-radius: 50%;
    flex-shrink: 0;
}

.legal-section-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.legal-section-title span {
    font-size: 13px;
    color: var(--text-muted);
}

.legal-section-content {
    padding-left: 68px;
}

.legal-section-content p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.legal-section-content p:last-child {
    margin-bottom: 0;
}

.legal-section-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== Legal Lists ===== */
.legal-list {
    margin: 16px 0;
}

.legal-list li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 8px;
}

.legal-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.legal-list.numbered {
    counter-reset: item;
}

.legal-list.numbered li {
    padding-left: 28px;
}

.legal-list.numbered li::before {
    content: counter(item);
    counter-increment: item;
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    top: 3px;
}

/* ===== Legal Table ===== */
.legal-table-wrap {
    overflow-x: auto;
    margin: 20px 0;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.legal-table th,
.legal-table td {
    padding: 14px 16px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.legal-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-primary);
}

.legal-table td {
    color: var(--text-secondary);
    vertical-align: top;
}

.legal-table td strong {
    color: var(--text-primary);
}

.legal-table a {
    color: var(--primary);
}

.legal-table a:hover {
    text-decoration: underline;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 4px;
}

/* ===== Legal Info Box ===== */
.legal-info-box {
    padding: 24px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    margin: 20px 0;
}

.legal-info-box.warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.legal-info-box.warning .legal-info-box-title {
    color: #b45309;
}

.legal-info-box.warning .legal-info-box-title svg {
    color: #f59e0b;
}

.legal-info-box.success {
    background: #f0fdf4;
    border-left-color: var(--accent);
}

.legal-info-box.success .legal-info-box-title {
    color: var(--accent-dark);
}

.legal-info-box.success .legal-info-box-title svg {
    color: var(--accent);
}

.legal-info-box-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.legal-info-box-title svg {
    width: 20px;
    height: 20px;
}

.legal-info-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ===== Legal Article (Grouped) ===== */
.legal-article {
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.legal-article-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.legal-article-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

.legal-article p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ===== Legal Contact Card ===== */
.legal-contact-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    margin: 24px 0;
}

.legal-contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.legal-contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.legal-contact-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.legal-contact-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.legal-contact-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Legal Version Footer ===== */
.legal-version {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 24px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.legal-version-item {
    text-align: center;
}

.legal-version-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.legal-version-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .legal-contact-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .legal-page {
        padding: 100px 0 60px;
    }

    .legal-header h1 {
        font-size: 28px;
    }

    .legal-meta {
        flex-direction: column;
        gap: 12px;
    }

    .legal-nav {
        padding: 24px;
    }

    .legal-nav-list {
        flex-direction: column;
    }

    .legal-body {
        padding: 24px;
    }

    .legal-chapter {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 20px;
    }

    .legal-section-header {
        flex-direction: column;
        gap: 16px;
    }

    .legal-section-content {
        padding-left: 0;
    }

    .legal-table {
        font-size: 13px;
    }

    .legal-table th,
    .legal-table td {
        padding: 10px 12px;
    }

    .legal-contact-card {
        padding: 16px;
    }

    .legal-version {
        flex-wrap: wrap;
        gap: 20px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .legal-header h1 {
        font-size: 24px;
    }

    .legal-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .legal-icon svg {
        width: 32px;
        height: 32px;
    }

    .legal-section-title h2 {
        font-size: 18px;
    }

    .legal-chapter-title {
        font-size: 18px;
    }
}

