:root {
    --red-mango: #c91f2c;
    --red-mango-dark: #a91823;

    --background: #f7f7f8;
    --surface: #ffffff;
    --text: #191919;
    --text-muted: #6b6b70;
    --border: #e8e8eb;

    --content-width: 920px;
    --radius: 20px;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    color: var(--text);
    background: var(--background);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.legal-page {
    width: min(calc(100% - 32px), var(--content-width));
    margin: 0 auto;
    padding: 28px 0 36px;
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border-radius: 50%;
    background: var(--red-mango);
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-name {
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 4px;

    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.language-button {
    min-height: 38px;
    padding: 7px 14px;

    border: 0;
    border-radius: 9px;
    background: transparent;

    color: var(--text-muted);

    font-size: 14px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background-color 140ms ease,
        color 140ms ease;
}

.language-button:hover {
    color: var(--text);
}

.language-button.is-active {
    background: var(--red-mango);
    color: #ffffff;
}

.language-button:focus-visible {
    outline: 3px solid rgba(201, 31, 44, 0.2);
    outline-offset: 2px;
}

.legal-card {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.02),
        0 10px 32px rgba(0, 0, 0, 0.035);
}

.legal-title-block {
    padding: 42px 48px 34px;
    border-bottom: 1px solid var(--border);
}

.legal-label {
    margin: 0 0 8px;

    color: var(--red-mango);

    font-size: 13px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

html[dir="rtl"] .legal-label {
    letter-spacing: 0;
    text-transform: none;
}

.legal-title {
    margin: 0;

    color: var(--text);

    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 780;
    letter-spacing: -0.035em;
}

html[dir="rtl"] .legal-title {
    letter-spacing: 0;
}

.legal-status {
    padding: 48px;

    color: var(--text-muted);

    font-size: 15px;
    line-height: 1.7;
}

.legal-content {
    padding: 42px 48px 52px;

    color: #303034;

    font-size: 16px;
    line-height: 1.9;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

html[dir="rtl"] .legal-content {
    font-family:
        Tahoma,
        Arial,
        "Segoe UI",
        sans-serif;

    line-height: 2;
}

.legal-error {
    margin: 0;
    padding: 48px;

    color: #a91823;

    font-size: 15px;
    line-height: 1.7;
}

.legal-footer {
    display: flex;
    justify-content: center;

    padding: 24px 16px 0;

    color: var(--text-muted);

    font-size: 13px;
}

html[dir="rtl"] .legal-header,
html[dir="rtl"] .brand {
    direction: rtl;
}

html[dir="rtl"] .legal-title-block,
html[dir="rtl"] .legal-content,
html[dir="rtl"] .legal-status {
    text-align: right;
}

html[dir="ltr"] .legal-title-block,
html[dir="ltr"] .legal-content,
html[dir="ltr"] .legal-status {
    text-align: left;
}

@media (max-width: 640px) {
    .legal-page {
        width: min(calc(100% - 20px), var(--content-width));
        padding-top: 18px;
    }

    .legal-header {
        align-items: center;
        gap: 12px;
        margin-bottom: 18px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .brand-name {
        font-size: 18px;
    }

    .language-button {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .legal-card {
        border-radius: 16px;
    }

    .legal-title-block {
        padding: 30px 24px 26px;
    }

    .legal-title {
        font-size: 30px;
    }

    .legal-status {
        padding: 32px 24px;
    }

    .legal-content {
        padding: 30px 24px 38px;
        font-size: 15.5px;
        line-height: 1.85;
    }
}

@media (max-width: 420px) {
    .legal-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .language-switcher {
        width: 100%;
    }

    .language-button {
        flex: 1;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .legal-page {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .legal-header,
    .legal-footer {
        display: none;
    }

    .legal-card {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .legal-title-block {
        padding: 0 0 24px;
    }

    .legal-content {
        padding: 28px 0 0;
    }
}