:root {
    --bg-dark: hsl(240, 10%, 4.5%);
    --card-bg: rgba(15, 15, 23, 0.55);
    --card-border: rgba(255, 255, 255, 0.06);
    --text-primary: hsl(240, 5%, 96%);
    --text-secondary: hsl(240, 4%, 70%);
    --text-muted: hsl(240, 4%, 46%);
    --accent-purple: hsl(263, 85%, 60%);
    --accent-cyan: hsl(190, 95%, 48%);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 10;
    flex: 1;
}

.nav-back {
    margin-bottom: 2rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: var(--accent-cyan);
}

.btn-back svg {
    width: 1.2rem;
    height: 1.2rem;
}

.legal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.header-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.title-area h1 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.75px;
    background: linear-gradient(135deg, #ffffff 30%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.last-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Lang switcher */
.lang-selector {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 9999px;
    padding: 0.25rem;
    display: flex;
    gap: 0.125rem;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn.active {
    color: var(--bg-dark);
    background: var(--text-primary);
}

/* Document content styling */
.lang-content {
    display: none;
}

.lang-content.active {
    display: block;
}

h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 2rem 0 1rem 0;
    letter-spacing: -0.25px;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

li {
    margin-bottom: 0.5rem;
}

strong {
    color: #ffffff;
}

.footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    z-index: 10;
    margin-top: auto;
}

@media (max-width: 640px) {
    .legal-card {
        padding: 1.5rem;
        border-radius: 18px;
    }
    .title-area h1 {
        font-size: 1.75rem;
    }
    .header-section {
        flex-direction: column;
        align-items: stretch;
    }
    .custom-lang-dropdown {
        display: flex;
        justify-content: center;
    }
}

/* Custom Language Dropdown (matches Mantine Menu) */
.custom-lang-dropdown {
    position: relative;
    display: inline-block;
    z-index: 100;
}

.custom-lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0 10px;
    height: 36px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.custom-lang-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.custom-lang-btn span:first-child {
    font-size: 0.95rem;
}

.custom-lang-btn span:nth-child(2) {
    line-height: 1;
}

.custom-lang-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #11141c;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 4px;
    display: none;
    flex-direction: column;
    width: 140px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.custom-lang-menu.show {
    display: flex;
}

.custom-lang-item {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    font-weight: 500;
    font-family: var(--font-body);
}

.custom-lang-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.custom-lang-item.active {
    font-weight: 600;
    color: var(--text-primary);
}

.custom-lang-item span {
    font-size: 0.95rem;
}

/* Scroll to top button styles */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.scroll-to-top-btn svg {
    display: block;
}
