/*
 * Sign-in V3
 * Loaded instead of signIn.css when tenders.login.common.version = 3, so this file stands alone.
 * There is no page background image: the sign-in form sits on plain white and the carousel on a
 * light blue card.
 */

/* ------------------------------------------------------------------ Page frame */

html, body {
    margin-bottom: 0;
}

body {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    background-image: unset !important;
}

div.content {
    /* Column wrapper for the row below, which grows into any spare viewport height. */
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

body.ct-layout-v3 div.content {
    padding-bottom: 0;
}

#mainContentContainer {
    margin: 0;
    /* Fill the space between header and footer so the carousel card grows on taller screens. */
    flex: 1 0 auto;
}

.btn:disabled {
    pointer-events: auto;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------ Sign-in form */

#signInColumn {
    display: flex;
    flex-direction: column;
    /* Centred in its half of the row, so the space either side of the form is equal. */
    align-items: center;
    /* Safe to centre: #signInPanel below is a fixed height, so swapping the view cannot move the heading. */
    justify-content: center;
    padding-block: 1.5rem;
}

#signInPanel {
    width: 100%;
    max-width: 420px;
    /* Fixed height covering the tallest view, so the heading stays put when the view is swapped. */
    min-height: 31rem;
}

/* The staged forms are shorter than the single-page one. */
#mainContentContainer:has(#unameInputContainer) #signInPanel {
    min-height: 28.5rem;
}

#signInPanel h2 {
    margin: 0 0 0.75rem;
    color: var(--bs-body-color);
    font-size: 28px;
    font-weight: 450;
}

#signInIntro {
    color: var(--bs-body-color);
    font-size: 16px;
    margin-bottom: 0;
}

.login-container label {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 4px;
}

.login-container .form-floating label {
    line-height: var(--bs-body-line-height);
    opacity: 0.8;
}

.login-container a {
    font-size: 14px;
    color: var(--content-primary);
}

.login-container a i {
    color: inherit;
}

.login-container i {
    color: var(--primary-blue);
}

.login-container i.showPwdSupplier {
    margin-right: 4px;
}

.login-container span.showPwdSupplier {
    font-size: 14px;
    font-weight: bold;
}

.login-container .showPwdSupplier:hover {
    cursor: pointer;
}

.login-container input {
    height: 42px;
}

.login-container .form-control {
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.login-container button {
    width: 100%;
    height: 42px;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 0.75rem;
}

/* .btn.btn-primary-blue in bootstrap-theme.css loads after this file, so match its specificity. */
.login-container .btn.btn-primary-blue {
    --bs-btn-bg: var(--content-primary);
    border-radius: 8px;
    font-weight: 600;
}

/* Secondary action under a field: "Forgot username?" on the first stage, "Back" on the second. */
.stage-links {
    display: flex;
    margin-bottom: 0.75rem;
}

#signUpPrompt {
    font-size: 14px;
    margin-bottom: 0;
}

#signUpPrompt a {
    color: var(--ctnav-cta-pink, #DE0D83);
    font-weight: 700;
    text-decoration: none;
}

span#or {
    position: absolute;
    background-color: white;
    padding: 0 5px;
    margin: auto;
    width: 30px;
    border: 1px solid #cccccc;
    border-radius: 15px;
    font-size: 11px;
    text-align: center;
}

div#oauthOptionContainer hr {
    margin: 1rem 0;
}

div#oauthOptionContainer img {
    height: 24px;
    margin-right: 5px;
}

div#oauthOptionContainer .btn {
    align-items: center;
    display: flex;
    justify-content: center;
    height: 2.5rem;
    margin-top: 0.75rem;
}

/* ------------------------------------------------------------------ Account conflict */

/* The conflict panel is swapped into #signInPanel and needs more room than the form. */
#mainContentContainer:has(#accountConflictContainer) {
    overflow: auto;
}

#mainContentContainer:has(#accountConflictContainer) #signInPanel {
    max-width: 640px;
    max-height: 90%;
    padding: 2.5rem 0;
}

