/* ================================================================
   login-scale.css - size/zoom invariant login composition
   ----------------------------------------------------------------
   The login screen is laid out on a fixed design canvas and then
   scaled to fill the window, so it renders identically at every
   browser zoom level (25% through 500%) and grows/shrinks with
   the screen instead of reflowing.

   Everything here is scoped to the `login-scaled` class that the
   layout script puts on <html>. Without that class these rules are
   inert and the original responsive stylesheets apply unchanged
   (phones, portrait and very small windows).
   ================================================================ */

/* The login screen never shows a scrollbar - in scaled mode nothing can
   overflow, and in the stacked mobile mode the page still scrolls, just
   without the bar. */
html,
body,
.mainbg,
.login-split-wrapper,
.login-left-panel,
.login-right-panel,
.login-left-inner,
.login-right-inner,
.login-card {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.mainbg::-webkit-scrollbar,
.login-split-wrapper::-webkit-scrollbar,
.login-left-panel::-webkit-scrollbar,
.login-right-panel::-webkit-scrollbar,
.login-left-inner::-webkit-scrollbar,
.login-right-inner::-webkit-scrollbar,
.login-card::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

html,
body {
    overflow-x: hidden;
}

:root {
    --login-ui-scale: 1;
}

html.login-scaled,
html.login-scaled body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

html.login-scaled .mainbg {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* The design canvas: laid out at (viewport / scale) px and scaled
   back so it covers exactly the visible area. */
html.login-scaled .login-split-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    width: calc(100% / var(--login-ui-scale));
    height: calc(100% / var(--login-ui-scale));
    min-height: 0;
    overflow: hidden;
    overflow: clip; /* clip, not scroll: focus can never nudge the canvas */
    -webkit-transform: scale(var(--login-ui-scale));
    transform: scale(var(--login-ui-scale));
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    display: grid;
    grid-template-columns: minmax(300px, 1.15fr) minmax(350px, 0.85fr);
    -ms-flex-direction: row;
    flex-direction: row;
}

/* Decorative rings live on the canvas so they scale with it too. */
html.login-scaled .bg-ring,
html.login-scaled .bg-glow {
    display: block;
}

/* -- PANELS ----------------------------------------------------- */
html.login-scaled .login-right-panel,
html.login-scaled .login-left-panel {
    -ms-flex: none;
    flex: none;
    width: auto;
    min-width: 0;
    height: 100%;
    /* Vertical padding shrinks on short screens so the taller card still fits. */
    padding: clamp(16px, 4vh, 48px) 48px;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: start;
    align-items: flex-start;
    -ms-flex-order: initial;
    order: initial;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

html.login-scaled .login-right-panel {
    /* Tighter side padding so the card can use more of its column. */
    padding-left: 20px;
    padding-right: 20px;
    -ms-flex-pack: center;
    justify-content: center;
}

html.login-scaled .login-left-panel {
    -ms-flex-pack: start;
    justify-content: flex-start;
}

html.login-scaled .login-right-inner,
html.login-scaled .login-left-inner {
    /* Auto margins centre the column but never clip it when it is taller
       than the panel (sign-up / reset-password screens). */
    margin-top: auto;
    margin-bottom: auto;
}

html.login-scaled .login-right-inner {
    max-width: 451px;
}

html.login-scaled .login-left-inner {
    max-width: 500px;
}

html.login-scaled .login-promo-image {
    width: min(100%, 560px);
    max-height: 620px;
}

/* -- CARD ------------------------------------------------------- */
html.login-scaled .login-card {
    width: 100%;
    padding: 25px 35px 25px;
    border-radius: 26px;
    box-sizing: border-box;
    -webkit-animation: none;
    animation: none;
    /* backdrop-filter on a card inside a scaled, scrolling panel makes the
       browser rasterize it at low resolution (blurry text while scrolling).
       The card is already ~90% opaque, so a slightly more opaque solid
       background looks the same without the filter. */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.94);
}

html.login-scaled .brand-logo-area {
    margin-bottom: 22px;
}

html.login-scaled .brand-logo-img {
    height: 50.6px;
    max-width: 177px;
}

html.login-scaled .welcome-heading {
    font-size: 26.3px;
    margin-bottom: 8px;
}

html.login-scaled .welcome-subtext {
    font-size: 14.9px;
    margin-bottom: 28px;
}

html.login-scaled .new-form-input,
html.login-scaled .login-meta-row,
html.login-scaled .btn-login-main,
html.login-scaled .btn-signup-link {
    font-size: 14.9px;
}

/* Small text that logincss.css sets at 10-13px. Raised so it stays legible
   when the canvas is scaled down on small screens. */
html.login-scaled .field-label {
    font-size: 14px;
    margin-bottom: 7px;
}

html.login-scaled .new-form-input::placeholder,
html.login-scaled .remember-me-label,
html.login-scaled .forgot-pwd-link,
html.login-scaled .rfvInvalid {
    font-size: 13.2px;
}

html.login-scaled .rfvCompanyPin,
html.login-scaled .signup-divider span {
    font-size: 11.3px;
}

/* Darker greys: the originals (#888899 / #7a7a8a) washed out on the pale card. */
.field-label {
    text-transform: none;
    color: #3d3d4d;
}

.welcome-subtext,
.remember-me-label {
    color: #4a4a5a;
}

.new-form-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.signup-divider span {
    color: rgba(0, 0, 0, 0.5);
}

.login-footer-note {
    color: rgba(255, 255, 255, 0.9);
}

html.login-scaled .login-footer-note {
    margin-top: 18px;
}

/* -- FORM CONTROLS ---------------------------------------------- */
html.login-scaled .new-form-group {
    margin-bottom: 16px;
}

html.login-scaled .new-form-input {
    height: 43.7px;
}

html.login-scaled .login-meta-row {
    margin: 8px 0 24px;
}

html.login-scaled .btn-login-main {
    height: 44.9px;
}

html.login-scaled .btn-signup-link {
    height: 43.7px;
}

/* Pinstripe texture moves onto the canvas so its spacing scales too. */
html.login-scaled .mainbg::before {
    display: none;
}

html.login-scaled .login-split-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: repeating-linear-gradient( -55deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 26px );
    pointer-events: none;
    z-index: 0;
}
