/* Точечные правки поверх общей темы сайта */
.auth-card-public {
    margin-left: auto;
    margin-right: auto;
    width: min(100%, 680px);
}

.auth-card-centered {
    display: grid;
    gap: 16px;
}

.auth-card-public .modal-submit,
.auth-card-public .shop-form {
    width: 100%;
}

.auth-secondary-actions {
    justify-content: center;
    text-align: center;
}

.resend-code-form {
    display: grid;
    gap: 6px;
    justify-items: center;
    margin: 4px 0 0;
}

.resend-code-button {
    min-height: 40px;
    padding: 0;
}

.resend-code-button:disabled {
    opacity: .58;
    cursor: not-allowed;
    text-decoration: none;
}

.key-text {
    display: block;
    width: 100%;
    min-height: 118px;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    user-select: none;
    cursor: default;
    -webkit-user-select: none;
}

.key-text::selection {
    background: transparent;
    color: inherit;
}

.key-text::-moz-selection {
    background: transparent;
    color: inherit;
}

.site-nav a,
.site-login-link {
    white-space: nowrap;
}

.site-footer-links {
    align-items: center;
    flex-wrap: wrap;
}

.footer-legal-links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.footer-legal-links a {
    color: var(--accent-strong);
    font-weight: 800;
}

.buy-modal {
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.buy-modal-dialog {
    margin: auto 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateZ(0);
    will-change: transform;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 167, 92, .95) rgba(255,255,255,.05);
}

.buy-modal-dialog::-webkit-scrollbar {
    width: 10px;
}

.buy-modal-dialog::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .04);
    border-radius: 999px;
}

.buy-modal-dialog::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffb46b 0%, #ff8f47 100%);
    border-radius: 999px;
    border: 2px solid rgba(26, 10, 4, .95);
}

.custom-select-menu {
    overscroll-behavior: contain;
    transform: translateZ(0);
    will-change: scroll-position;
}

.hero-with-mascot {
    min-height: 410px;
    padding: clamp(34px, 5.4vw, 58px);
    background-image:
        linear-gradient(90deg, rgba(10, 7, 5, .97) 0%, rgba(10, 7, 5, .91) 33%, rgba(10, 7, 5, .58) 51%, rgba(10, 7, 5, .08) 78%),
        url('/static/public/img/friendly-hero-banner.png');
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    border: 0;
    box-shadow: none;
}

.hero-with-mascot .hero-content {
    width: min(48%, 560px);
    max-width: 560px;
}

.hero-with-mascot h1 {
    max-width: 520px;
    margin-bottom: 18px;
    font-size: clamp(46px, 6.3vw, 74px);
    line-height: .96;
    text-shadow: 0 12px 34px rgba(0, 0, 0, .42);
}

.hero-with-mascot p {
    max-width: 500px;
    font-size: clamp(17px, 1.8vw, 20px);
    line-height: 1.55;
    color: rgba(255, 240, 229, .82);
    text-shadow: 0 8px 24px rgba(0, 0, 0, .42);
}

.hero-with-mascot .hero-actions {
    margin-top: 28px;
}

.legal-hero-page {
    margin-top: 10px;
    margin-bottom: 30px;
    padding: clamp(34px, 5vw, 58px);
    background: linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 249, 242, .78));
    box-shadow: 0 20px 70px rgba(80, 42, 16, .09);
}

.legal-hero-page h1 {
    max-width: 760px;
    font-size: clamp(38px, 5.4vw, 64px);
}

.legal-hero-page p {
    max-width: 760px;
    font-size: 18px;
}

.legal-hero-page .hero-actions {
    margin-top: 28px;
    gap: 14px;
}

.legal-document-layout {
    display: grid;
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 0;
}

.legal-document-layout .legal-toc {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 20px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .90);
    box-shadow: 0 18px 55px rgba(80, 42, 16, .08);
}

.legal-document-layout .legal-toc h2 {
    margin: 0 0 12px;
    color: var(--accent-strong);
    font-size: 17px;
}

