/* Цены и документы (Views/Legal), вариант «Центр документов» из drafts/legal-pages-variants.
   Каркас (шапка .topper, .eyebrow, шрифты, цвета --index-*) — из index.css, здесь только то, чего там нет */

:root {
    --legal-tonal: #ffe9f0;
    --legal-tonal-soft: #fff5f8;
    --legal-line: #f3dde6;
    --legal-line-strong: #f0b8cd;
    --legal-ink-accent: #c2185b;
    --legal-ok: #15803d;
    --legal-ok-bg: #e7f7ee;
    --legal-grad: linear-gradient(135deg, #ff4d8d 0%, #ff7aa2 55%, #ff9f6e 100%);
    --legal-shadow: 0 1px 2px rgba(30, 27, 46, 0.06), 0 10px 30px rgba(255, 77, 141, 0.1);
    --legal-shadow-strong: 0 2px 6px rgba(30, 27, 46, 0.08), 0 24px 60px rgba(255, 77, 141, 0.18);
}

html {
    scroll-padding-top: 16px;
}

/* ---------- Шапка ---------- */
.legal-hero {
    padding: 28px 0 104px;
    max-width: 52rem;
}

.legal-hero h1 {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.legal-lead {
    margin: 1rem 0 0;
    max-width: 40rem;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.94);
}

.legal-updated {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1rem 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

/* ---------- Каркас: меню слева, содержимое справа ---------- */
.legal-page {
    color: var(--index-text);
}

.legal-shell {
    position: relative;
    display: grid;
    gap: 16px;
    margin-top: -72px;
}

@media (min-width: 992px) {
    .legal-shell {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 32px;
        align-items: start;
    }
}

.legal-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

/* Меню документов (десктоп) */
.legal-hub {
    display: none;
    position: sticky;
    top: 20px;
    padding: 10px;
    border-radius: 24px;
    background: white;
    border: 1px solid var(--legal-line);
    box-shadow: var(--legal-shadow);
}

@media (min-width: 992px) {
    .legal-hub {
        display: grid;
        gap: 4px;
    }
}

.legal-hub a {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 2px 12px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    color: var(--index-text);
    text-decoration: none;
}

.legal-hub a:hover {
    background: var(--legal-tonal-soft);
}

.legal-hub a[aria-current="page"] {
    background: var(--legal-tonal);
}

.legal-hub-icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--legal-tonal-soft);
    color: var(--legal-ink-accent);
    font-size: 1.1rem;
}

.legal-hub a[aria-current="page"] .legal-hub-icon {
    background: var(--legal-grad);
    color: white;
}

.legal-hub b {
    font-weight: 800;
    line-height: 1.25;
}

.legal-hub small {
    color: var(--index-muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Чипы документов (планшет и телефон) */
.legal-chips {
    display: flex;
    gap: 8px;
    padding: 2px 2px 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.legal-chips::-webkit-scrollbar {
    display: none;
}

@media (min-width: 992px) {
    .legal-chips {
        display: none;
    }
}

.legal-chips a {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--legal-line);
    box-shadow: var(--legal-shadow);
    color: var(--index-text);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.legal-chips a i {
    color: var(--legal-ink-accent);
}

.legal-chips a[aria-current="page"] {
    background: var(--index-text);
    border-color: var(--index-text);
    color: white;
}

.legal-chips a[aria-current="page"] i {
    color: white;
}

/* ---------- Общие элементы ---------- */
.legal-card {
    padding: 20px;
    border-radius: 24px;
    background: white;
    border: 1px solid var(--legal-line);
    box-shadow: var(--legal-shadow);
}

@media (min-width: 768px) {
    .legal-card {
        padding: 24px 28px;
    }
}

.legal-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--legal-tonal);
    color: var(--legal-ink-accent);
}

.legal-icon-lg {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 1.25rem;
}

.legal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--legal-line);
    background: white;
    color: var(--index-text);
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.legal-btn:hover {
    background: var(--legal-tonal-soft);
    color: var(--index-text);
}

.legal-btn-block {
    width: 100%;
    min-height: 48px;
}

.legal-btn-main {
    border: 0;
    background: var(--legal-grad);
    color: white;
    box-shadow: 0 10px 24px rgba(255, 77, 141, 0.32);
}

.legal-btn-main:hover {
    background: var(--legal-grad);
    color: white;
    transform: translateY(-2px);
}

.legal-btn:focus-visible,
.legal-hub a:focus-visible,
.legal-chips a:focus-visible,
.legal-acc summary:focus-visible {
    outline: 3px solid var(--index-accent);
    outline-offset: 2px;
}

.legal-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    color: var(--index-muted);
    font-size: 0.95rem;
}

.legal-note i {
    margin-top: 2px;
    color: var(--legal-ok);
}

/* ---------- «Коротко» ---------- */
.legal-short h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.legal-short h2 i {
    color: #f5b83d;
}

.legal-short > ul {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .legal-short > ul {
        grid-template-columns: 1fr 1fr;
        gap: 14px 24px;
    }
}

.legal-short > ul > li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.legal-steps {
    display: grid;
    gap: 12px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: legal-step;
}

@media (min-width: 768px) {
    .legal-steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

.legal-steps li {
    counter-increment: legal-step;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--legal-line);
    background: var(--legal-tonal-soft);
}

.legal-steps li::before {
    content: counter(legal-step);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--legal-grad);
    color: white;
    font-weight: 800;
}

