/* =========================================================
   ATACS legacy public pages: Home, Login and PasswordRecovery
   Opt-in only. A page takes this presentation by putting
       atacs-legacy-public atacs-legacy-public--home | --login | --recovery
   on <body> and loading this file last; every rule below sits under that root, so the
   authenticated application, its typography, controls and MFA pages are untouched.
   Values are measured from the legacy site (test.flatacs.com Default.aspx,
   Public/Login.aspx and Public/PasswordRecovery.aspx: Styles/typography.css,
   Styles/screen.css, Styles/screen2.0.css).
   "Trebuchet" is not an installed face, so browsers paint the stack as Lucida Sans
   Unicode, exactly as the legacy pages do.
   ========================================================= */

/* ---------- Shared public baseline ---------- */
.atacs-legacy-public {
    --atacs-public-font: Trebuchet, "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
    --atacs-public-heading-font: Trebuchet, "Lucida Sans Unicode", sans-serif;
    --atacs-public-text: #333;
    --atacs-public-link: #045b90;
    --atacs-public-link-visited: #419bd2;
    /* Legacy bg_InputButton.gif: a flat #727272 rounded rectangle, 29px tall, #828282 on
       hover; its corners best fit an 8.5px radius. */
    --atacs-public-btn-bg: #727272;
    --atacs-public-btn-hover-bg: #828282;
    --atacs-public-btn-radius: 8.5px;
    font-family: var(--atacs-public-font);
    font-size: 12px;
    line-height: normal;
    color: var(--atacs-public-text);
}

/* Legacy links: underlined #045b90, #419bd2 once visited, no underline on hover. The
   shared header keeps its own link styles. */
.atacs-legacy-public :is(main, #body, #footer) a:not(.btn) {
    color: var(--atacs-public-link);
    text-decoration: underline;
}

    .atacs-legacy-public :is(main, #body, #footer) a:not(.btn):visited {
        color: var(--atacs-public-link-visited);
    }

    .atacs-legacy-public :is(main, #body, #footer) a:not(.btn):hover {
        text-decoration: none;
    }

/* Legacy input button: bold 12px white on the grey shape, 12px left and 10px right of the
   text (the 12px inset plus the 3px + 7px right cap), 29px tall with the text on the
   legacy pixels. Keeps Bootstrap's .btn focus ring, tinted grey. */
.atacs-legacy-public .atacs-public-button {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--atacs-public-btn-bg);
    --bs-btn-border-color: var(--atacs-public-btn-bg);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--atacs-public-btn-hover-bg);
    --bs-btn-hover-border-color: var(--atacs-public-btn-hover-bg);
    --bs-btn-focus-shadow-rgb: 114, 114, 114;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--atacs-public-btn-hover-bg);
    --bs-btn-active-border-color: var(--atacs-public-btn-hover-bg);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--atacs-public-btn-bg);
    --bs-btn-disabled-border-color: var(--atacs-public-btn-bg);
    padding: 7px 10px 7px 12px;
    border-width: 0;
    border-radius: var(--atacs-public-btn-radius);
    font-family: var(--atacs-public-font);
    font-size: 12px;
    font-weight: 700;
    line-height: 15px;
    text-decoration: none;
}

    /* A visited link button keeps its button colour instead of the visited-link blue. */
    .atacs-legacy-public .atacs-public-button:visited {
        color: var(--bs-btn-color);
    }

/* Legacy footer cells are content-box: the 140px logo cell is 148px wide with its padding. */
.atacs-legacy-public #footer table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.atacs-legacy-public #footer td {
    box-sizing: content-box;
    padding: 4px;
    text-align: left;
    vertical-align: middle;
}

/* ---------- Home (legacy Default.aspx) and PasswordRecovery ----------
   Both legacy pages use the same master page: #header, a title above the #appWrapper frame
   and the footer, all on the 1244px #pageWrapper. */
:is(.atacs-legacy-public--home, .atacs-legacy-public--recovery) {
    background: #f7f7f7;
}

    /* Legacy #header margin-bottom before the page title. */
    :is(.atacs-legacy-public--home, .atacs-legacy-public--recovery) > header {
        margin-bottom: 10px;
    }

/* Legacy #pageWrapper is 1244px with no side gutter: title, frame and footer all start on
   its left edge. */
