/* Pre-auth login shell — content-section visual language without program-center chrome */

/* Guest chrome (frontend_2017) stays the old brand bars on v0.
   v1 login uses the same surface header / muted page as the signed-in app. */
body.login-ui-v1 {
    background: var(--surface-muted, var(--bgcolor9, #F3F4F6));
    color: var(--text-primary, var(--body-text, var(--txtcolor12)));
}

body.login-ui-v1 #header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 52px;
    padding: 0.5rem 1rem;
    background: var(--surface, var(--bgcolor10, #ffffff));
    border-bottom: 1px solid var(--border-subtle, #E5E7EB);
}

body.login-ui-v1 #header > [class*="col-"] {
    width: auto;
    max-width: none;
    flex: 0 1 auto;
    padding-right: 0;
    padding-left: 0;
}

body.login-ui-v1 #header > .col-4 {
    margin-left: auto;
}

body.login-ui-v1:has(#login-auth-content-section) #header-logo {
    display: none;
}

body.login-ui-v1 #header-logo img {
    max-height: 36px;
    max-width: 160px;
    padding: 0;
}

body.login-ui-v1 #header .dashboard a,
body.login-ui-v1 #header .dashboard,
body.login-ui-v1 #back-to-site,
body.login-ui-v1 #back-to-site button {
    color: var(--text-secondary);
}

body.login-ui-v1 #header .dashboard a:hover,
body.login-ui-v1 #header .dashboard a:focus,
body.login-ui-v1 #back-to-site button:hover,
body.login-ui-v1 #back-to-site button:focus {
    color: var(--brand, var(--bgcolor0));
}

/* Full-height page: on short pages the footer sits at the bottom of the screen;
   on long pages (welcome content) it follows the content. */
body.login-ui-v1 {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.login-ui-v1 > .main-content {
    flex: 1 0 auto;
}

body.login-ui-v1 #footer-1 {
    flex-shrink: 0;
    background: var(--surface, var(--bgcolor10, #ffffff));
    border-top: 1px solid var(--border-subtle, #E5E7EB);
}

body.login-ui-v1 .sign-in-footer {
    padding: 1rem 1.25rem;
}

body.login-ui-v1 .sign-in-footer__links {
    gap: 0.5rem 2rem;
}

body.login-ui-v1 .sign-in-footer__link {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold, 600);
    gap: 0.5rem;
}

body.login-ui-v1 .sign-in-footer__link i {
    font-size: 1.1em;
}

body.login-ui-v1 .sign-in-footer__link:hover,
body.login-ui-v1 .sign-in-footer__link:focus {
    color: var(--link, var(--txtcolor8, var(--brand, var(--bgcolor0))));
}

body.login-ui-v1 #footer-2 {
    display: none;
}

/* Company welcome pages keep brand-colored header and footer bars (v1 theme brand). */
body.login-ui-v1:has(.login-auth-page--welcome) #header,
body.login-ui-v1:has(.login-auth-page--welcome) #footer-1 {
    background: var(--brand, var(--bgcolor0));
    border-color: transparent;
}