.legal-document-layout .legal-toc ol {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.legal-document-layout .legal-toc a {
    display: block;
    padding: 7px 9px;
    border-radius: 10px;
    color: #5f4d40;
    font-size: 14px;
    line-height: 1.35;
    transition: background .16s ease, color .16s ease;
}

.legal-document-layout .legal-toc a:hover {
    background: rgba(223, 109, 43, .10);
    color: var(--accent-strong);
    text-decoration: none;
}

.legal-document-layout .legal-doc {
    min-width: 0;
    padding: clamp(24px, 3.8vw, 44px);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 20px 70px rgba(80, 42, 16, .08);
}

.legal-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.legal-notice {
    margin: 0 0 30px;
    padding: 18px 20px;
    border-color: rgba(223, 109, 43, .22);
    background: rgba(223, 109, 43, .08);
    color: #7c3a16;
}

.legal-document-layout .legal-doc section {
    scroll-margin-top: 24px;
}

.legal-document-layout .legal-doc section + section {
    margin-top: 34px;
    padding-top: 30px;
    border-top: 1px solid rgba(120, 62, 28, .14);
}

.legal-document-layout .legal-doc h2 {
    margin: 0 0 16px;
    color: var(--accent-strong);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.18;
}

.legal-document-layout .legal-doc p,
.legal-document-layout .legal-doc li {
    color: #6e5c4f;
    font-size: 16px;
    line-height: 1.78;
}

.legal-document-layout .legal-doc ul {
    display: grid;
    gap: 6px;
    margin: 12px 0 18px;
    padding-left: 22px;
}

.legal-document-layout .legal-doc a {
    color: var(--accent-strong);
    font-weight: 700;
}

.legal-return-actions {
    display: flex;
    justify-content: center;
    margin: 34px 0 18px;
}

.legal-doc-footer {
    max-width: 820px;
    margin: 0 auto 22px;
    color: #7a6b60;
    text-align: center;
}

@media (max-width: 1040px) {
    .hero-with-mascot {
        background-position: 62% center;
    }

    .hero-with-mascot .hero-content {
        width: min(54%, 560px);
    }
}

@media (max-width: 920px) {
    .site-header-nav {
        justify-content: center;
    }

    .hero-with-mascot {
        min-height: 390px;
        background-image:
            linear-gradient(90deg, rgba(10, 7, 5, .98) 0%, rgba(10, 7, 5, .92) 50%, rgba(10, 7, 5, .42) 100%),
            url('/static/public/img/friendly-hero-banner.png');
        background-position: 67% center;
    }

    .hero-with-mascot .hero-content {
        width: min(62%, 560px);
    }

    .legal-document-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .legal-document-layout .legal-toc {
        position: static;
        max-height: none;
    }

    .legal-document-layout .legal-toc ol {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 720px) {
    .auth-card-public {
        width: 100%;
    }

    .buy-modal {
        align-items: flex-end;
    }

    .site-nav {
        gap: 8px;
    }

    .hero-with-mascot {
        min-height: 470px;
        padding: 28px 22px;
        align-items: end;
        background-image:
            linear-gradient(180deg, rgba(10, 7, 5, .60) 0%, rgba(10, 7, 5, .82) 44%, rgba(10, 7, 5, .98) 100%),
            url('/static/public/img/friendly-hero-banner.png');
        background-size: cover;
        background-position: 64% center;
    }

    .hero-with-mascot .hero-content {
        width: 100%;
        max-width: none;
        padding-top: 150px;
    }

    .hero-with-mascot h1 {
        font-size: clamp(40px, 13vw, 58px);
    }

    .hero-with-mascot p {
        max-width: none;
        font-size: 16px;
    }

    .legal-hero-page {
        margin-bottom: 18px;
        padding: 28px 20px;
    }

    .legal-hero-page .hero-actions,
    .legal-return-actions {
        justify-content: stretch;
    }

    .legal-hero-page .button-link,
    .legal-return-actions .button-link {
        width: 100%;
    }

    .legal-document-layout .legal-doc,
    .legal-document-layout .legal-toc {
        border-radius: 18px;
    }

    .legal-document-layout .legal-doc p,
    .legal-document-layout .legal-doc li {
        font-size: 15px;
    }
}
