/* Modern login.aspx styling. 5 layout variants selectable from Options.aspx ("Login Page" section,
   Core.Options.LoginPageStyle) via a body class set server-side in login.aspx.vb : SetVisuals():
   (no class)          = plain centered card
   loginstyle-bg        = card with the (optional) vertical image faded into its background
   loginstyle-split      = image panel beside the card
   loginstyle-hero        = full-page blurred image backdrop
   loginstyle-hero-sharp = full-page sharp (unblurred) image backdrop
   --login-image / --login-vertical-image are set inline on <body> from Core.Options.LoginImagePath /
   LoginVerticalImagePath (both optional - every rule below has a plain-color fallback so the page
   still looks intentional with no images uploaded at all). */
/* Scoped to .login-wrap, NOT global - this stylesheet auto-loads on every page in the app (theme
   CSS, see web.config's styleSheetTheme="Default"), so a bare `* { box-sizing: border-box; }` was
   silently flipping the box model for every element site-wide, including inside third-party
   controls (e.g. AjaxControlToolkit's AsyncFileUpload on Options.aspx) that assume the default
   content-box sizing for their own internal layout. */
.login-wrap, .login-wrap * {
    box-sizing: border-box;
}

.login-wrap {
    max-width: 380px;
    margin: 0 auto;
    padding: 0 12px;
}

/* Autofit: vertically+horizontally center the card within the full viewport height instead of
   the old fixed 7% top margin (which sat low on tall screens and off-center on short ones).
   Scoped to body.login-page - form/#Content are shared with the rest of the app's master page.
   min-height (not a fixed height+overflow:hidden) so an unusually tall card (e.g. a long license
   warning) still scrolls instead of getting clipped. */
body.login-page {
    min-height: 100vh;
}

body.login-page form {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.login-page #Content {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

    .login-header img {
        max-height: 64px;
        max-width: 100%;
    }

.login-title {
    text-align: center;
    margin: 0 0 8px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: bold;
}

.text-small {
    font-size: 12px;
    color: #666;
}

/* FailureText renders inside an always-present container (no code-behind Visible toggling inside
   the Login control's LayoutTemplate) - style is opt-in via :not(:empty) instead of "styled by
   default, hidden when empty", so a stray whitespace text node can never make an empty message
   render as a visible colored box (matches lblResetError too, which reuses this class but does get
   proper server-side Visible toggling since it's a plain Label, not inside a LayoutTemplate). */
.login-error {
    display: none;
    color: #a94442;
    font-size: 13px;
}

    .login-error:not(:empty) {
        display: block;
        background: #f2dede;
        border: 1px solid #ebccd1;
        padding: 9px 11px;
        border-radius: 4px;
        margin-bottom: 14px;
    }

.login-success, .login-info {
    display: block;
    color: #3c763d;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    padding: 9px 11px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 13px;
}

/* asp:Login always wraps its content in its own auto-generated <table><tr><td> - even with a
   custom LayoutTemplate replacing everything inside it, that outer table is still rendered and has
   no explicit width, so it shrinks-to-fit its content (e.g. the "Log In" button's natural width)
   instead of filling .login-card-fields - which is what was making the fields look narrow/left-
   aligned despite width:100% already being set on them individually. */
.login-card-fields table {
    width: 100%;
    border-collapse: collapse;
}

.login-field {
    margin-bottom: 13px;
}

/* UserNameLabel/PasswordLabel stay in the markup (AssociatedControlID, screen readers, no visible
   "User Name"/"Password" text above the fields per the placeholder-based redesign - placeholder
   text disappears once a value's entered/on autofill, so keeping a real associated label matters
   for accessibility even though it's not shown). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

    .login-field .textbox {
        width: 100%;
        padding: 9px 11px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
    }

    .login-field label {
        font-weight: normal;
        display: block;
        margin-bottom: 4px;
        color: #555;
        font-size: 13px;
    }

.login-remember {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
}

.login-field .button {
    width: 100%;
    padding: 10px;
    background: #3d6cb3;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
}

    .login-field .button:hover {
        background: #345c98;
    }

.login-link {
    font-size: 12px;
    text-align: left;
}

.login-footer {
    text-align: center;
    color: #8a94a6;
    font-size: 11px;
    margin-top: 16px;
    line-height: 1.7;
}

.login-footer .lic-status,
.login-footer .critical {
    color: #6b7688;
    font-weight: 600;
    display: block;
}

.login-footer .critical {
    color: #a94442;
}

/* ==========================================================================
   Layout variants - inert unless a loginstyle-* class is present on <body>.
   ========================================================================== */

.login-card-bg,
.login-image-panel {
    display: none;
}

/* --- Background: image faded into the card --- */
body.loginstyle-bg .login-card-bg {
    display: block;
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 50% 36%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 28%, rgba(255,255,255,.85) 58%, #fff 80%), var(--login-vertical-image, none);
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto, 260px auto;
}

body.loginstyle-bg .login-card-fields {
    position: relative;
    z-index: 1;
}

/* --- Split: image panel to the left, form to the right --- */
body.loginstyle-split .login-wrap {
    max-width: 760px;
}

body.loginstyle-split .login-card {
    display: flex;
    align-items: stretch;
    padding: 0;
}

body.loginstyle-split .login-image-panel {
    display: block;
    position: relative;
    flex: 0 0 50%;
    min-height: 440px;
    background-image: var(--login-image, linear-gradient(160deg, #3d6cb3, #23345c));
    background-size: cover;
    background-position: center;
}

body.loginstyle-split .login-card-fields {
    flex: 1 1 auto;
    padding: 34px 36px;
}

/* --- Hero: full-bleed blurred backdrop + glass card --- */
body.loginstyle-hero, body.loginstyle-hero-sharp {
    background: #1a2540;
}

    body.loginstyle-hero::before {
        content: '';
        position: fixed;
        inset: -40px;
        background-image: var(--login-image, linear-gradient(135deg, #2c3e50, #4a69bd));
        background-size: cover;
        background-position: center;
        filter: blur(5px) brightness(.55) saturate(1.3);
        z-index: 0;
    }

    body.loginstyle-hero-sharp::before {
        content: '';
        position: fixed;
        inset: 0;
        background-image: var(--login-image, linear-gradient(135deg, #2c3e50, #4a69bd));
        background-size: cover;
        background-position: center;
        filter: brightness(.75) saturate(1.1);
        z-index: 0;
    }

    body.loginstyle-hero .login-wrap,
    body.loginstyle-hero-sharp .login-wrap {
        position: relative;
        z-index: 1;
    }

    body.loginstyle-hero .login-card,
    body.loginstyle-hero-sharp .login-card {
        background: rgba(255,255,255,.88);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 20px 60px rgba(0,0,0,.35);
        border: 1px solid rgba(255,255,255,.4);
    }

    body.loginstyle-hero .login-footer,
    body.loginstyle-hero-sharp .login-footer {
        color: rgba(255,255,255,.8);
    }

/* Neutralizes Root.Master's normal app chrome on the login page specifically (menu/toolbar/header
   banner) - login.aspx still uses Root.Master (simplest, lowest-risk option: the menu never
   actually gets data-bound for this page already, per Root.master.vb's own login-page branch), this
   just hides what's left of it so the page reads as a clean, standalone screen matching the design. */
body.login-page .masterMenu,
body.login-page .masterHeader,
body.login-page .masterToolbar,
body.login-page .masterUserControl {
    display: none !important;
}

body.login-page #Content {
    margin: 0 !important;
}

body.login-page td.masterMainContent {
    padding: 0 !important;
}