@media (min-width: 1200px) {
    :is(.atacs-legacy-public--home, .atacs-legacy-public--recovery) .atacs-container {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Title above the frame: 21px bold #045b90 with 1px letter spacing, 18px above the frame. */
:is(.atacs-legacy-public--home, .atacs-legacy-public--recovery) .atacs-public-title {
    margin: 0 0 18px;
    padding: 0;
    color: var(--atacs-public-link);
    font-family: var(--atacs-public-heading-font);
    font-size: 21px;
    font-weight: 700;
    line-height: 21px;
    letter-spacing: 1px;
}

/* Legacy #appWrapper frame: #eaeaea outer and #e1e1e1 inner 1px rules, rounded caps, at least
   535px tall, with #appContent's 1px/10px/10px padding inside the 2px frame. */
:is(.atacs-legacy-public--home, .atacs-legacy-public--recovery) main.atacs-shell {
    margin-bottom: 10px;
    padding: 2px 9px 11px;
    border: 1px solid #eaeaea;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px #e1e1e1;
    background: #fff;
    min-height: 535px;
}

/* Legacy tables: 4px cells, separate borders. */
.atacs-legacy-public--home .atacs-home-table,
.atacs-legacy-public--home .atacs-home-table table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

    .atacs-legacy-public--home .atacs-home-table td {
        padding: 4px;
    }

/* Legacy renders an empty 7px button cap after the login button's spacing; keeping it keeps
   the button at the same offset from the text column's centre. */
.atacs-legacy-public--home .atacs-home-login-cap {
    display: inline-block;
    width: 7px;
}

/* Footer on the wrapper's left edge. The footer carries an inline centring flex style and the
   border-top utility, so the track is set on #footer and the rule is removed here. */
:is(.atacs-legacy-public--home, .atacs-legacy-public--recovery) footer.footer {
    border-top: 0 !important;
}

    :is(.atacs-legacy-public--home, .atacs-legacy-public--recovery) footer.footer #footer {
        width: 100%;
        max-width: 1244px;
    }

@media (max-width: 1199.98px) {
    .atacs-legacy-public--home .atacs-home-table img {
        max-width: 100%;
        height: auto;
    }

        /* The SWAT logo keeps its legacy 150px height when there is room. */
        .atacs-legacy-public--home .atacs-home-table img[height] {
            width: auto;
            max-height: 150px;
        }
}

/* Phones: the two-column table stacks - logos, text, then the button. */
@media (max-width: 767.98px) {
    .atacs-legacy-public--home .atacs-home-table,
    .atacs-legacy-public--home .atacs-home-table > tbody,
    .atacs-legacy-public--home .atacs-home-table > tbody > tr,
    .atacs-legacy-public--home .atacs-home-table > tbody > tr > td {
        display: block;
        /* Override the legacy inline column widths. */
        width: auto !important;
    }
}

/* ---------- PasswordRecovery (legacy Public/PasswordRecovery.aspx) ---------- */
/* Header: legacy shows "Home |" then "Help" with 5px after each item; the pipe follows
   "Home" after one text space (3.79px in 12px Lucida Sans Unicode), not the 5px item gap.
   The space sits outside the link, as in legacy. */
@media (min-width: 1200px) {
    .atacs-legacy-public--recovery .atacs-userlinks .atacs-public-home-link {
        margin-right: .316em;
        padding-right: 0 !important;
    }
}

/* Legacy lays the page out in 4px table cells: the band, the field rows and the buttons all
   sit 4px inside #appContent. The instruction strip keeps screen2.0.css .msgBox. */
.atacs-legacy-public--recovery .atacs-recovery-step {
    padding: 0 4px;
}

.atacs-legacy-public--recovery .atacs-recovery .alert {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 0;
    line-height: normal;
}

/* h4.blueTitle band: bold 14.4px Arial on #d9e4fb (screen2.0.css), 24px tall, 14px below the
   strip (its 10px margin plus a 4px cell) and 17px above the first input (its own 5px plus
   two cells' padding). */
.atacs-legacy-public--recovery .atacs-recovery-step .blueTitle {
    margin: 14px 0 13px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14.4px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: normal;
    text-transform: none;
}

/* Label column: legacy's auto table gives the right-aligned labels 24.25% of the 1216px row
   (294.9px, cell padding included) - its share of the label and 25em-input widths. */
.atacs-legacy-public--recovery .atacs-recovery-fields {
    display: grid;
    grid-template-columns: minmax(max-content, 24.251%) minmax(0, 1fr);
    align-items: start;
}

.atacs-legacy-public--recovery :is(.atacs-recovery-label, .atacs-recovery-control) {
    min-width: 0;
    padding: 4px;
    line-height: normal;
}

/* Legacy centres each label on its 22px input (vertical-align: middle in a 30px row). A
   validation message then grows the control cell below the input without moving the label. */
.atacs-legacy-public--recovery .atacs-recovery-label {
    padding-top: 5.5px;
    text-align: right;
    white-space: nowrap;
}

    /* screen2.0.css .label supplies bold #333 with a 15px line; legacy's required marker is a
       regular-weight italic (the <em> default) #333 asterisk touching the label text. */
    .atacs-legacy-public--recovery .atacs-recovery-label .label {
        display: inline;
        margin: 0;
        font-size: 12px;
    }

    .atacs-legacy-public--recovery .atacs-recovery-label .atacs-form-required {
        color: var(--atacs-public-text);
        font-style: italic;
        font-weight: 400;
    }

/* Legacy inputs keep the browser's own text field (2px inset border, no padding): 164x18
   content, 168x22 painted; the email input is 25em. */
.atacs-legacy-public--recovery .atacs-recovery-control input.text {
    box-sizing: content-box;
    width: 164px;
    max-width: calc(100% - 4px);
    height: 18px;
    margin: 0;
    padding: 0;
    font-family: var(--atacs-public-font);
    font-size: 12px;
    line-height: normal;
}

    .atacs-legacy-public--recovery .atacs-recovery-control input.atacs-recovery-wide {
        width: 25em;
    }

    .atacs-legacy-public--recovery .atacs-recovery-control .text-danger {
        display: block;
        line-height: 15px;
    }

        .atacs-legacy-public--recovery .atacs-recovery-control .text-danger:not(:empty) {
            margin-top: 2px;
        }

/* Buttons: 16px below the last row, separated by "&nbsp;&nbsp; " and followed by an empty 7px
   button cap. The approved legacy reference (the reviewed legacy Chrome screenshot) starts the
   action row under the inputs, so every step - Cancel / Next, Cancel / Get Password and a lone
   Cancel - begins on the input track: the label column's 24.251% plus the control cell's 4px
   (x312.89 in the 1244px frame). */
.atacs-legacy-public--recovery .atacs-recovery-actions {
    margin-top: 16px;
    padding-left: calc(24.251% + 4px);
    text-align: left;
    line-height: normal;
}

    .atacs-legacy-public--recovery .atacs-recovery-actions .atacs-public-button {
        vertical-align: top;
    }

.atacs-legacy-public--recovery .atacs-public-button-cap {
    display: inline-block;
    width: 7px;
}

/* Phones: labels above their inputs. */
@media (max-width: 575.98px) {
    .atacs-legacy-public--recovery .atacs-recovery-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .atacs-legacy-public--recovery .atacs-recovery-label {
        padding-top: 4px;
        padding-bottom: 0;
        text-align: left;
        white-space: normal;
    }

    /* The stacked inputs start 4px in; the action row follows them. */
    .atacs-legacy-public--recovery .atacs-recovery-actions {
        padding-left: 4px;
    }
}

/* ---------- Login (legacy Public/Login.aspx) ---------- */
/* screen2.0.css supplies the legacy .loginScreen wrapper (372px), header (205px) and box
   (8px #0570b0 frame, #e5e5e5, 20px/28px padding). These rules restore what Bootstrap's
   reboot changes and the parts the legacy login took from its own stylesheet. */
.atacs-legacy-public--login {
    text-align: start;
}

    /* The logo is centred on the box: both are the 372px wrapper's width. Legacy shows the top
       205 of its 206 rows (#header is 205px); the image crops itself rather than being
       clipped by the header. */
    .atacs-legacy-public--login #imgHeader {
        display: block;
        height: 205px;
        object-fit: none;
        object-position: center top;
    }

    /* Fixed layout lets the inputs' max-width shrink them on phones instead of the 274px
       inputs widening the cell. */
    .atacs-legacy-public--login #lgnUser {
        width: 100%;
        margin: 0;
        border-collapse: collapse;
        table-layout: fixed;
    }

        /* Legacy renders in "almost standards" mode (XHTML 1.0 Transitional), where a line
           holding only a label or only an input ignores the cell's text strut. A zero cell
           line-height removes the strut the same way, so each label line is its own 15px and
           each input line its 29px box plus 10px margin. */
        .atacs-legacy-public--login #lgnUser td {
            padding: 4px;
            line-height: 0;
        }

    /* Legacy's first line is an empty 12px text line; messages and links keep text lines. */
    .atacs-legacy-public--login .login-first-line,
    .atacs-legacy-public--login .login-messages,
    .atacs-legacy-public--login .links {
        line-height: normal;
    }

    /* Legacy inputs are content-box: 270px + 2px borders = 274px, 20px + 5px + 4px = 29px. */
    .atacs-legacy-public--login #body input.text {
        box-sizing: content-box;
        width: 270px;
        max-width: calc(100% - 4px);
        padding: 5px 0 0;
        color: #333;
        line-height: normal;
        vertical-align: middle;
    }

    /* Fixed 29px like legacy's span.loginButton. */
    .atacs-legacy-public--login .loginButton {
        display: block;
        float: left;
        height: 29px;
    }

    .atacs-legacy-public--login .links {
        border-top: 1px dashed #a5a5a5;
        padding-top: 10px;
    }

        .atacs-legacy-public--login .links p {
            margin: 5px 0 2px;
        }

    .atacs-legacy-public--login .login-messages .alert {
        display: block;
        margin: 0 0 10px;
    }

    .atacs-legacy-public--login #footer td.atacs-login-footer-logo {
        width: 37%;
        text-align: center;
    }

/* Narrow screens: a 16px gutter instead of the fixed 372px wrapper. */
@media (max-width: 403.98px) {
    .atacs-legacy-public--login #pageWrapper {
        width: auto;
        margin: 0 16px;
    }

    .atacs-legacy-public--login #header {
        height: auto;
    }

    .atacs-legacy-public--login #imgHeader {
        max-width: 100%;
        height: auto;
        margin: 0 auto;
        object-fit: contain;
    }
}
