/* The cabinet's sidebar clips a viewport-sized container. Public forms must grow
   when errors, the keyboard or larger text need more room. */
body.login #st-container {
    display: flow-root;
    height: auto;
    min-height: 100%;
    overflow: visible;
}

.login .content.auth-content {
    width: 384px;
    max-width: calc(100% - 24px);
}

.login .content.auth-content--split {
    width: 780px;
}

.auth-form-layout {
    display: flex;
    gap: 30px;
}

.auth-form-main {
    flex: 1;
    min-width: 0;
}

.auth-registration-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px 30px;
}

.auth-registration-form .auth-form-main,
.auth-registration-form > .form-actions {
    grid-column: 1;
}

.login .auth-registration-form > .external-auth-section {
    grid-column: 2;
    grid-row: 1 / 3;
}

.login .content:not(.auth-content--split) .auth-registration-form {
    display: block;
}

.login .auth-form-layout > .external-auth-section {
    flex: 0 0 300px;
    margin: -20px -30px -15px 0;
    padding: 30px 24px;
    border: 0;
    background: #f4f6f7;
}

.login .auth-form-main .form-actions,
.login .auth-registration-form > .form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.login .auth-form-main .create-account {
    margin-top: 20px;
}

/* Keep the iframe alive while hidden: token-expired must still restore the form. */
.login .auth-captcha-complete {
    display: none;
}

@media (max-width: 767px) {
    body.login #st-container {
        display: flex;
        flex-direction: column;
        padding-bottom: 4px;
    }

    .login #st-container > [ui-view] {
        display: flex;
        flex-direction: column;
    }

    .login .logo {
        margin: 12px auto;
        padding: 0;
    }

    .login .logo img {
        max-height: 54px;
        max-width: calc(100vw - 32px);
        width: auto;
        height: auto;
        margin: 0 !important;
        object-fit: contain;
    }

    .login .content.auth-content {
        width: calc(100% - 24px);
        max-width: 480px;
        padding: 16px 18px;
    }

    .auth-form-layout,
    .auth-registration-form {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .login .auth-form-main .form-title {
        font-size: 22px;
        margin: 0 0 16px;
    }

    .login .auth-form-main .form-group {
        margin-bottom: 12px;
    }

    .login .auth-form-layout > .external-auth-section {
        flex: none;
        width: 100%;
        margin: 0;
        padding: 0;
        background: transparent;
    }

    .auth-form-layout .external-auth-title {
        text-align: center;
        margin-bottom: 8px;
    }

    .auth-external-buttons {
        display: flex;
        justify-content: center;
        gap: 12px;
    }

    .auth-form-layout .external-auth-button {
        flex: 0 0 50px;
        width: 50px;
        height: 50px;
        min-height: 50px;
        justify-content: center;
        padding: 6px;
        margin: 0;
    }

    .auth-form-layout .external-auth-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .auth-form-layout .external-auth-button__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .auth-form-layout .external-auth-button__arrow {
        display: none;
    }

    .login .copyright {
        display: none;
    }

    .login .auth-form-layout .external-auth-section {
        order: 1;
    }

    .login .auth-registration-form > .form-actions {
        order: 2;
    }
}
