body.customlogin {
    background: linear-gradient(180deg, #f6f9fc 0%, #edf3f8 100%);
    /* override the base theme body rules (style.css: min-width:640px;
       position:fixed; overflow:hidden; width/height:100%) that prevent these
       auth pages from scrolling / shrinking on small screens: restore normal
       document flow so the page scrolls and the layout can go below 640px */
    position: static;
    overflow: visible;
    width: auto;
    height: auto;
    min-width: 0;
}

#customlogin_container {
    grid-template-columns: 100%;
    /* override style.css (height:100%; grid-template-rows:100%) so the single
       row can grow past the viewport: min-height keeps it full-height when the
       form is short, height:auto + rows:auto let it grow (and the page scroll)
       when the form is taller than the screen, instead of clipping the top */
    grid-template-rows: auto;
    height: auto;
    min-height: 100vh;
    padding: 2px 4px 8px;
    box-sizing: border-box;
}

#customlogin_right_box {
    grid-column: 1 / span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
}

div.customlogin-right-content {
    width: min(50%, 720px);
    min-width: 320px;
    background-color: #ffffff;
    border: 2px solid #b8c6d6;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(16, 39, 68, 0.10), 0 10px 26px rgba(16, 39, 68, 0.18);
    padding: 20px 22px 16px;
    text-align: left;
    box-sizing: border-box;
}

.vsid-brand {
    margin: 0 -22px 20px;
    padding: 0 22px 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e9f1;
}

.vsid-brand-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
}

.vsid-brand-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 42px;
}

.vsid-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
    margin: 0;
}

.vsid-brand p {
    margin: 0;
    color: #5d6f86;
    font-size: 15px;
    line-height: 1;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
}

div.customlogin-right-content .vsid-brand p {
    margin-top: 0;
    margin-bottom: 0;
}

.vsid-brand h2 {
    margin: 0;
    color: #047efc;
    font-size: 26px;
    line-height: 1;
    font-weight: 400;
    display: flex;
    align-items: center;
}

div.customlogin-right-content h1 {
    margin: 0 0 18px;
    text-align: center;
    color: #1f3553;
    font-size: 30px;
    text-transform: none;
}

div.customlogin-right-content > p {
    margin: 0 0 18px;
    text-align: center;
    color: #5d6f86;
}

.vsid-inline-msg {
    margin: 0 0 18px;
    text-align: center;
    color: #5d6f86;
}

.vsid-inline-msg.vsid-inline-error {
    color: #b00020;
    font-weight: 600;
}

.vsid-inline-actions {
    max-width: 360px;
    margin: 48px auto 8px;
}

.vsid-inline-actions .vsid-disconnect-btn {
    display: block;
    width: 100%;
    margin: 0;
    text-align: center;
}

/* optional "back" button, shown only when back_url/back_caption are in the URL */
.vsid-back-btn {
    display: block;
    width: 100%;
    margin: 10px 0 0;
    text-align: center;
    background-color: #FFFFFF;
    border: 1px solid #5C6165;
    color: #5C6165;
}

#customlogin_right_box form.loginform,
#customlogin_right_box form.recoveryform {
    width: 100%;
    margin: 24px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-sizing: border-box;
}

#customlogin_right_box form.loginform div.buttonbar,
#customlogin_right_box form.recoveryform div.buttonbar {
    max-width: 360px;
    margin: 0 auto;
}

div.customlogin-right-content > p.vsid-login-recovery-link {
    max-width: 360px;
    margin: 18px auto 16px;
    text-align: right;
    font-size: 14px;
    line-height: 1.2;
}

div.customlogin-right-content > p.vsid-login-recovery-link a {
    color: #2a5f98;
    text-decoration: none;
    font-weight: normal;
    font-family: LFT;
    letter-spacing: 0.3px;
}

.vsid-login-recovery-link a:hover {
    text-decoration: underline;
}

.customlogin-multifactor #customlogin_right_box form.loginform div.buttonbar,
.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.customlogin-multifactor #customlogin_right_box form.loginform div.buttonbar a.btn,
.customlogin-multifactor #customlogin_right_box form.loginform div.buttonbar button.btn,
.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar a.btn,
.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar button.btn,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar a.btn,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar button.btn,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar input.btn,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar a.btn,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar button.btn,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar input.btn,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar a.btn,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar button.btn,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar input.btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin: 0;
    text-align: center;
}

