/*
    Copyright (c) 2001 Envision Technology Partners, Inc. All rights reserved.
    Bootstrap 5 Login Area Styles
*/

/*
    BS3 parity: BS3 themes declare `body { background-color: lighten(@brand-main, 10%) }`,
    BUT the body element on login pages also carries the `login-color` class, and the rule
    `.login-color { background-color: @brand-main !important }` wins because of !important.
    So the ACTUAL painted body bg on BS3 login pages is `@brand-main` (same color as the
    header band), not the lightened color.

    Verified with DevTools Computed style on webiznet_newmexico/Login.aspx:
    body.background-color = rgb(0, 101, 144) = #006590 = --iz-top-nav-color
    (NOT rgb(0, 137, 195) = #0089c3 = --menu-color-1 / the lightened color).

    So we paint body with --iz-top-nav-color (matches header band) — top header and bottom
    body band render as the same brand color, matching BS3 visually across all 16 themes.
*/
html {
    min-height: 100%;
}

body.login-color {
    background-color: var(--iz-login-header-color, var(--iz-top-nav-color));
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

/*
    The white card. BS3 parity port of `.iz-main { background:#fff; min-height: 800px }`.
    The layout places .container-fluid as the wrapper around header + main + footer
    (matching BS3's iz-main, which contained the .login-color band INSIDE it). Because
    the header is inside the card, the card grows naturally with header + content, so
    the floor is a flat 800px — no need to subtract header height like a calc().

    padding: 0 removes BS5's default container horizontal padding so the header band
    sits flush against the white card's left/right edges (matches BS3 where the
    .login-color band ran edge-to-edge inside .iz-main). Inner login-wrap centers the
    form content via its own max-width + margin: 0 auto, so no parent padding needed.

    NOTE: BS3 .iz-main had `margin-bottom: 40px` but that was on a position: absolute
    element where the margin doesn't visibly push siblings. We do NOT replicate it as
    padding-bottom here because adding 40px to the card pushes BS5 content past the
    viewport on smaller screens, triggering a vertical scrollbar that visibly exposes
    body-bg (brand color) behind the scrollbar track — which BS3 doesn't show because
    its content fits viewport without scroll. Padding: 0 keeps BS5 closer to BS3's
    "no extra space" baseline.
*/
body.login-color > .container-fluid {
    background-color: #fff;
    min-height: 800px;
    padding: 0;
    /* Prevent horizontal scrollbar caused by BS5 .row negative margins
       (margin-left/right: -.75rem) inside this zero-padded container.
       The footer's .row extends beyond the viewport without this. */
    overflow-x: hidden;
}

/*
    Header sits INSIDE the white card now (DOM matches BS3). The .login-color base rule's
    `margin-bottom: 30px` creates the 30px gap BETWEEN header and form content WITHIN the
    white card — same as BS3 where the in-card .login-color div had this margin and the
    gap appeared on the white iz-main background. No override needed here.
*/

/*
    Per-tenant fallback chain matches body.login-color above (line 25). PDPH / NSHD /
    NewHampshire override --iz-login-header-color in their theme CSS to paint the
    login band with a different color than the post-login top nav (--iz-top-nav-color).
    Both <header class="login-color"> and <body class="login-color"> read the SAME
    variable chain so they always paint the same color — see Content/Bootstrap5Themes/
    pdph.css, nshd.css, newhampshire.css. Other tenants leave --iz-login-header-color
    undefined and fall through to --iz-top-nav-color (same color as their post-login
    top nav, matching BS3 behavior for those tenants).
*/
header.login-color {
    background-color: var(--iz-login-header-color, var(--iz-top-nav-color));
}

.login-color {
    position: relative;
    top: 0;
    width: 100%;
    padding: 20px 0;
    margin-bottom: 30px;
}

.login-color img {
    margin: 0 auto;
    display: block;
    max-width: 100%;
    height: auto;
}

.login-wrap {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 20px;
}

.login-text-width {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 20px;
    color: var(--iz-login-title-color, #ffffff);
}

.login-title {
    font-family: 'Open Sans', sans-serif;
    text-align: center;
    font-weight: 400;
    margin: 0;
    color: #404040;
    font-size: 30px;
}

/* Login-area pages have no side menu -- override the menu-subtracted width above */
body.login-color main {
    width: auto !important;
}

/* Match BS3 LoginPageHelp.aspx: 640px column, 12px Arial, 1.428 line-height,
   text color #333 (Bootstrap 3 @text-color / @gray-dark default). */
body.login-color main .login-wrap {
    max-width: 640px;
    font-size: 12px;
    line-height: 1.428;
    color: #333;
    font-family: Arial, sans-serif;
}

/* BS3 parity: port of WebIZ.Web/Content/WebCode/Login.less rule
   `span#LabelLoginText { color: gray; }` which only applies on BS3 LoginPageHelp.aspx
   (where <asp:Label ID="LabelLoginText"> renders the system-configuration LOGIN PAGE
   TEXT inside a <span id="LabelLoginText">). In BS5, LoginPageHelp/Index.cshtml wraps
   textStyles.Html in <div id="LabelLoginText"> to recreate the same hook. Admin-set
   inline colors in the system-config HTML still win because WebIzRaw
   emits per-element classes that override this inherited default.
   WCAG 1.4.3 (AA): BS3 'gray' = #808080 = 3.94:1 on white (FAILS 4.5:1). Darkened to
   #595959 = 7:1 on white (passes AAA) so the disclaimer/help text meets contrast on
   all 18 tenants without affecting admin-set inline colors. */
#LabelLoginText {
    color: #595959;
}

/*
    BS3 parity: restore cell borders on admin-authored tables in LOGIN PAGE
    TEXT rich-text. BS5 Reboot (bootstrap.css line 446-455) sets
    `tr, td, th { border-width: 0 }` which kills the default cell borders
    browsers paint for <table border="1">; BS3's bootstrap.css has no
    equivalent reset.

    WebIzRaw may add `.dyn-<hash>` classes for non-border properties
    (width, height, etc.), so `:not([class])` cannot be used — it would
    incorrectly skip cells that have a dyn-* class for width but still
    need default borders. Apply to all cells unconditionally.

    Scope: login pages only (`body.login-color main`) and only on tables
    carrying the HTML `border` attribute (Bootstrap `.table` is unaffected).
*/
body.login-color main table[border] td,
body.login-color main table[border] th {
    border: 1px solid;
}
