/*****************************************************************/
/* MX Login Page Shell — loaded ONLY by ExternalLogin.aspx        */
/*****************************************************************/

/* Neutralize the master page's decorative top band on this page only.
   This selector only has effect because this stylesheet is only ever
   <link>-ed from ExternalLogin.aspx's own headerContentPlaceHolder. */
#topSectionWrapper {
    display: none;
}

#bodyContainer,
#siteBodyContent,
#main_content,
#print_content {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.mx-shell {
    font-family: var(--mx-font-family);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: var(--mx-color-background-paper);
}

@media only screen and (min-width: 1024px) {
    .mx-shell {
        flex-direction: row;
    }
}

.mx-shell__brand-panel {
    display: none;
}

@media only screen and (min-width: 1024px) {
    .mx-shell__brand-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* User request: the carousel sits in the middle of the (left) page.
           justify-content:center vertically centers the carousel; the
           brand-header is position:absolute so it doesn't affect centering. */
        justify-content: center;
        background-color: var(--mx-color-background-brand-panel);
        color: var(--mx-color-text-primary);
        padding-top: var(--mx-space-10);
        padding-bottom: var(--mx-space-4);
        padding-left: var(--mx-space-3);
        padding-right: var(--mx-space-3);
        position: relative;
    }
}

.mx-shell__brand-header {
    display: flex;
    align-items: center;
    gap: var(--mx-space-2);
}

@media only screen and (min-width: 1024px) {
    .mx-shell__brand-header {
        position: absolute;
        top: var(--mx-space-6);
        left: var(--mx-space-6);
    }
}

.mx-shell__brand-name {
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    color: var(--mx-color-primary);
}

@media only screen and (min-width: 1024px) {
    .mx-shell__brand-name {
        font-size: 24px;
    }
}

.mx-shell__brand-carousel {
    width: 100%;
    max-width: 624px;
    /* No flex-grow / top margin: the carousel takes its natural height and is
       vertically centered by the brand panel's justify-content:center. */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mx-shell__mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mx-space-2);
    padding: var(--mx-space-3);
    color: var(--mx-color-primary);
}

@media only screen and (min-width: 1024px) {
    .mx-shell__mobile-header {
        display: none;
    }
}

.mx-shell__lang-switcher {
    display: none;
}

@media only screen and (min-width: 1024px) {
    .mx-shell__lang-switcher {
        display: block;
        position: absolute;
        top: var(--mx-space-6);
        right: var(--mx-space-6);
        font-family: var(--mx-font-family);
        font-size: var(--mx-subtitle2-size);
        font-weight: var(--mx-subtitle2-weight);
        letter-spacing: var(--mx-subtitle2-spacing);
        color: var(--mx-color-text-secondary);
        z-index: 1;
    }
}

.mx-shell__form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

@media only screen and (min-width: 1024px) {
    .mx-shell__form-panel {
        align-items: center;
        justify-content: center;
    }
}

/* Mobile pre-form intro carousel — matches MobileOnboardingIntro.styled.ts */
.mx-mobile-intro {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--mx-space-3);
    padding-top: var(--mx-space-1);
    padding-bottom: calc(var(--mx-space-2) + env(safe-area-inset-bottom, 0px));
}

.mx-mobile-intro.mx-mobile-intro--hidden {
    display: none;
}

@media only screen and (min-width: 1024px) {
    .mx-mobile-intro {
        display: none !important;
    }
}

.mx-mobile-intro__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mx-space-2);
    width: 100%;
    max-width: 420px;
    padding-left: var(--mx-space-4);
    padding-right: var(--mx-space-4);
    box-sizing: border-box;
}

/* Form area — hidden on mobile until "Log in" is tapped; always shown at
   desktop widths regardless of JS state, matching Login.styled.ts's
   FormView (display:none when $hidden, forced flex at the lg breakpoint). */
.mx-form-area {
    display: none;
    width: 100%;
    flex: 1;
}

.mx-form-area.mx-form-area--visible {
    display: flex;
    flex-direction: column;
}

/* User request: center the login card in the middle of the page. The
   form area fills the form panel's height (flex:1); centering its content
   vertically + horizontally floats the card in the middle, with the
   fixed footer pinned below it. */
.mx-form-area.mx-form-area--visible,
.mx-form-area {
    justify-content: center;
    align-items: center;
}

