.legal-page-title {
    background: #ffffff url("../images/title-bg.png") repeat-x bottom center;
    border-bottom: 1px solid #dfe5ed;
}

.legal-page-title .container > .row {
    display: block;
    padding: 0 15px;
}

.legal-page-title h1 {
    color: #181c23;
    font-family: "PF DinText Cond Pro", "Arial Narrow", sans-serif;
    font-size: clamp(34px, 4.2vw, 58px);
    font-weight: normal;
    letter-spacing: .01em;
    line-height: 1;
    margin: 24px 0 26px;
    text-align: center;
    text-transform: uppercase;
}

.legal-page {
    background: #f6f7f9;
    color: #1c2129;
    padding: 0 0 80px;
}

.legal-body {
    background: #ffffff;
    border-top: 1px solid #dfe5ed;
    padding: 0 42px 40px;
}

.legal-section {
    border-top: 1px solid #dfe5ed;
    padding: 44px 0;
}

.legal-section:first-child {
    border-top: 0;
    padding-top: 38px;
}

.legal-section [id] {
    scroll-margin-top: 20px;
}

.legal-section h2 {
    color: #007fbd;
    font-family: "PF DinText Cond Pro", "Arial Narrow", sans-serif;
    font-size: 28px;
    font-weight: normal;
    letter-spacing: .01em;
    line-height: 1.1;
    margin: 0 0 16px;
    text-transform: uppercase;
}

.legal-section h3 {
    color: #1c2129;
    font-family: "Stem", sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0 0 12px;
}

.legal-section p {
    color: #52616d;
    font-size: 16px;
    line-height: 1.65;
    margin: 0 0 16px;
}

.legal-card-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

#legal-documents {
    border-top: 5px solid #181c23;
    padding-top: 30px;
}

.legal-card {
    background: #ffffff;
    border: 1px solid #dfe5ed;
    border-left: 5px solid #007fbd;
    box-shadow: 0 2px 0 rgba(28, 33, 41, .05);
    min-height: 0;
    padding: 16px 20px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.legal-card:hover {
    border-left-color: #ff7449;
    box-shadow: 0 6px 16px rgba(28, 33, 41, .09);
    transform: translateY(-2px);
}

#legal-documents .legal-card h3 a {
    color: #007fbd;
    text-decoration: none;
}

#legal-documents .legal-card h3 a:hover,
#legal-documents .legal-card h3 a:focus {
    color: #ff7449;
    text-decoration: underline;
}

.legal-card p {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 0;
}

.legal-card a,
.legal-list a,
.legal-reference a {
    color: #007fbd;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: #9bc9df;
    text-underline-offset: 3px;
}

.legal-card a:hover,
.legal-list a:hover,
.legal-reference a:hover {
    color: #ff7449;
}

.legal-tag {
    color: #ff7449;
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.legal-list,
.legal-reference-list,
.legal-doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.legal-list li,
.legal-reference {
    border-bottom: 1px solid #dfe5ed;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px 0;
}

.legal-list li:first-child,
.legal-reference:first-child {
    border-top: 1px solid #dfe5ed;
}

.legal-list strong,
.legal-reference strong {
    color: #1c2129;
    display: block;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.legal-list small,
.legal-reference small {
    color: #7a8584;
    display: block;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
}

.legal-status {
    align-self: start;
    align-items: center;
    background: #e6f6ff;
    border-left: 3px solid #ff7449;
    box-sizing: border-box;
    color: #006ea4;
    display: inline-flex;
    font-size: 11px;
    font-weight: 500;
    height: 34px;
    justify-content: center;
    letter-spacing: .05em;
    padding: 0 8px;
    text-transform: uppercase;
    width: 124px;
}

.legal-certificate-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 24px 0 26px;
}

.legal-certificate {
    background: #f6f7f9;
    border: 1px solid #dfe5ed;
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0 8px 8px;
    transition: border-color .2s ease, transform .2s ease;
}

.legal-certificate:hover,
.legal-certificate:focus {
    border-color: #ff7449;
    transform: translateY(-2px);
}

.legal-certificate figcaption {
    color: #1c2129;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    min-height: 38px;
    padding: 12px 4px 8px;
}

.legal-certificate a {
    display: block;
}

.legal-certificate img {
    background: #ffffff;
    display: block;
    height: 190px;
    object-fit: contain;
    transition: transform .3s ease;
    width: 100%;
}

.legal-certificate:hover img,
.legal-certificate:focus img {
    transform: scale(1.02);
}

.legal-gallery-open {
    overflow: hidden;
}

.legal-gallery {
    align-items: center;
    background: rgba(24, 28, 35, .96);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 52px 76px 32px;
    position: fixed;
    z-index: 10000;
}

.legal-gallery.is-open {
    display: flex;
}

.legal-gallery__dialog {
    max-height: 100%;
    max-width: 980px;
    position: relative;
    width: 100%;
}

.legal-gallery__figure {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.legal-gallery__image {
    background: #ffffff;
    display: block;
    max-height: calc(100vh - 142px);
    max-width: 100%;
    object-fit: contain;
}

.legal-gallery__caption {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.4;
    padding-top: 12px;
    text-align: center;
}

.legal-gallery__counter {
    color: #b9c5cf;
    font-size: 13px;
    left: 50%;
    position: absolute;
    top: calc(100% + 34px);
    transform: translateX(-50%);
}

.legal-gallery__close,
.legal-gallery__nav {
    align-items: center;
    background: #ff7449;
    border: 0;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    position: absolute;
    transition: background-color .2s ease, color .2s ease;
}

.legal-gallery__close:hover,
.legal-gallery__close:focus,
.legal-gallery__nav:hover,
.legal-gallery__nav:focus {
    background: #ffffff;
    color: #181c23;
    outline: none;
}

.legal-gallery__close {
    border-radius: 50%;
    font-size: 26px;
    height: 40px;
    right: 0;
    top: -48px;
    width: 40px;
}

.legal-gallery__nav {
    border-radius: 50%;
    font-size: 42px;
    height: 54px;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
}

.legal-gallery__nav--prev {
    left: -68px;
}

.legal-gallery__nav--next {
    right: -68px;
}

.legal-columns {
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-columns ul {
    color: #52616d;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding-left: 20px;
}

.legal-columns li + li {
    margin-top: 8px;
}

.legal-details {
    background: #1c2129;
    border-top: 4px solid #ff7449;
    color: #ffffff;
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 28px;
}

.legal-details p {
    color: #ffffff;
    font-size: 14px;
    margin: 0;
}

.legal-details strong {
    color: #ff7449;
    display: block;
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .legal-body {
        padding-left: 28px;
        padding-right: 28px;
    }

    .legal-certificate-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .legal-page-title h1 {
        font-size: 38px;
    }

    .legal-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .legal-section {
        padding: 34px 0;
    }

    .legal-card-grid,
    .legal-columns,
    .legal-details,
    .legal-certificate-grid {
        grid-template-columns: 1fr;
    }

    .legal-list li,
    .legal-reference {
        grid-template-columns: 1fr;
    }

    .legal-status {
        justify-self: start;
    }

    .legal-gallery {
        padding: 56px 16px 36px;
    }

    .legal-gallery__image {
        max-height: calc(100vh - 170px);
    }

    .legal-gallery__nav {
        bottom: -54px;
        top: auto;
        transform: none;
    }

    .legal-gallery__nav--prev {
        left: calc(50% - 62px);
    }

    .legal-gallery__nav--next {
        right: calc(50% - 62px);
    }
}
