.logo {
    height: 128px !important;
    margin: 0 auto !important;
    padding-top: 14px !important;
    background-color: #fbfafc !important;
    position: relative;
    z-index: 1;
}

/* Balanced co-brand lockup for the landing page. */
.logo .img {
    /* Both wordmarks share the same height (their SVGs use the same line grid). */
    width: calc(100% - 40px) !important;
    max-width: 700px;
    margin: 0 auto;
    background-image:
        url("/img/sgda-logo.svg"),
        linear-gradient(#cbd0d5, #cbd0d5),
        url("/img/gdi-logo.svg") !important;
    background-position:
        calc(50% - 150px) center,
        calc(50% + 21px) center,
        calc(50% + 172px) center !important;
    background-size:
        auto 88px,
        2px 76px,
        auto 88px !important;
}

@media (min-width: 577px) and (max-width: 760px) {
    .logo .img {
        background-position:
            calc(50% - 136px) center,
            calc(50% + 20px) center,
            calc(50% + 156px) center !important;
        background-size:
            auto 80px,
            2px 70px,
            auto 80px !important;
    }
}

/* Keep both marks identifiable in the compact navigation slot. */
.logo-menu .img {
    background-image:
        url("/img/sgda-symbol.png"),
        linear-gradient(#cbd0d5, #cbd0d5),
        url("/img/gdi-symbol.svg") !important;
    background-position:
        calc(50% - 24px) center,
        center,
        calc(50% + 24px) center !important;
    background-size:
        34px auto,
        1px 26px,
        34px auto !important;
}

main.page-home {
    min-height: calc(100vh - 240px);
    padding: 6px 20px 28px;
    position: relative;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 0, rgba(114, 118, 177, 0.12), transparent 420px),
        #fbfafc;
}

.page-home > div > .row.justify-content-center > .col-md-6.row {
    flex: 0 1 720px;
    max-width: 720px;
    margin-right: 0;
    margin-left: 0;
    justify-content: center;
}

.sga-login-hero {
    width: 100%;
    padding: 24px 44px 22px;
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(123, 28, 88, 0.14);
    border-radius: 22px;
    box-shadow:
        0 18px 45px rgba(55, 42, 73, 0.09),
        0 2px 8px rgba(55, 42, 73, 0.04);
}

.sga-kicker {
    display: inline-flex;
    margin: 0 0 10px;
    padding: 6px 12px;
    color: #7b1c58;
    background: rgba(123, 28, 88, 0.08);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    line-height: 1;
    text-transform: uppercase;
}

.sga-login-hero h1 {
    margin: 0 0 10px;
    color: #2d2630;
    font-size: clamp(1.8rem, 3.4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.12;
}

.sga-description {
    max-width: 590px;
    margin: 0 auto;
    color: #58636d;
    font-size: 1.02rem;
    line-height: 1.55;
}

.sga-description a {
    color: #006b8e;
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.sga-description a::after {
    content: " \2197";
    font-size: 0.85em;
}

.sga-login-prompt {
    width: 100%;
    margin: 14px 0 0;
    color: #64727e;
    text-align: center;
}

.page-home .login-component {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 8px !important;
}

/* Login uses the official LS Login (Life Science AAI) button artwork. */
.login-btn {
    display: inline-block;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    border-radius: 10px;
    box-shadow: none;
    max-height: initial !important;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.login-btn .ls-login-img {
    display: block;
    width: 230px;
    max-width: 100%;
    height: auto;
}

/* Text login button (NN instance, Keycloak sign-in). */
.login-btn .sga-login-text {
    display: inline-flex;
    align-items: center;
    min-width: 150px;
    justify-content: center;
    padding: 12px 28px;
    color: #ffffff;
    background: linear-gradient(135deg, #006b8e, #005574);
    border-radius: 999px;
    font-weight: 700;
}

.login-btn .sga-login-text::after {
    content: "\2192";
    margin-left: 10px;
}

.login-btn:hover .sga-login-text,
.login-btn:focus .sga-login-text {
    background: linear-gradient(135deg, #830051, #681044);
}

.login-btn:hover,
.login-btn:focus {
    background: none !important;
    box-shadow: 0 8px 20px rgba(0, 157, 220, 0.25);
    transform: translateY(-1px);
}

.login-btn:focus-visible {
    outline: 3px solid #006b8e;
    outline-offset: 3px;
}

/* Links to the European portal, national portal and secure processing environment.
   Full-width rows: long host names never have to fit a narrow column. */
.sga-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.sga-links li {
    display: flex;
    min-width: 0;
    margin: 0;
}

.sga-links a {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 20px;
    align-items: center;
    padding: 8px 18px;
    color: inherit;
    background: #f6f8fb;
    border: 1px solid #e1e6ec;
    border-radius: 14px;
    text-decoration: none !important;
    transition: border-color 160ms ease, background 160ms ease;
}

.sga-links a:hover,
.sga-links a:focus {
    background: #eef5f8;
    border-color: #006b8e;
}

.sga-link-label {
    grid-column: 1;
    grid-row: 1;
    color: #64727e;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sga-link-url {
    grid-column: 1;
    grid-row: 2;
    color: #006b8e;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sga-link-url::after {
    content: " \2197";
    font-size: 0.85em;
}

.sga-link-hint {
    grid-column: 2;
    grid-row: 1 / span 2;
    color: #58636d;
    font-size: 0.92rem;
    line-height: 1.4;
}

.sga-consortium {
    max-width: 590px;
    margin: 14px auto 0;
    color: #64727e;
    font-size: 0.88rem;
    line-height: 1.55;
}

@media (max-width: 576px) {
    .logo {
        height: 130px !important;
        padding-top: 14px !important;
    }

    .logo .img {
        background-position:
            calc(50% - 77px) center,
            calc(50% + 12px) center,
            calc(50% + 89px) center !important;
        background-size:
            auto 46px,
            1px 42px,
            auto 46px !important;
    }

    main.page-home {
        padding: 8px 14px 42px;
    }

    .sga-links a {
        grid-template-columns: 1fr;
    }

    .sga-link-hint {
        grid-column: 1;
        grid-row: 3;
        margin-top: 2px;
    }

    main.page-home > div {
        width: 100%;
        min-width: 0 !important;
    }

    .page-home > div > .row.justify-content-center {
        margin-right: 0;
        margin-left: 0;
    }

    .page-home > div > .row.justify-content-center > .col-md-6.row {
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
        flex-basis: 100%;
    }

    .sga-login-hero {
        padding: 28px 20px 26px;
        border-radius: 18px;
    }

    .sga-login-hero h1 {
        font-size: 1.9rem;
    }

    .sga-description {
        font-size: 1rem;
    }
}

.table thead th {
    background-color: #830051 !important;
}