@media only screen and (min-width: 1024px) {
    .mx-form-area {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/*****************************************************************/
/* MX Login Card restyle                                          */
/*****************************************************************/

.mx-login-card {
    font-family: var(--mx-font-family);
    width: 100%;
    /* 630px = 1.5x MX's original 420px card width; padding scaled to match
       (--mx-space-6 = 48px = 1.5x --mx-space-4's 32px), per user request to
       make the card area larger without changing text/button sizes. */
    max-width: 630px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    background: var(--mx-color-background-paper);
    padding: var(--mx-space-6);
    padding-bottom: calc(var(--mx-space-6) + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

@media only screen and (min-width: 640px) {
    .mx-login-card {
        padding-bottom: var(--mx-space-6);
        padding-top: 0;
    }
}

/* The legacy "Log In to Your Benefits" header (#headerSection) is removed
   from the MX card's markup directly (flag-On branch of ExternalLogin.aspx),
   not hidden here — hiding it via display:none broke the whole card, because
   the header's inner `<div class="loginToYourBenefits" ... />` is a malformed
   self-closing div that HTML parses as UNCLOSED, causing the rest of the
   card to nest inside #headerSection. Deleting the block is the correct fix
   and matches the user's request to remove that header. The flag-Off legacy
   layout keeps its own (untouched) #headerSection. */

.mx-login-card__title-group {
    display: flex;
    flex-direction: column;
    gap: var(--mx-space-2);
    margin-bottom: var(--mx-space-1);
    text-align: left;
}

@media only screen and (min-width: 1024px) {
    .mx-login-card__title-group {
        text-align: center;
        align-items: center;
    }
}

.mx-login-card__title {
    font-size: var(--mx-h1-size);
    line-height: var(--mx-h1-line);
    font-weight: var(--mx-h1-weight);
    letter-spacing: var(--mx-h1-spacing);
    color: var(--mx-color-text-primary);
    margin: 0;
}

.mx-login-card__subtitle {
    font-size: var(--mx-body1-size);
    line-height: var(--mx-body1-line);
    font-weight: var(--mx-body1-weight);
    color: var(--mx-color-text-primary);
    margin: 0;
}

/* MX Button — matches theme/components/Button.ts styleOverrides exactly */
.mx-btn,
#externalEntraLoginButton,
.btnContinue {
    font-family: var(--mx-font-family);
    height: 48px;
    padding: 12px 22px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
    text-transform: none;
    letter-spacing: 0.5px;
    box-shadow: none;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.mx-btn--contained,
#externalEntraLoginButton {
    background-color: var(--mx-color-primary) !important;
    background-image: none !important;
    color: var(--mx-color-primary-contrast);
    width: 100%;
    float: none;
}

.mx-btn--contained:hover,
#externalEntraLoginButton:hover {
    background-color: var(--mx-color-primary) !important;
}

/* User request: "Continue" (classic-login submit) should match the
   "Sign in with MyFBG" black-pill theme. Background/color only — kept
   separate from the width:100%/float:none rule above since Continue
   sits inline in its credential row, not full-width like the primary CTA. */
.btnContinue {
    background-color: var(--mx-color-primary) !important;
    background-image: none !important;
    color: var(--mx-color-primary-contrast) !important;
}

.btnContinue:hover {
    background-color: var(--mx-color-primary) !important;
    color: var(--mx-color-primary-contrast) !important;
}

.mx-btn--outlined {
    background: transparent;
    border: 2px solid var(--mx-color-primary);
    color: var(--mx-color-primary);
    width: 100%;
}

.mx-btn--outlined:hover {
    background: transparent;
    border: 2px solid var(--mx-color-primary);
}

/* Classic-login toggle link + collapsed form */
#classicLoginToggle {
    font-family: var(--mx-font-family);
    font-size: var(--mx-body1-size);
    color: var(--mx-color-text-primary);
    text-decoration: underline;
}

#mxRegisterLink,
.entraHeader,
.entraLink,
.entraLoading {
    font-family: var(--mx-font-family) !important;
}

#mxRegisterLink {
    font-size: var(--mx-body1-size);
    text-align: center;
    color: var(--mx-color-text-primary);
}

#mxRegisterLink a {
    color: var(--mx-color-text-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: underline;
}

/* Text inputs across every classic-login panel (username/password, SSN+DOB,
   Employee ID+Group#) — all share the .lbl_input wrapper, so one rule set
   covers every field. */
.lbl_input input[type="text"],
.lbl_input input[type="password"] {
    font-family: var(--mx-font-family) !important;
    height: 48px !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    padding: 0 14px !important;
    font-size: var(--mx-body1-size) !important;
    border: 1px solid var(--mx-grey-500);
    border-radius: 4px;
    color: var(--mx-color-text-secondary);
}

.lbl_input input[type="text"]:hover,
.lbl_input input[type="password"]:hover {
    border-color: var(--mx-grey-900);
}

.lbl_input input[type="text"]:focus,
.lbl_input input[type="password"]:focus {
    border-color: var(--mx-color-primary);
    border-width: 2px;
    outline: none;
}

.lbl_input span {
    font-family: var(--mx-font-family);
    color: var(--mx-color-text-secondary);
    font-size: var(--mx-body1-size);
}

/* User request: remove the "Returning User? / New User?" mode-picker
   (username/password vs. SSN vs. Employee ID) entirely, since new users
   now go through "Register here" (the MX registration flow) instead.
   Server-side, username/password (pnlReturningUser) is always the
   default panel unless a ?LoginMode=SSN-style query string is present
   (ExternalLoginPresenter.Initialize()) — that deep-link path renders a
   different, independent panel inside #credentialOptions and does not
   depend on this picker UI, so hiding it here is safe in both cases. */
#innerSection {
    display: none;
}

