/* ==========================================================
   Aurigo Masterworks Web Login Override Styles
   Web-specific layout (two-panel branding + form)
   Requires: mw-custom-global.css loaded first
   ========================================================== */

/* ==========================================================
   Main Container
   ========================================================== */
.main-container {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.login-main-container {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--color-surface-primary);
}

/* ==========================================================
   Left Branding Section
   ========================================================== */
.branding-section {
    flex: 0 0 50%;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: var(--spacing-20) var(--spacing-27-5);
    background: url('../images/bg-Image-web-login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.branding-content {
    color: var(--color-text-inverse);
    max-width: var(--size-branding-max-width);
}

.branding-content-title {
    margin-bottom: var(--spacing-6);
}

.branding-content-title-text {
    font-family: var(--font-family-body);
    font-weight: var(--font-weight-regular);
    font-style: normal;
    font-size: var(--spacing-7);
    line-height: var(--line-height-base);
    letter-spacing: 0;
    margin-bottom: var(--spacing-6);
}

.branding-content-message-text {
    font-family: var(--font-family-body);
    font-weight: var(--font-weight-semibold);
    font-style: normal;
    font-size: var(--font-size-5xl);
    line-height: var(--line-height-base);
    letter-spacing: 0;
}

.accent-bar {
    width: var(--spacing-20);
    height: var(--accent-bar-height);
    background: var(--color-brand-primary);
    margin-top: var(--accent-bar-margin-top);
}

/* ==========================================================
   Right Main Content Section
   ========================================================== */
.main-content {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    background: var(--color-surface-primary);
    overflow-y: auto;
    position: relative;
    min-width: 0;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--spacing-3) var(--spacing-5);
    width: 100%;
    box-sizing: border-box;
}

.form-content-centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    width: 100%;
}

/* ==========================================================
   Responsive: Hide Branding on smaller screens
   ========================================================== */
@media (max-width: 1020px) {
    .branding-section {
        display: none;
    }

    .main-content {
        flex: 1;
        width: 100%;
    }
}

/* ==========================================================
   Responsive: Font Size Adjustment
   ========================================================== */
@media (max-width: 1280px) {
    html {
        font-size: 90%;
    }
}

/* ==========================================================
   Safe Area Support (Notch & Dynamic Island)
   ========================================================== */
@supports (padding: env(safe-area-inset-top)) {
    .main-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Sign In precedes the links row in source order, so it inherits the tight gap
   the password field previously had to the row beneath it; its own 2.5rem
   bottom margin then separates it from the links. Lives here rather than in
   mw-custom-global.css so the mobile page, which did not change source order,
   keeps its own spacing. The external-idp-top rule below outranks this. */
#loginForm .login-submit-container {
    margin-top: var(--font-size-sm);
}

/* ==========================================================
   External IDP Position = Top (1)
   Source order now matches visual order; see Login.cshtml
   ========================================================== */
.login-form-section.external-idp-top {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-10);
}

/* The SSO button has zero inset from the section edge in Top mode (unlike
   the username/password inputs' 20px inset), so the message text needs to
   match that zero inset here instead of the global 20px (Bottom mode) value.
   .generic-msg-container is a sibling of .login-form-section, not a
   descendant, hence :has() to detect Top mode from the shared parent. */
.form-content-centered:has(.login-form-section.external-idp-top) .generic-msg-container {
    padding: 0;
}

/* Stacking follows HTML source order - Login.cshtml emits the IdP section
   before the form in Top mode. Do not reintroduce `order:` here: it decouples
   the tab order from the visual order and fails WCAG 2.4.3. */

/* Leading "OR" would sit above the top-most button with nothing before it */
.login-form-section.external-idp-top .adfs-login-section > .login-options:first-child {
    display: none;
}

/* SSO button: full width, logo inline beside the centred label */
.login-form-section.external-idp-top .adfx-login-holder {
    margin: 0;
}

.login-form-section.external-idp-top .adfx-login-holder .button-container {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: var(--spacing-2) var(--spacing-4);
    cursor: pointer;
}

.login-form-section.external-idp-top .adfx-login-holder .button-container.has-icon::before {
    position: static;
    transform: none;
    flex: none;
}

.login-form-section.external-idp-top .adfx-login-holder .button-container.has-icon .btnC {
    flex: none;
}

/* Dividers */
.login-form-section.external-idp-top .login-option-divider {
    margin: 16px 0 0;
    height: 1px;
    background: #e6e9ee;
    border: 0;
}

/* Disclosure toggle */
.login-form-section.external-idp-top .password-login-toggle {
    margin-top: 16px;
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 4px;
    color: #46536b;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-form-section.external-idp-top .password-login-toggle:hover {
    border-color: #b9c3cf;
    background: #fafbfc;
}

.login-form-section.external-idp-top .password-login-toggle svg {
    flex: none;
    transition: transform .18s ease;
}

.login-form-section.external-idp-top .password-login-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.login-form-section.external-idp-top .password-login-hint {
    margin: 8px 2px 0;
    text-align: center;
    font-size: 12.5px;
    line-height: 18px;
    color: #6b7684;
}

/* Request access sits outside the collapsible form so it stays visible */
.login-form-section.external-idp-top .request-access-row {
    margin: 16px 0 0;
    font-size: 14px;
    color: #46536b;
    text-align: center;
}

.login-form-section.external-idp-top .request-access-row svg {
    vertical-align: -2px;
    margin-left: 3px;
}

/* This link sits outside .login-links-row, so it misses that rule's colour and would
   otherwise fall back to the browser default (including the purple :visited state) */
.login-form-section.external-idp-top .request-access-row a,
.login-form-section.external-idp-top .request-access-row a:visited {
    color: var(--color-text-link);
    font-weight: var(--font-weight-medium);
    text-decoration: underline;
}

/* Sign in (left, outlined) and Forgot password (right) share one row.
   margin-top is the gap between the hint and "Username": it lives on the form
   because the hint now precedes it in source order, so the old
   `#loginForm ~ .password-login-hint` sibling selector can no longer match.
   No `:not(.password-login-hidden)` guard is needed - a display:none form
   contributes no margin, so the gap disappears when collapsed by itself. */
.login-form-section.external-idp-top #loginForm {
    margin-top: var(--spacing-6);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.login-form-section.external-idp-top #loginForm > div {
    flex: 0 0 100%;
}

.login-form-section.external-idp-top #loginForm > .login-submit-container {
    flex: 0 0 auto;
    margin: 0;
    margin-right: auto;
    justify-content: flex-start;
}

.login-form-section.external-idp-top #loginForm > .login-links-row {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.login-form-section.external-idp-top #loginForm > .login-links-row .btn-link {
    font-size: var(--font-size-sm);
}

/* The New User link is rendered outside the form in this mode */
.login-form-section.external-idp-top #loginForm > .login-links-row .btn-link:first-child,
.login-form-section.external-idp-top #loginForm > .login-links-row .spacer {
    display: none;
}

.login-form-section.external-idp-top #loginForm .loginBtnDiv {
    background-color: #fff;
    color: var(--color-brand-primary);
    border: 1px solid var(--color-brand-primary);
}

/* Must out-rank the `.external-idp-top #loginForm { display: flex }` rule above */
.login-form-section.external-idp-top #loginForm.password-login-hidden {
    display: none;
}

.password-login-hidden {
    display: none;
}
