:root {
    color-scheme: dark;
    --bg: #080808;
    --bg-soft: #121212;
    --card: rgba(24, 24, 24, 0.94);
    --card-strong: rgba(33, 33, 33, 0.98);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 68, 68, 0.22);
    --text: #ececec;
    --muted: #a5a5a5;
    --accent: #ff3b3f;
    --accent-soft: rgba(255, 59, 63, 0.14);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    background:
        radial-gradient(circle at top, rgba(255, 59, 63, 0.12), transparent 35%),
        linear-gradient(180deg, #0a0a0a 0%, #070707 100%);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.7;
}

a {
    color: #ff8b8d;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.terms-page {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.back-link:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 59, 63, 0.3);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.back-arrow {
    color: var(--accent);
}

.lang-picker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: var(--shadow);
    color: var(--muted);
    font-weight: 600;
}

#legal-lang {
    min-width: 180px;
    background: #121212;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 9px 12px;
    font: inherit;
    outline: none;
    cursor: pointer;
}

#legal-lang:focus {
    border-color: rgba(255, 59, 63, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 59, 63, 0.15);
}

.card {
    background: linear-gradient(180deg, var(--card) 0%, rgba(17, 17, 17, 0.97) 100%);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 32px;
    border-color: var(--border-strong);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: auto -20% -60% auto;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(255, 59, 63, 0.2), transparent 68%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    color: #ffd5d5;
    background: rgba(255, 59, 63, 0.12);
    border: 1px solid rgba(255, 59, 63, 0.25);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.hero h1 {
    margin: 16px 0 10px;
    font-size: clamp(2.15rem, 4vw, 3.45rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-subtitle {
    margin: 0;
    max-width: 760px;
    font-size: 1.08rem;
    color: var(--muted);
}

.hero-meta {
    margin: 14px 0 0;
    color: #c9c9c9;
    font-size: 0.95rem;
}

.hero-pills {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    margin: 24px 0 0;
}

.pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 59, 63, 0.22);
    color: #ffdede;
    font-weight: 700;
}

.sections-grid {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.section-card {
    padding: 24px 26px;
}

.section-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 6px 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d0d0d0;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.section-card h2,
.privacy-card h2 {
    margin: 0 0 12px;
    font-size: 1.28rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.section-body {
    color: #d0d0d0;
}

.section-body p {
    margin: 0;
}

.section-body ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.section-body li {
    margin: 8px 0;
}

.privacy-card {
    margin-top: 20px;
    padding: 24px 26px;
    border-color: rgba(255, 255, 255, 0.12);
}

.privacy-card p {
    margin: 0 0 14px;
    color: #d0d0d0;
}

.privacy-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ff4b50 0%, #e11f39 100%);
    color: white;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(225, 31, 57, 0.25);
    transition: transform 0.18s ease, filter 0.18s ease;
}

.privacy-link:hover {
    text-decoration: none;
    transform: translateY(-1px);
    filter: brightness(1.05);
}

html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .topbar {
    flex-direction: row-reverse;
}

html[dir="rtl"] .section-body ul {
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] .back-link {
    flex-direction: row-reverse;
}

@media (max-width: 720px) {
    .terms-page {
        width: min(100% - 20px, 1040px);
        padding-top: 14px;
    }

    .hero,
    .section-card,
    .privacy-card {
        padding-left: 18px;
        padding-right: 18px;
        border-radius: 22px;
    }

    .lang-picker {
        width: 100%;
        justify-content: space-between;
    }

    #legal-lang {
        min-width: 0;
        width: min(100%, 220px);
    }
}
