/* ── Reading progress ── */
.v3-legal-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1001;
    background: transparent;
    pointer-events: none;
}

.v3-legal-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--teal-light), var(--orange));
    box-shadow: 0 0 12px var(--orange-glow);
    transition: width 0.12s linear;
}

/* ── Hero ── */
.v3-legal-page {
    --legal-sidebar-width: 260px;
}

.v3-legal-hero {
    position: relative;
    padding: 128px 0 72px;
    overflow: hidden;
    background:
        var(--gradient-hero),
        radial-gradient(ellipse 40% 50% at 100% 0%, rgba(249, 115, 22, 0.08), transparent 70%);
    border-bottom: 1px solid var(--border);
}

.v3-legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, black 30%, transparent 100%);
    pointer-events: none;
}

.v3-legal-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: end;
}

.v3-legal-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    padding: 8px 14px 8px 10px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s, gap 0.2s;
}

.v3-legal-back:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    gap: 10px;
}

.v3-legal-hero-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.v3-legal-hero-copy h1 span {
    background: linear-gradient(135deg, var(--teal-light), #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.v3-legal-hero-desc {
    margin: 0;
    max-width: 560px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.v3-legal-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.v3-legal-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.v3-legal-meta-chip i {
    color: var(--orange);
    font-size: 0.72rem;
}

.v3-legal-hero-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(ellipse 80% 80% at 100% 0%, rgba(21, 100, 94, 0.18), transparent 60%),
        rgba(255, 255, 255, 0.03);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
}

.v3-legal-hero-card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 14px;
    background: rgba(21, 100, 94, 0.22);
    color: #2dd4bf;
    font-size: 1.25rem;
}

.v3-legal-hero-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.v3-legal-hero-card p {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.v3-legal-hero-card a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--orange);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: gap 0.2s;
}

.v3-legal-hero-card a:hover {
    gap: 12px;
}

/* ── Layout ── */
.v3-legal-content {
    padding: 56px 0 72px;
}

.v3-legal-layout {
    display: grid;
    grid-template-columns: var(--legal-sidebar-width) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.v3-legal-sidebar {
    position: relative;
}

.v3-legal-sidebar-inner {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.v3-legal-sidebar-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.v3-legal-toc {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.v3-legal-toc a {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.v3-legal-toc a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.v3-legal-toc a.is-active {
    color: var(--text);
    background: rgba(21, 100, 94, 0.16);
    border-color: rgba(21, 100, 94, 0.35);
}

.v3-legal-sidebar-card {
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.v3-legal-sidebar-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
}

.v3-legal-sidebar-card p {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.v3-legal-sidebar-card a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--orange);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.v3-legal-mobile-toc {
    display: none;
    margin-bottom: 20px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.v3-legal-mobile-toc summary {
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    list-style: none;
}

.v3-legal-mobile-toc summary::-webkit-details-marker {
    display: none;
}

.v3-legal-mobile-toc summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    float: right;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.v3-legal-mobile-toc[open] summary::after {
    transform: rotate(180deg);
}

.v3-legal-mobile-toc .v3-legal-toc {
    margin-top: 12px;
    max-height: 240px;
}

/* ── Article ── */
.v3-legal-main {
    min-width: 0;
}

.v3-legal-article {
    min-width: 0;
}

.v3-legal-lead {
    margin-bottom: 28px;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(249, 115, 22, 0.22);
    background:
        radial-gradient(ellipse 60% 80% at 0% 50%, rgba(249, 115, 22, 0.08), transparent 70%),
        rgba(255, 255, 255, 0.03);
}

.v3-legal-lead p {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.75;
}

.v3-legal-section {
    margin-bottom: 16px;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    scroll-margin-top: 104px;
}

.v3-legal-section:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.v3-legal-section-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.v3-legal-section-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(21, 100, 94, 0.2);
    border: 1px solid rgba(21, 100, 94, 0.35);
    color: #2dd4bf;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.v3-legal-section h2 {
    margin: 0;
    padding-top: 6px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
    color: var(--text);
}

.v3-legal-section-body > *:first-child {
    margin-top: 0;
}

.v3-legal-section-body > *:last-child {
    margin-bottom: 0;
}

.v3-legal-section-body p {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.78;
}

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

.v3-legal-section-body p b,
.v3-legal-section-body p strong {
    color: var(--text);
    font-weight: 600;
}

.v3-legal-section-body a {
    color: var(--orange);
    text-decoration: none;
}

.v3-legal-section-body a:hover {
    text-decoration: underline;
}

.v3-legal-callout,
.v3-legal-section-body blockquote.v3-legal-callout {
    margin: 0;
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px solid rgba(21, 100, 94, 0.35);
    background:
        radial-gradient(ellipse 80% 100% at 0% 50%, rgba(21, 100, 94, 0.14), transparent 65%),
        rgba(0, 0, 0, 0.15);
}

.v3-legal-section-body blockquote.v3-legal-callout p {
    margin: 0;
    color: var(--text) !important;
    font-size: 0.95rem !important;
    font-weight: 500;
    line-height: 1.65 !important;
}

.v3-legal-callout i,
.v3-legal-section-body blockquote.v3-legal-callout i {
    display: inline-block;
    margin-right: 8px;
    color: #2dd4bf;
}

/* ── Bottom CTA ── */
.v3-legal-cta {
    padding: 0 0 80px;
}

.v3-legal-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 36px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(ellipse 50% 100% at 100% 50%, rgba(249, 115, 22, 0.1), transparent 60%),
        radial-gradient(ellipse 40% 100% at 0% 50%, rgba(21, 100, 94, 0.12), transparent 60%),
        rgba(255, 255, 255, 0.03);
}

.v3-legal-cta-copy h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.v3-legal-cta-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.v3-legal-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.v3-footer--legal {
    margin-top: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .v3-legal-hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .v3-legal-hero-card {
        max-width: 420px;
    }

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

    .v3-legal-sidebar {
        display: none;
    }

    .v3-legal-mobile-toc {
        display: block;
    }
}

@media (max-width: 768px) {
    .v3-legal-hero {
        padding: 104px 0 48px;
    }

    .v3-legal-content {
        padding: 36px 0 56px;
    }

    .v3-legal-lead,
    .v3-legal-section {
        padding: 22px 20px;
    }

    .v3-legal-section-head {
        gap: 12px;
    }

    .v3-legal-section-num {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }

    .v3-legal-section h2 {
        font-size: 1.02rem;
        padding-top: 4px;
    }

    .v3-legal-cta-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
    }

    .v3-legal-cta-actions {
        flex-direction: column;
    }

    .v3-legal-cta-actions .v3-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .v3-legal-hero-copy h1 {
        font-size: clamp(1.85rem, 7vw, 2.35rem);
    }

    .v3-legal-hero-meta {
        gap: 8px;
    }

    .v3-legal-meta-chip {
        font-size: 0.72rem;
        padding: 7px 12px;
    }

    .v3-legal-section-body p {
        font-size: 0.88rem;
    }
}