#accountConflictContainer {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
}

.person-select-row {
    cursor: pointer;
    border: 1px solid #aaa;
    border-radius: var(--bs-border-radius-lg);

    &:hover {
        scale: 103%;
        cursor: pointer;
        box-shadow: 0 5px 7px rgb(0 0 0 / 30%);

        & .card-title {
            text-decoration: underline;
        }
    }
}

@media (min-width: 768px) {
    #selectContainer {
        overflow: auto;
    }
}

/* ------------------------------------------------------------------ Carousel card */

#messagePanel {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Right edge lines up with the header and footer containers. */
    padding: 2rem max(1.5rem, calc((100% - var(--ctnav-max-width, 1440px)) / 2 + 32px)) 2rem 0;
}

.carousel-inner {
    background-color: #CCEEFB;
    border-radius: 32px;
}

.carousel-item {
    height: 100%;
    transition: transform 2.5s ease-in-out, -webkit-transform 2.5s ease-in-out;
}

.signin-message {
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    text-align: left;
    width: 100%;
    height: 100%;
    padding: 0 4rem;
}

#messagePanel h2 {
    width: 100%;
    max-width: 560px;
    margin: 0 0 1.5rem;
    color: var(--content-primary);
    font-size: 38px;
    text-align: left;
    font-weight: 450;
}

#messagePanel p {
    width: 100%;
    max-width: 560px;
    margin-bottom: 2.5rem;
    font-size: 20px;
}

#messagePanel div.welcome {
    width: 100%;
    max-width: 560px;
    margin-bottom: 50px;
    color: var(--bs-body-color);
    font-size: 24px;
    text-align: left;
}

#messagePanel .carousel-btn {
    border-radius: 150px;
    font-weight: 600;
    padding: 8px 38px;
    color: var(--ctnav-cta-pink);
    border: 1px solid var(--ctnav-cta-pink);
    background-color: transparent;
}

#messagePanel .carousel-btn:hover,
#messagePanel .carousel-btn:focus-visible {
    color: white;
    background-color: var(--ctnav-cta-pink);
}

/* ------------------------------------------------------------------ Responsive */

@media (max-width: 1399px) {
    .signin-message {
        padding: 0 2.5rem;
    }

    #messagePanel h2 {
        font-size: 28px;
    }

    #messagePanel p {
        font-size: 18px;
    }
}

@media (max-width: 991px) {
    #messagePanel h2 {
        font-size: 24px;
    }

    #messagePanel p {
        font-size: 16px;
    }

    #messagePanel div.welcome {
        font-size: 20px;
    }
}

@media (max-width: 767px) {
    #mainContentContainer {
        /* Columns stack, so there is no spare height to share out. */
        flex: 0 0 auto;
    }

    #signInPanel,
    #mainContentContainer:has(#unameInputContainer) #signInPanel {
        order: 2;
        max-width: none;
        min-height: 0;
        margin-top: 1rem;
    }

    #mainContentContainer:has(#accountConflictContainer) #signInPanel {
        max-height: 100%;
    }

    #signInPanel div.error {
        font-size: 12px;
    }

    #messagePanel {
        order: 1;
        height: auto;
        min-height: 0;
        padding: 1.5rem calc(var(--bs-gutter-x) * .5) 1rem;
    }

    .carousel-inner {
        border-radius: 16px;
    }

    .signin-message {
        padding: 2rem 1.5rem;
    }

    #messagePanel p {
        font-size: 14px;
        margin-bottom: 1.5rem;
    }

    #messagePanel div.welcome {
        font-size: 14px;
        margin-bottom: 1.5rem;
    }

    #vgFooter {
        display: none !important;
    }

    .login-container input, .login-container button {
        height: 38px;
    }

    div#oauthOptionContainer hr {
        margin: 10px 0;
    }

    div#oauthOptionContainer .btn {
        margin-top: 15px;
    }

    .footer {
        flex-shrink: 0;
        bottom: unset;
        position: unset;
        min-height: unset;
    }
}