body.login-ui-v1:has(.login-auth-page--welcome) #header .dashboard a,
body.login-ui-v1:has(.login-auth-page--welcome) #header .dashboard,
body.login-ui-v1:has(.login-auth-page--welcome) #back-to-site,
body.login-ui-v1:has(.login-auth-page--welcome) #back-to-site button,
body.login-ui-v1:has(.login-auth-page--welcome) .sign-in-footer__link {
    color: var(--on-brand, var(--txtcolor0, #ffffff));
}

body.login-ui-v1:has(.login-auth-page--welcome) #header .dashboard a:hover,
body.login-ui-v1:has(.login-auth-page--welcome) #header .dashboard a:focus,
body.login-ui-v1:has(.login-auth-page--welcome) #back-to-site button:hover,
body.login-ui-v1:has(.login-auth-page--welcome) #back-to-site button:focus,
body.login-ui-v1:has(.login-auth-page--welcome) .sign-in-footer__link:hover,
body.login-ui-v1:has(.login-auth-page--welcome) .sign-in-footer__link:focus {
    color: var(--on-brand, var(--txtcolor0, #ffffff));
    text-decoration: underline;
}

.login-auth-page {
    padding: 3.25rem 1rem 2.5rem;
    background: transparent;
    box-sizing: border-box;
}

.login-auth.content-section {
    margin: 0 auto;
    max-width: 36rem;
    min-width: 0;
}

/* Company welcome HTML uses the v0 side gutters (card-body padding + col-md-10 offset-md-1 p-3 in the view).
   The narrow card is only the sign-in panel that opens on Start. */
.login-auth-page--welcome {
    padding: 0 0 2.5rem;
}

.login-auth--welcome.content-section {
    max-width: none;
    margin: 0;
}

.login-auth--welcome .content-section__panel {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.login-auth--welcome .content-section__body {
    padding: 0;
}

/* Emails and guides say Start is "on the right hand side". */
.login-auth--welcome #start-button-container-top,
.login-auth--welcome #start-button-container {
    padding: 1rem 1.25rem 0;
    margin-bottom: 0;
    text-align: right;
}

.login-auth--welcome #start-button,
.login-auth--welcome #start-button-top {
    width: 100%;
    max-width: 200px;
}

@media (min-width: 992px) {
    .login-auth--welcome #start-button,
    .login-auth--welcome #start-button-top {
        margin-right: 0.75in;
    }
}

/* MFA challenge during v1 login — same width as the sign-in card */
.login-mfa-narrow .users-mfa-captive,
.login-mfa-narrow #com-users-select {
    width: 100%;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

/* The card is only 36rem wide, so a side label (col-sm-3) wraps into a tight strip. */
.login-mfa-narrow .users-mfa-captive .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    margin-left: 0;
}

.login-mfa-narrow .users-mfa-captive .col-form-label {
    padding-top: 0;
    padding-bottom: 0.35rem;
    text-align: left;
    white-space: normal;
}

.login-auth--wide {
    max-width: 48rem;
}

.login-auth .content-section__panel {
    background: var(--surface, var(--bgcolor10, #ffffff));
    border: 1px solid var(--border-subtle, #E5E7EB);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    min-width: 0;
}

.login-auth .content-section__header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0;
}

.login-auth .content-section__actions {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

.login-auth .content-section__actions .btn {
    width: auto;
    margin: 0;
}

.login-auth__logo {
    display: block;
    width: auto;
    max-width: 100%;
    /* logo_only.jpg is 108x39; max-* never enlarges it, so set the height (39px +20%). */
    height: 3.925rem;
    margin: 0 auto 0.75rem;
    object-fit: contain;
}

.login-auth .content-section__heading {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
}

.login-auth .content-section__heading .content-section__subtitle {
    margin: 0 0 1.25rem;
}

/* Logo + description centered; the Sign in title lines up with the form below. */
.login-auth .content-section__heading .content-section__title {
    align-self: stretch;
    text-align: left;
}

.login-auth .content-section__title {
    margin: 0;
    color: var(--text-primary, var(--body-text, var(--txtcolor12)));
    font-family: var(--font-family-heading, inherit);
    font-size: var(--text-h2, var(--f2, 1.5rem));
    font-weight: var(--font-weight-semibold, 600);
    line-height: var(--leading-tight, 1.25);
}

.login-auth .content-section__subtitle {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: var(--text-body, var(--f4, 0.875rem));
    line-height: var(--leading-normal, 1.5);
}

.login-auth .content-section__eyebrow {
    margin: 0 0 0.25rem;
    color: var(--text-muted);
    font-size: var(--text-tiny, var(--f6, 0.6875rem));
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-auth .content-section__body {
    padding: 1rem 1.25rem 1.5rem;
    color: var(--text-primary, var(--body-text, var(--txtcolor12)));
    font-size: var(--text-body, var(--f4, 0.875rem));
}

.login-auth #login-register,
.login-auth #login-register > form {
    min-width: 0;
    max-width: 100%;
}

.login-auth #landing-page-container.row {
    margin-left: 0;
    margin-right: 0;
}

.login-auth .content-section__body label {
    color: var(--text-secondary);
    font-size: var(--text-small, var(--f5, 0.75rem));
    font-weight: 600;
}

.login-auth .content-section__body .form-control {
    background: var(--input-bg, var(--surface, var(--bgcolor10, #ffffff)));
    color: var(--text-primary, var(--body-text, var(--txtcolor12)));
    border-color: var(--border-subtle, #E5E7EB);
    border-radius: 0.375rem;
}

.login-auth .content-section__body .form-control:focus {
    border-color: var(--brand, var(--bgcolor0));
    box-shadow: 0 0 0 0.2rem rgba(128, 128, 128, 0.2);
}

.login-auth .helper-text,
.login-auth .policy-exception {
    color: var(--text-muted);
    font-style: italic;
}

.login-auth .link,
.login-auth .link .no-button,
.login-auth #send-new-verification {
    color: var(--link, var(--txtcolor8, #0d6efd));
    cursor: pointer;
}

.login-auth .btn,
.login-auth .btn.link {
    border-radius: 0.25rem;
    font-size: var(--text-body, var(--f4, 0.875rem));
}

.login-auth #start-button,
.login-auth #next-button,
.login-auth #verify-button,
.login-auth #login-button,
.login-auth #register-button,
.login-auth #register-button-disabled,
.login-auth #start-button-top,
.login-auth #send-hint,
.login-auth #reset-password,
.login-auth #send-username,
.login-auth #submit-password {
    background-color: var(--brand, var(--bgcolor0, #003469));
    color: var(--on-brand, var(--txtcolor0, #ffffff));
    border: none;
}

.login-auth #start-button:hover,
.login-auth #next-button:hover,
.login-auth #verify-button:hover,
.login-auth #login-button:hover,
.login-auth #register-button:hover,
.login-auth #start-button-top:hover,
.login-auth #send-hint:hover,
.login-auth #reset-password:hover,
.login-auth #send-username:hover,
.login-auth #submit-password:hover {
    background-color: var(--brand-dark, var(--bgcolor1, var(--brand, var(--bgcolor0, #002244))));
    color: var(--on-brand, var(--txtcolor0, #ffffff));
}

.login-auth #start-over-button.btn,
.login-auth #real-time-registration-button.btn {
    background-color: var(--attention, var(--bgcolor4));
    color: var(--on-brand, var(--txtcolor0, #ffffff));
}

.login-auth hr {
    border-color: var(--border-subtle, #E5E7EB);
}

.login-auth .text-muted,
.login-auth .form-text {
    color: var(--text-muted) !important;
}

.welcome-accordion-inline {
    width: 100%;
    max-width: 100%;
}

.welcome-accordion {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    margin-bottom: 0;
    transition: grid-template-rows 0.5s ease, margin-top 0.5s ease, margin-bottom 0.5s ease;
}

.welcome-accordion.is-open {
    grid-template-rows: 1fr;
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
}

.welcome-accordion #welcome-signin-forms {
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 1.25rem;
    background: var(--surface, var(--bgcolor10));
    color: var(--text-primary);
    border: 1px solid var(--border-subtle, #E5E7EB);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
    transition: opacity 0.4s ease, padding 0.5s ease;
}

.login-auth--welcome .welcome-accordion #welcome-signin-forms {
    width: 100%;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.welcome-accordion.is-open #welcome-signin-forms {
    opacity: 1;
    padding: 1.25rem 1.25rem 0.5rem;
}

.welcome-accordion #verification-container.row,
.welcome-accordion #registration-container.row,
.welcome-accordion #reset-container.row {
    margin-left: 0;
    margin-right: 0;
}

.welcome-signin-bar {
    display: none;
}

.welcome-accordion .welcome-signin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle, #E5E7EB);
}

.welcome-signin-title {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-family-heading, inherit);
    font-size: var(--text-h3, var(--f3, 1.25rem));
    font-weight: var(--font-weight-semibold, 600);
}

.welcome-signin-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.welcome-signin-close:hover,
.welcome-signin-close:focus {
    color: var(--text-primary);
    background: var(--surface-muted);
}

@media (prefers-reduced-motion: reduce) {
    .welcome-accordion,
    .welcome-accordion #welcome-signin-forms {
        transition: none;
    }
}

@media (max-width: 575.98px) {
    .login-auth-page {
        padding: 1rem 0.75rem 2rem;
    }

    .login-auth .content-section__header,
    .login-auth .content-section__body {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