.legal-steps b {
    display: block;
    margin-bottom: 4px;
}

.legal-steps p {
    margin: 0;
    color: var(--index-muted);
    font-size: 0.95rem;
}

/* ---------- Разделы-аккордеоны ---------- */
.legal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.legal-bar h2,
.legal-subtitle {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.legal-acc {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.legal-acc details {
    border-radius: 20px;
    background: white;
    border: 1px solid var(--legal-line);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.legal-acc details[open] {
    border-color: var(--legal-line-strong);
    box-shadow: var(--legal-shadow);
}

.legal-acc summary {
    display: grid;
    grid-template-columns: 36px 1fr 24px;
    gap: 4px 14px;
    align-items: center;
    min-height: 64px;
    padding: 16px 18px;
    border-radius: 20px;
    cursor: pointer;
    list-style: none;
}

.legal-acc summary::-webkit-details-marker {
    display: none;
}

.legal-num {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--legal-tonal-soft);
    color: var(--legal-ink-accent);
    font-weight: 800;
}

.legal-acc details[open] .legal-num {
    background: var(--legal-grad);
    color: white;
}

.legal-acc summary b {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.legal-acc summary small {
    grid-column: 2;
    color: var(--index-muted);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
}

.legal-acc summary > .bi {
    grid-row: 1 / span 2;
    grid-column: 3;
    color: var(--index-muted);
    transition: transform 0.2s;
}

.legal-acc details[open] summary > .bi {
    transform: rotate(180deg);
}

.legal-prose {
    max-width: calc(70ch + 68px);
    padding: 0 18px 18px 68px;
}

@media (max-width: 575px) {
    .legal-prose {
        padding-left: 18px;
    }
}

.legal-prose p,
.legal-prose li {
    font-size: 1rem;
    line-height: 1.7;
}

.legal-prose p {
    margin: 0;
}

.legal-prose p + p,
.legal-prose p + ul,
.legal-prose ul + p {
    margin-top: 12px;
}

.legal-prose ul {
    margin: 12px 0 0;
    padding-left: 22px;
}

.legal-prose li + li {
    margin-top: 6px;
}

.legal-prose li::marker {
    color: var(--index-accent);
}

.legal-prose a {
    color: var(--legal-ink-accent);
    font-weight: 700;
}

.legal-tools {
    display: flex;
    justify-content: flex-end;
    padding: 0 12px 12px;
}

/* ---------- Вопросы ---------- */
.legal-ask {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    padding: 24px;
    border-radius: 24px;
    background: radial-gradient(60% 100% at 100% 0, rgba(255, 214, 160, 0.5), transparent 60%), var(--legal-grad);
    color: white;
}

@media (min-width: 768px) {
    .legal-ask {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

.legal-ask b {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.3rem;
}

.legal-ask p {
    margin: 0;
    font-weight: 600;
    opacity: 0.92;
}

/* ---------- Цены ---------- */
.legal-plans {
    display: grid;
    gap: 14px;
}

@media (min-width: 768px) {
    .legal-plans {
        grid-template-columns: repeat(3, 1fr);
    }
}

.legal-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
    border-radius: 24px;
    background: white;
    border: 1px solid var(--legal-line);
    box-shadow: var(--legal-shadow);
}

.legal-plan-best {
    border: 2px solid var(--index-accent);
    box-shadow: var(--legal-shadow-strong);
}

.legal-plan-best .legal-icon {
    background: var(--legal-grad);
    color: white;
}

.legal-flag {
    position: absolute;
    top: -12px;
    left: 20px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f5b83d;
    color: #3b2500;
    font-size: 0.8rem;
    font-weight: 800;
}

.legal-plan h2 {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.legal-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
}

.legal-price b {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(1.8rem, 3.4vw, 2.2rem);
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.legal-price s {
    color: var(--index-muted);
    font-weight: 700;
    white-space: nowrap;
}

.legal-price small {
    width: 100%;
    color: var(--index-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.legal-save {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--legal-ok-bg);
    color: var(--legal-ok);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.legal-plan p {
    margin: 0;
    color: var(--index-muted);
    font-size: 0.95rem;
}

.legal-plan ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.legal-plan li {
    display: flex;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
}

.legal-plan li i {
    color: var(--legal-ok);
}

.legal-plan .legal-btn {
    margin-top: auto;
}

.legal-subtitle {
    margin-top: 20px;
}

.legal-sublead {
    margin: 6px 0 14px;
    color: var(--index-muted);
}

.legal-tiles {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 576px) {
    .legal-tiles {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1200px) {
    .legal-tiles {
        grid-template-columns: repeat(3, 1fr);
    }
}

.legal-tile {
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 4px 14px;
    padding: 18px;
    border-radius: 20px;
    background: white;
    border: 1px solid var(--legal-line);
}

.legal-tile .legal-icon {
    grid-row: span 3;
}

.legal-tile b {
    line-height: 1.3;
}

.legal-tile small {
    color: var(--index-muted);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.legal-tile-price {
    margin-top: 4px;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.legal-tile-price span {
    display: block;
    font-family: "Manrope", sans-serif;
    color: var(--index-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    .legal-page *,
    .legal-page *::before {
        transition: none !important;
    }
}

@media print {
    .custom-footer,
    .floating-btn,
    .legal-hub,
    .legal-chips,
    .legal-bar button,
    .legal-tools,
    .legal-ask {
        display: none !important;
    }

    .legal-shell {
        margin-top: 0;
    }
}