/* User request: username/password labels were right-justified
   (inherited from .selectedBlock's text-align:right at >=600px in
   External.css) — left-justify them. */
.mx-login-card .selectedBlock {
    text-align: left;
}

/* User request: right-justify just the "Forgot Username or Password?"
   row and the Continue-button row, while username/password stay
   left-justified per the rule above. Both rows share the same
   .viewportCredentials class as every other row with no unique id, so
   they're distinguished by content: the forgot row is the only one
   containing an <a> (the two LinkButtons), and the button row is the
   only one containing .btnContinue. */
.mx-login-card .viewportCredentials:has(a),
.mx-login-card .viewportCredentials:has(.btnContinue) {
    text-align: right;
}

/* User request: enlarge + bold "Forgot password?", then reduce twice by
   25% (2em → 1.5em → 1.125em). The forgot row is the only
   .viewportCredentials with an <a> (the password LinkButton); the
   size/bold apply to the surrounding "Forgot … ?" text and the link alike. */
.mx-login-card .viewportCredentials:has(a) {
    font-size: 1.125em;
    font-weight: 700;
}

.mx-login-card .viewportCredentials:has(a) a {
    font-weight: 700;
}

/* User request: the show/hide-password eye icon (#togglePassword) sits
   below the password field instead of inside it, because the password
   input is width:100% and pushes the icon (an inline sibling <div>) onto
   its own line beneath. Position it as an overlay inside the field
   instead. position:relative on every .viewportCredentials row is
   harmless for rows without an absolutely-positioned child; !important
   overrides the inline style="...margin:auto..." already on the icon's
   div (the inline height:40px is kept — 4px top/bottom = vertically
   centered within the 48px-tall input). */
.mx-login-card .viewportCredentials {
    position: relative;
}

.lbl_input input[type="password"] {
    padding-right: 44px !important;
}

#togglePassword {
    position: absolute;
    right: 14px;
    bottom: 4px;
    margin: 0 !important;
}

/* User request: all remaining non-black help/footer links on this card
   should be black. ("Register here" and "Use your username and
   password" are already forced black above; these are the rest.)
   lblHavingTroubleLoggingIn/lblLearnAboutMFA/lblMFAIsComing are
   asp:Label server controls; Web.config sets <pages clientIDMode="AutoID">,
   which mangles their rendered id with naming-container prefixes (e.g.
   "ctl00_bodyContentPlaceHolder_udPanel_lblMFAIsComing") — a bare
   #lblMFAIsComing selector never matches. [id$="..."] matches the
   rendered id regardless of prefix. */
#entraLoginSection .entraHeader,
#entraLoginSection .entraLink,
[id$="lblHavingTroubleLoggingIn"],
[id$="lblLearnAboutMFA"],
[id$="lblMFAIsComing"],
.viewportCredentials a {
    color: var(--mx-color-text-primary) !important;
}

/* User request: hide the "Forgot Username" half of the forgot-link row,
   keeping only "Forgot password?" visible, per the target design. */
.mx-hidden {
    display: none;
}

