/* Legal pages, requisites, consent checkboxes and the cookie banner */

/* ---- document pages ---- */
.legal-page {
    padding-bottom: 50px;
    color: var(--chernyy);
}

.legal-page__card {
    padding: 20px 15px;
    background: var(--belyy);
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.07);
    font-weight: 500;
    font-size: 15px;
    line-height: 150%;
}

.legal-page__card h2 {
    margin: 25px 0 10px;
    font-weight: 600;
    font-size: 18px;
    line-height: 130%;
}

.legal-page__card h2:first-child {
    margin-top: 0;
}

.legal-page__card p {
    margin: 0 0 10px;
}

.legal-page__card ul,
.legal-page__card ol {
    margin: 0 0 10px;
    padding-left: 22px;
}

.legal-page__card a {
    color: var(--firmennyy);
    text-decoration: underline;
}

.legal-note {
    margin: 0 0 20px;
    padding: 12px 15px;
    background: #fff4d6;
    border-left: 4px solid #e0a800;
    font-weight: 500;
    font-size: 15px;
    line-height: 140%;
}

/* ---- requisites ---- */
.requisites {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.requisites__row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 15px;
}

.requisites__label {
    min-width: 220px;
    color: var(--seryy);
}

.requisites__value {
    font-weight: 600;
}

.footer__requisites {
    display: block;
    margin-top: 8px;
    font-weight: 500;
    font-size: 13px;
    line-height: 140%;
    color: var(--seryy);
}

.footer__cookie-settings {
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ---- consent checkbox (reviews, certificate) ---- */
.legal-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
    color: var(--chernyy);
    cursor: pointer;
}

.legal-consent__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.legal-consent__box {
    position: relative;
    display: block;
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border: 1.5px solid var(--chernyy);
    border-radius: 4px;
    background: var(--belyy);
}

.legal-consent__input:checked + .legal-consent__box {
    background: var(--chernyy);
}

.legal-consent__input:checked + .legal-consent__box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--belyy);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.legal-consent__input:focus-visible + .legal-consent__box {
    outline: 2px solid var(--firmennyy);
    outline-offset: 2px;
}

.legal-consent__text a {
    color: var(--firmennyy);
    text-decoration: underline;
}

button[disabled].certificate__accept-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- cookie banner ---- */
.cookie-banner {
    position: fixed;
    left: 15px;
    right: 15px;
    bottom: calc(74px + 15px + env(safe-area-inset-bottom, 0px));
    z-index: 320;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: var(--belyy);
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.18);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner__text {
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
    color: var(--chernyy);
}

.cookie-banner__text a {
    color: var(--firmennyy);
    text-decoration: underline;
}

.cookie-banner__buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cookie-banner__btn {
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    font: 600 15px/140% var(--font-family);
    cursor: pointer;
}

.cookie-banner__btn--accept {
    background: var(--chernyy);
    color: var(--belyy);
}

.cookie-banner__btn--necessary {
    background: var(--svetlo-seryy);
    color: var(--chernyy);
}

.cookie-banner__btn--settings {
    background: none;
    color: var(--chernyy);
    text-decoration: underline;
}

.cookie-banner__btn[hidden] {
    display: none;
}

/* ---- cookie settings: categories ---- */
.cookie-banner__settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
}

.cookie-banner__settings[hidden] {
    display: none;
}

.cookie-banner__category {
    padding: 12px;
    border: 1.5px solid var(--temno-belyy);
}

.cookie-banner__category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
}

.cookie-banner__category-title {
    font: 600 15px/140% var(--font-family);
    color: var(--chernyy);
}

.cookie-banner__always {
    font: 500 13px/140% var(--font-family);
    color: var(--seryy);
}

.cookie-banner__category-text {
    margin: 6px 0 0;
    font: 400 13px/140% var(--font-family);
    color: var(--seryy);
}

/* switch: a plain checkbox drawn as a toggle */
.cookie-banner__switch {
    flex: none;
    position: relative;
    width: 44px;
    height: 24px;
    margin: 0;
    border-radius: 12px;
    background: var(--temno-belyy);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-banner__switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--belyy);
    transition: transform 0.2s;
}

.cookie-banner__switch:checked {
    background: var(--firmennyy);
}

.cookie-banner__switch:checked::after {
    transform: translateX(20px);
}

.cookie-banner__switch:focus-visible {
    outline: 2px solid var(--chernyy);
    outline-offset: 2px;
}

.cookie-banner__policy {
    font: 500 13px/140% var(--font-family);
    color: var(--firmennyy);
    text-decoration: underline;
}

/* ---- cookie policy page: table of cookies ---- */
.cookie-table {
    width: 100%;
    margin: 10px 0 20px;
    border-collapse: collapse;
    font-size: 14px;
}

.cookie-table th,
.cookie-table td {
    padding: 8px 10px;
    border: 1px solid var(--temno-belyy);
    text-align: left;
    vertical-align: top;
}

.cookie-table code {
    word-break: break-all;
}

@media (min-width: 768px) {
    .legal-page__card {
        padding: 30px 25px;
        font-size: 16px;
    }

    .legal-page__card h2 {
        font-size: 20px;
    }

    .cookie-banner {
        left: 20px;
        right: auto;
        bottom: 20px;
        width: 520px;
        max-width: calc(100vw - 40px);
    }

    .cookie-banner__buttons {
        flex-direction: row;
    }

    .cookie-banner__btn {
        flex: 1;
    }
}

@media (min-width: 1200px) {
    .legal-page__card {
        padding: 40px;
    }
}

.footer__requisites a {
    color: inherit;
    text-decoration: underline;
}
