/* =============================================
   LEGAL PAGES — Hosting Terms & Conditions
   Styles that extend the main design system
   ============================================= */

/* ===== LEGAL HERO ===== */
.legal-hero {
    position: relative;
    padding: 10rem 0 4rem;
    background: var(--bg-primary);
    overflow: hidden;
}

.legal-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.legal-hero-bg .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
}

.legal-hero-bg .shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.legal-hero-bg .shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: -50px;
    left: -80px;
}

.legal-hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease, gap 0.2s ease;
}

.breadcrumb:hover {
    color: var(--primary-dark);
    gap: 0.75rem;
}

.legal-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.legal-hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.legal-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-divider {
    opacity: 0.4;
}

/* ===== LEGAL LAYOUT ===== */
.legal-content {
    padding: 3rem 0 5rem;
    background: var(--bg-secondary);
    min-height: 60vh;
}

.legal-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 4rem;
    align-items: start;
}

/* ===== TABLE OF CONTENTS ===== */
.toc-sticky {
    position: sticky;
    top: 100px;
}

.toc-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

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

.toc-list li {
    counter-increment: toc-counter;
}

.toc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.toc-link:hover {
    color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
    border-left-color: rgba(67, 97, 238, 0.3);
}

.toc-link.active {
    color: var(--primary);
    font-weight: 600;
    background: rgba(67, 97, 238, 0.08);
    border-left-color: var(--primary);
}

/* ===== LEGAL BODY ===== */
.legal-body {
    max-width: 780px;
}

.legal-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
    scroll-margin-top: 100px;
}

.legal-section:hover {
    box-shadow: var(--shadow-sm);
}

.legal-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-secondary);
    line-height: 1.3;
}

.section-num {
    display: inline-block;
    color: var(--primary);
    font-weight: 800;
    margin-right: 0.25rem;
}

.legal-section h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-section h3:first-of-type {
    margin-top: 0;
}

.legal-section p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

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

.legal-section ul,
.legal-section ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-section li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0.35rem;
    padding-left: 0.25rem;
}

.legal-section li::marker {
    color: var(--primary);
}

/* ===== DEFINITIONS LIST ===== */
.definitions-list dl {
    display: grid;
    gap: 0;
}

.definitions-list dt {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.definitions-list dt:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.definitions-list dd {
    margin-left: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 0.35rem;
}

/* ===== LEGAL CTA ===== */
.legal-cta {
    margin-top: 2rem;
}

.legal-cta-inner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.legal-cta-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.legal-cta-inner h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    position: relative;
}

.legal-cta-inner p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.legal-cta-inner .btn-primary {
    background: #fff;
    color: var(--primary);
    position: relative;
}

.legal-cta-inner .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

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

@media (max-width: 768px) {
    .legal-hero {
        padding: 8rem 0 3rem;
    }

    .legal-hero h1 {
        font-size: 1.75rem;
    }

    .legal-meta {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .legal-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .legal-toc {
        display: none;
    }

    .legal-section {
        padding: 1.75rem;
        margin-bottom: 1.25rem;
        border-radius: var(--radius-md);
    }

    .legal-section h2 {
        font-size: 1.25rem;
    }

    .legal-cta-inner {
        padding: 2rem 1.5rem;
    }

    .legal-cta-inner h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .legal-hero {
        padding: 7rem 0 2.5rem;
    }

    .legal-hero h1 {
        font-size: 1.5rem;
    }

    .legal-section {
        padding: 1.25rem;
    }

    .legal-section h2 {
        font-size: 1.15rem;
    }

    .legal-section p,
    .legal-section li {
        font-size: 0.9rem;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .breadcrumb {
        transition: none;
    }

    .toc-link {
        transition: none;
    }

    .legal-section {
        transition: none;
    }
}