/* User request: match the member-facing MX login exactly — hide the
   legacy CMS-only notices ("Logins are now authenticated…", "Having
   trouble logging in?", "Learn about additional security") and the
   "FBG Employee? Log In via Entra" workforce-login link. Hidden, not
   removed from the DOM, so the flag-Off legacy layout stays
   byte-identical; these selectors only bite inside .mx-login-card,
   which renders only when the MX flag is on. */
.mx-login-card .viewportThirdOptionContainer,
.mx-login-card .loginFooterRow {
    display: none;
}

/* User request: match the target design's field rows — vertical gap
   between rows (MX's actual Login.styled.ts Form gap = theme.spacing(3)
   = 24px), and floating labels inside the input border (MUI
   OutlinedInput look) instead of a separate label line above the field. */
.mx-login-card .lbl_input.viewportCredentials {
    margin-bottom: var(--mx-space-3);
}

/* The forgot-password row is immediately followed by the button row's
   own margin-top:10px, so it doesn't need the standard gap below it too
   — :last-of-type would be wrong here (the button row is also a <div>
   positioned after it, so it's not actually the last div of its type);
   :has(a) identifies it the same way the existing right-align rule does. */
.mx-login-card .lbl_input.viewportCredentials:has(a) {
    margin-bottom: 0;
}

.mx-login-card .lbl_input span.mx-field-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--mx-font-family);
    font-size: var(--mx-body1-size);
    color: var(--mx-color-text-secondary);
    background: var(--mx-color-background-paper);
    padding: 0 4px;
    pointer-events: none;
    transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease;
    white-space: nowrap;
}

.mx-login-card .lbl_input span.mx-field-label .required {
    color: var(--mx-color-error);
}

/* Floats up + shrinks on focus, or whenever the field has a value
   (:placeholder-shown only matches an EMPTY field with its placeholder
   showing — the placeholder="  " on txtUsername/txtPassword exists
   purely to make this pseudo-class available; the space is never
   visible since the label sits on top of it). This also correctly
   floats the label on a server postback that redisplays a validation
   error with the previously-typed value still in the field, since
   :placeholder-shown reflects the input's actual current value, not
   just client-side typing. */
.mx-login-card .lbl_input input:focus + span.mx-field-label,
.mx-login-card .lbl_input input:not(:placeholder-shown) + span.mx-field-label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    left: 10px;
}

/* User request: "Log in" (classic-login submit) should be full-width,
   matching "Sign in with MyFBG" and the target design, rather than the
   shrink-wrapped right-aligned button from the previous iteration.
   btnContinueExisting is an asp:Button (runat=server), so its rendered
   id is AutoID-mangled — [id$="..."] matches regardless of prefix. */
[id$="btnContinueExisting"] {
    width: 100%;
    float: none;
}

/* User request: pin the support footer (phone icon + number) to the bottom
   of the page, constrained to the RIGHT side (the form panel), not the full
   page width. position:absolute resolves against .mx-shell__form-panel
   (which is position:relative), so the bar exactly matches the form panel's
   width and bottom edge — on desktop that's the right column, and below the
   lg breakpoint (single-column) it's the full width — with no reliance on
   the two columns being an exact 50/50 split. */
.mx-support-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--mx-space-1);
    padding: var(--mx-space-2);
    background: var(--mx-grey-50);
    font-family: var(--mx-font-family);
    font-size: var(--mx-subtitle2-size);
    color: var(--mx-color-text-secondary);
}

/* The legacy master-page footer ("The Contractors Plan" image bar) isn't
   part of the MX design; keep it hidden on the MX view so the page ends
   at the login card. Only affects the MX view — this stylesheet isn't
   loaded at flag-Off. */
#bottom_content_outer {
    display: none;
}

.mx-support-footer svg {
    flex-shrink: 0;
    color: var(--mx-color-text-secondary);
}

.mx-support-footer a {
    color: var(--mx-color-text-primary) !important;
    font-weight: 700;
    text-decoration: underline;
}

/* Entra multi-account overlay */
.entraOverlayDialog {
    font-family: var(--mx-font-family);
    border-radius: 16px;
}

.entraOverlayTitle {
    font-family: var(--mx-font-family) !important;
    color: var(--mx-color-text-primary) !important;
}

.entraOverlaySubtitle,
.entraAccountTable {
    font-family: var(--mx-font-family) !important;
}

.entraCancelBtn {
    font-family: var(--mx-font-family) !important;
    border-radius: 16px;
}
