/* Legal Page Specific Styles */

/* Page Layout */
body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2.5rem, 5vw, 4rem);
}

/* Legal Shell Container */
.legal-shell {
    position: relative;
    z-index: 1;
    width: min(960px, 100%);
    background: rgba(15, 23, 42, 0.85);
    border-radius: 32px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(22px);
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.55);
    overflow: hidden;
    color: inherit;
}

body.light .legal-shell {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
}

/* Header */
header {
    padding: clamp(2rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.25rem);
}

header h1 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.85rem, 4vw, 2.35rem);
    letter-spacing: 0.02em;
}

header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 44ch;
}

body.light header p {
    color: var(--text-muted-light);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-link:hover {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(96, 165, 250, 0.18);
    transform: translateX(-2px);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

body.light .back-link {
    background: rgba(255, 255, 255, 0.65);
}

/* Tab Navigation */
.tablist {
    display: flex;
    gap: 1rem;
    padding: 0 clamp(2rem, 4vw, 3rem);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.tablist button {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.015em;
    color: inherit;
    background: rgba(15, 23, 42, 0.65);
    cursor: pointer;
    transition: transform 0.18s ease, border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.tablist button::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.45);
    transition: background 0.2s ease;
}

.tablist button[aria-selected="true"] {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(96, 165, 250, 0.18);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.tablist button[aria-selected="true"]::before {
    background: var(--accent);
}

body.light .tablist button {
    background: rgba(255, 255, 255, 0.65);
}

/* Main Content */
main {
    padding: 0 clamp(2rem, 4vw, 3rem) clamp(2.5rem, 4vw, 3.5rem);
}

.tab-panel {
    display: none;
    animation: fade-in 0.38s ease both;
}

.tab-panel.active {
    display: block;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-panel h2,
.tab-panel strong {
    color: var(--accent);
    font-weight: 600;
}

body.light .tab-panel h2,
body.light .tab-panel strong {
    color: var(--accent-strong);
}

.tab-panel p,
.tab-panel li {
    line-height: 1.65;
    font-size: 1rem;
}

.tab-panel ul {
    padding-left: 1.5rem;
    margin: 0.75rem 0 1.75rem;
}

.tab-panel a {
    color: var(--accent);
    text-decoration: none;
    position: relative;
}

.tab-panel a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: currentColor;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.tab-panel a:hover::after,
.tab-panel a:focus-visible::after {
    opacity: 1;
}

.divider {
    margin: 2.5rem 0;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.effective-date {
    font-weight: 500;
    color: var(--accent);
}

body.light .effective-date {
    color: var(--accent-strong);
}

/* Footer */
footer {
    padding: clamp(1.5rem, 2vw, 2rem) clamp(2rem, 3vw, 3rem) clamp(2rem, 4vw, 3rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(15, 23, 42, 0));
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

footer a {
    color: inherit;
}

/* Theme Toggle Override for Legal Page */
.theme-toggle {
    position: absolute;
    top: clamp(1.5rem, 4vw, 2.75rem);
    right: clamp(1.5rem, 4vw, 2.75rem);
}

/* Responsive */
@media (max-width: 720px) {
    body {
        padding: clamp(1.5rem, 6vw, 2.5rem);
    }

    .legal-shell {
        border-radius: 24px;
    }

    header,
    main,
    footer {
        padding-left: clamp(1.35rem, 6vw, 1.75rem);
        padding-right: clamp(1.35rem, 6vw, 1.75rem);
    }

    .tablist {
        padding-left: clamp(1.35rem, 6vw, 1.75rem);
        padding-right: clamp(1.35rem, 6vw, 1.75rem);
    }

    .tab-panel ul {
        padding-left: 1.2rem;
    }

    .theme-toggle {
        position: static;
        align-self: flex-end;
    }
}