#customlogin_right_box form.loginform div.buttonbar a.btn.btn-submit,
#customlogin_right_box form.recoveryform div.buttonbar a.btn.btn-submit {
    display: block;
    width: 100%;
    margin: 0;
}

#tsid-login-button {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

#tsid-login-button a.btn.btn-tsid {
    display: block;
    width: 100%;
    padding: 0;
}

.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar a.btn.btn-submit,
.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar a.btn.btn-cancel,
.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar button.btn.btn-submit,
.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar button.btn.btn-cancel,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar a.btn.btn-submit,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar a.btn.btn-cancel,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar button.btn.btn-submit,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar button.btn.btn-cancel,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar input.btn.btn-submit,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar input.btn.btn-cancel,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar a.btn.btn-submit,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar a.btn.btn-cancel,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar button.btn.btn-submit,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar button.btn.btn-cancel,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar input.btn.btn-submit,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar input.btn.btn-cancel,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar a.btn.btn-submit,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar a.btn.btn-cancel,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar button.btn.btn-submit,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar button.btn.btn-cancel,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar input.btn.btn-submit,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar input.btn.btn-cancel {
    display: block;
    width: auto;
    flex: 1 1 0;
    margin: 0;
}

.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar > a,
.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar > button,
.customlogin-setpassword #customlogin_right_box form.loginform div.buttonbar > input,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar > a,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar > button,
.customlogin-setpassword #customlogin_right_box form.recoveryform div.buttonbar > input,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar > a,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar > button,
.customlogin-account #customlogin_right_box form.loginform div.buttonbar > input,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar > a,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar > button,
.customlogin-account #customlogin_right_box form.recoveryform div.buttonbar > input {
    flex: 1 1 0 !important;
    min-width: 0;
    width: 100% !important;
    margin: 0 !important;
}

#customlogin_right_box .customlogin-msg {
    position: static;
    width: min(50%, 720px);
    margin: 0 auto 12px;
    box-sizing: border-box;
    border-radius: 0;
}

#customlogin_right_box .customlogin-msg p {
    text-align: center;
}

p.langselect {
    margin-top: 20px;
    text-align: center;
}

.vsid-login-footer p.langselect {
    margin: 0;
    padding: 0;
    text-align: left;
}

div.customlogin-right-content .vsid-login-footer p.langselect {
    margin-top: 0;
}

.vsid-login-footer {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #e2e9f1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    color: #6e7f94;
    font-size: 13px;
    line-height: 1.5;
    gap: 20px;
}

.vsid-footer-lang {
    margin: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
    grid-column: 1;
    justify-self: start;
}

.vsid-login-footer-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    grid-column: 2;
    justify-self: center;
}

.vsid-footer-spacer {
    display: none;
    grid-column: 3;
}

.vsid-footer-privacy {
    grid-column: 3;
    justify-self: end;
    color: #2a5f98;
    text-decoration: none;
    white-space: nowrap;
}

.vsid-login-footer a {
    color: #2a5f98;
    text-decoration: none;
}

.vsid-login-footer a:hover {
    text-decoration: underline;
}

.vsid-footer-privacy:hover {
    text-decoration: underline;
}

#rmbmewrap {
    display: none !important;
}

#__rmbme_box__ {
    display: none !important;
}

@media (max-width: 900px) {
    #customlogin_container {
        padding: 0 2px 4px;
    }

    div.customlogin-right-content {
        width: min(100%, 560px);
        min-width: 0;
        padding: 16px 10px 12px;
    }

    #customlogin_right_box .customlogin-msg {
        width: min(100%, 560px);
    }

    div.customlogin-right-content h1 {
        font-size: 24px;
    }

    .vsid-brand {
        margin: 0 -10px 18px;
        padding: 0 10px 8px;
    }

    .vsid-brand-inner {
        align-items: center;
    }

    .vsid-brand p {
        min-height: 0;
    }
}
