/* Legal surfaces are isolated from the portal's page/grid sizing. */
.portal-auth-page,
.portal-legal-page {
    scrollbar-width: none;
}
.portal-auth-page::-webkit-scrollbar,
.portal-legal-page::-webkit-scrollbar {
    display: none;
}
.portal-auth-legal-links {
    position: absolute;
    z-index: 2;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .65rem;
    font-size: .8rem;
    line-height: 1.5;
}
.portal-auth-legal-links a,
.portal-auth-legal-links span,
.portal-legal-reader-links a,
.portal-legal-reader-links span {
    color: #b9c1c9;
}
.portal-auth-legal-links a,
.portal-legal-reader-links a {
    text-decoration: none;
}
.portal-auth-legal-links a:hover,
.portal-auth-legal-links a:focus-visible,
.portal-legal-reader-links a:hover,
.portal-legal-reader-links a:focus-visible {
    color: #fff;
    text-decoration: underline;
}
.portal-auth-card--legal .portal-auth-panel {
    grid-column: 2 / -1;
    width: min(100%, 680px);
}
.portal-auth-card--legal .portal-auth-content {
    gap: .85rem;
}
.portal-legal-heading p {
    margin: 0;
    color: #b9c1c9;
    font-size: .8rem;
}
.portal-legal-heading h1,
.portal-legal-heading h2 {
    margin: .4rem 0;
}
.portal-legal-document {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #74808c rgba(255, 255, 255, .08);
    overscroll-behavior: contain;
    overflow-wrap: anywhere;
    line-height: 1.6;
    color: #e0e5e9;
    padding-right: .5rem;
}
.portal-auth-card--legal .portal-legal-document {
    max-height: clamp(10rem, 38dvh, 28rem);
}
.portal-legal-document::-webkit-scrollbar {
    width: 6px;
}
.portal-legal-document::-webkit-scrollbar-thumb {
    background: #74808c;
    border-radius: 3px;
}
.portal-legal-document::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .08);
}
.portal-legal-document h2 {
    font-size: 1.1rem;
    margin: 1.5rem 0 .65rem;
    color: #fff;
}
.portal-legal-document h3 {
    font-size: 1rem;
    margin: 1.1rem 0 .5rem;
    color: #fff;
}
.portal-legal-document h2:first-child {
    margin-top: 0;
}
.portal-legal-document p,
.portal-auth-panel .portal-legal-document p {
    font-size: .92rem;
    line-height: 1.6;
    color: #e0e5e9;
    margin: 0 0 .85rem;
}
.portal-legal-document:focus-visible {
    outline: 2px solid #b9c1c9;
    outline-offset: 4px;
}
.portal-legal-acknowledgment {
    display: flex;
    align-items: start;
    gap: .65rem;
    font-size: .92rem;
}
.portal-legal-acknowledgment input {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: .15rem;
    accent-color: #ed1b36;
}
.portal-legal-secondary-actions,
.portal-legal-reader-links {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.portal-legal-secondary-actions button {
    border: 0;
    background: transparent;
    color: #c7cdd3;
    font-size: .85rem;
    padding: .25rem 0;
    text-decoration: underline;
}
.portal-legal-shell {
    height: 100dvh;
    min-height: 0;
    padding: clamp(1rem, 4dvh, 3rem) clamp(1rem, 4vw, 3rem);
    overflow: hidden;
}
.portal-legal-reader {
    position: relative;
    z-index: 2;
    width: min(100%, 850px);
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    color: #fff;
}
.portal-legal-reader .portal-legal-document {
    flex: 1;
}
.portal-legal-home {
    color: #e0e5e9;
    font-weight: 600;
}
.portal-legal-reader-links {
    flex: 0 0 auto;
    font-size: .85rem;
}
@media (min-width: 861px) {
    .portal-auth-page .portal-auth-shell {
        /* Leave room for the legal footer on scaled desktop viewports. */
        padding-block: 3rem;
    }
}
@media (max-width: 860px) {
    .portal-auth-card--legal .portal-auth-panel {
        grid-column: auto;
    }
    .portal-auth-page .portal-auth-shell {
        padding-bottom: 3.5rem;
    }
}
