/* Dashboard sign-in page (sign-in.php). Everything is scoped to body.auth-page so
   no rule reaches authenticated dashboard pages. Tokens and the public header come
   from public-tracking.css; the official logo files (brand-logos/) are used as-is. */

.auth-page {
    --auth-head: 84px; /* the public header's height, which floats over the photo */
    --auth-gap: 20px; /* least space above the card (under the header) and below it */
    /* The card's vertical rhythm. These are the full desktop values; the responsive
       section only re-points them (narrow desktop, short desktop, phones). */
    --auth-pad-x: 40px;
    --auth-card-top: 38px;
    --auth-card-bottom: 26px;
    --auth-logo: 78px;
    --auth-logo-gap: 26px;
    --auth-title: 28px;
    --auth-subtitle-gap: 10px;
    --auth-subtitle-end: 30px;
    --auth-label-gap: 9px;
    --auth-control: 56px;
    --auth-field-gap: 20px;
    --auth-forgot-end: 24px;
    --auth-submit: 58px;
    --auth-divider-gap: 28px;
    --auth-divider-end: 16px;
    --auth-social: 46px;
    --auth-contact-gap: 16px;
    --auth-copy-gap: 10px;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #0b1d55 !important;
    color: var(--pt-text);
    font-size: var(--pt-fs-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* The project's bootstrap.min.css forces the dashboard font on body with !important;
   this page only (body.auth-page) uses the public pages' font instead. */
body.auth-page { font-family: var(--pt-font) !important; }

.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }

.auth-page :focus-visible {
    outline: 3px solid rgba(76, 141, 255, .55);
    outline-offset: 2px;
}

/* styles.min.css removes every link and button outline with !important; give the
   keyboard focus ring back to this page's links and buttons (fields keep their
   own border-and-glow focus style). */
.auth-page a:focus-visible,
.auth-page button:focus-visible {
    outline: 3px solid rgba(76, 141, 255, .55) !important;
    outline-offset: 2px;
}

/* The header floats over the photo as tinted glass: the photo runs to the top of
   the page and no page colour shows at the header's corners. */
.auth-page .pt-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 5;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(5, 14, 46, .74) 0%, rgba(5, 14, 46, .42) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 10px 30px rgba(4, 12, 40, .22);
    backdrop-filter: blur(12px) saturate(1.15);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

/* ---------------------------------------------------------------- stage */

.auth-stage {
    position: relative;
    flex: 1;
    overflow: hidden;
    overflow: clip; /* clips the drifting photo without becoming a scroll container */
    background: #0b1d55;
}

/* From 900px up the card always sits on the right: the photo's city side.
   The header floats over the photo, so the stage fills the viewport and keeps the
   header's height (plus a gap) clear at the top; the card centres in what is left.
   When the card is taller than that, the stage grows and the page scrolls. */
.auth-stage-inner {
    position: relative;
    max-width: 1600px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: calc(var(--auth-head) + var(--auth-gap)) 32px var(--auth-gap);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

@media (min-width: 900px) {
    [dir="rtl"] .auth-stage-inner, .auth-stage-inner[dir="rtl"] { justify-content: flex-start; }
}

/* ---------------------------------------------------------------- card */

.auth-card {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    width: min(520px, 100%);
    padding: var(--auth-card-top) var(--auth-pad-x) var(--auth-card-bottom);
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 28px;
    box-shadow: 0 30px 70px rgba(4, 12, 40, .45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: auth-rise .7s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-card-logo { display: flex; justify-content: center; margin-bottom: var(--auth-logo-gap); }
.auth-card-logo img { display: block; width: auto; max-width: 100%; height: var(--auth-logo); }

.auth-title {
    margin: 0;
    text-align: center;
    font-family: var(--pt-font);
    font-size: var(--auth-title);
    font-weight: 800;
    line-height: 1.3;
    color: var(--pt-text);
}

.auth-subtitle {
    margin: var(--auth-subtitle-gap) 0 var(--auth-subtitle-end);
    text-align: center;
    color: var(--pt-muted);
    font-size: 15px;
}

.auth-field { margin-bottom: var(--auth-field-gap); }

.auth-label {
    display: block;
    margin-bottom: var(--auth-label-gap);
    font-size: 15px;
    font-weight: 700;
    color: var(--pt-text);
}

.auth-input { position: relative; }

.auth-page .auth-input .form-control,
.auth-page #twofa-code {
    height: var(--auth-control);
    padding-block: 0;
    padding-inline: 18px 52px;
    border: 1.5px solid #dbe2f0;
    border-radius: 14px;
    background: #fff;
    color: var(--pt-text);
    font-family: var(--pt-font);
    font-size: 15px;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-page .auth-input .form-control::placeholder { color: #9aa4ba; font-size: inherit; opacity: 1; }

.auth-page .auth-input .form-control:focus,
.auth-page #twofa-code:focus {
    outline: none;
    border-color: var(--pt-primary);
    box-shadow: 0 0 0 4px rgba(36, 83, 230, .12);
}

.auth-page .auth-input.has-toggle .form-control { padding-inline-start: 54px; }

/* Field icon at the far end, as in the design; the eye toggle at the start. */
.auth-input > i {
    position: absolute;
    top: 50%;
    inset-inline-end: 18px;
    transform: translateY(-50%);
    color: #7d88a3;
    font-size: 21px;
    pointer-events: none;
}

/* The show-password toggle (show-password.js reads its first child node). */
.auth-eye {
    position: absolute;
    top: 50%;
    inset-inline-start: 8px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #7d88a3;
    font-size: 20px;
    cursor: pointer;
}

.auth-eye:hover { background: #eef3ff; color: var(--pt-primary); }

.auth-row { display: flex; justify-content: flex-end; margin: -2px 0 var(--auth-forgot-end); }

.auth-page .auth-forgot {
    color: var(--pt-primary);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.auth-page .auth-forgot:hover { text-decoration: underline; }

.auth-page .auth-submit,
.auth-page #twofa-verify {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: var(--auth-submit);
    border: 0;
    border-radius: 14px;
    background: linear-gradient(100deg, #2462f5, #1a45d6);
    color: #fff;
    font-family: var(--pt-font);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(36, 83, 230, .3);
    transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}

.auth-page .auth-submit i { font-size: 21px; transition: transform .2s ease; }
.auth-page .auth-submit:hover, .auth-page #twofa-verify:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(36, 83, 230, .36); }
.auth-page .auth-submit:hover i { transform: translateX(-3px); }
[dir="ltr"] .auth-page .auth-submit:hover i, .auth-page[dir="ltr"] .auth-submit:hover i { transform: translateX(3px); }
.auth-page .auth-submit:active { transform: translateY(1px); }

.auth-page .auth-submit.is-loading { cursor: progress; filter: saturate(.75); }
.auth-page .auth-submit.is-loading i { display: none; }

.auth-page .auth-submit.is-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .8s linear infinite;
}

.auth-page #login-error,
.auth-page #twofa-error {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
}

/* ---------------------------------------------------------------- app download */

/* The CTA is duplicated in the markup only to keep its desktop placement out of
   the form while preserving the natural mobile flow after the sign-in button.
   Exactly one version is visible at a time. */
.auth-app-download {
    position: relative;
    isolation: isolate;
    color: #fff;
    font-family: var(--pt-font);
}

.auth-app-download--desktop {
    position: absolute;
    z-index: 3;
    /* Keep this at the physical lower-left of the hero in both LTR and RTL.
       Logical inset-inline-start moves it toward the phone in RTL layouts. */
    inset-inline-start: auto;
    left: clamp(18px, 2.4vw, 42px);
    bottom: 18px;
    width: 306px;
    padding: 14px;
    border: 1px solid rgba(185, 223, 255, .32);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(5, 24, 69, .9), rgba(14, 60, 131, .78));
    box-shadow: 0 18px 38px rgba(3, 13, 43, .32);
    backdrop-filter: blur(14px) saturate(1.14);
    -webkit-backdrop-filter: blur(14px) saturate(1.14);
    animation: auth-app-enter .55s .12s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-app-download::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, rgba(78, 207, 255, .15), #69d6ff, rgba(78, 207, 255, .15));
}

.auth-app-intro { display: flex; align-items: flex-start; gap: 10px; }

.auth-app-mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-top: 1px;
    border: 1px solid rgba(174, 226, 255, .25);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(92, 209, 255, .25), rgba(25, 91, 204, .28));
    color: #bceeff;
    font-size: 18px;
}

.auth-app-copy h2 {
    margin: 0;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
}

.auth-app-copy p {
    margin: 3px 0 12px;
    color: rgba(238, 247, 255, .82);
    font-size: 12px;
    line-height: 1.55;
}

.auth-app-badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.auth-store-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 10px;
    background: #05080f;
    color: #fff;
    text-align: start;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.auth-store-badge i { flex: none; font-size: 22px; line-height: 1; }
.auth-store-badge span { display: grid; min-width: 0; line-height: 1.05; }
.auth-store-badge small { display: block; font-size: 8px; letter-spacing: .01em; }
.auth-store-badge strong { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; }

.auth-store-badge:not(.is-disabled):hover {
    border-color: rgba(112, 205, 255, .9);
    box-shadow: 0 8px 18px rgba(4, 13, 38, .32), 0 0 0 3px rgba(61, 174, 255, .12);
    color: #fff;
    transform: translateY(-2px);
}

.auth-store-badge.is-disabled { cursor: not-allowed; opacity: .58; }
.auth-store-badge:focus-visible { outline: 3px solid rgba(129, 211, 255, .92); outline-offset: 3px; }

.auth-app-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 9px 0 0;
    color: rgba(220, 241, 255, .72);
    font-size: 10px;
    line-height: 1.3;
}

.auth-app-status i { color: #87dcff; font-size: 12px; }

.auth-app-download--mobile { display: none; }

/* Compact "Download app" button: short desktop screens only (shown in the
   short-desktop rules below, where the full box is hidden). It sits low on the
   wet floor, midway between the robot (about 22% of the width) and whichever
   comes first of the phone (about 52%) or, on narrow windows, the card - using
   physical positions because the photo is never mirrored. The badges open above. */
.auth-app-mini {
    display: none;
    position: absolute;
    z-index: 3;
    left: min(37%, calc(61% - 247px));
    bottom: 16px;
    transform: translateX(-50%);
    color: #fff;
    font-family: var(--pt-font);
}

.auth-app-mini > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px 0 16px;
    border: 1px solid rgba(185, 223, 255, .38);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(5, 24, 69, .88), rgba(14, 60, 131, .8));
    box-shadow: 0 10px 24px rgba(3, 13, 43, .35);
    backdrop-filter: blur(12px) saturate(1.14);
    -webkit-backdrop-filter: blur(12px) saturate(1.14);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    list-style: none;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-app-mini > summary::-webkit-details-marker { display: none; }
.auth-app-mini > summary > i { color: #bceeff; font-size: 18px; line-height: 1; }
.auth-app-mini > summary:hover { border-color: rgba(112, 205, 255, .9); box-shadow: 0 10px 24px rgba(3, 13, 43, .35), 0 0 0 3px rgba(61, 174, 255, .14); }
.auth-app-mini > summary:focus-visible { outline: 3px solid rgba(129, 211, 255, .92); outline-offset: 3px; }
.auth-app-mini-chevron { transition: transform .2s ease; }
.auth-app-mini[open] .auth-app-mini-chevron { transform: rotate(180deg); }

/* Opens above the button, centred on it (aligned to its right edge on narrow
   windows, so it never reaches over the card). */
.auth-app-mini-panel {
    --auth-mini-x: -50%;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    width: 280px;
    padding: 12px;
    transform: translateX(var(--auth-mini-x));
    border: 1px solid rgba(185, 223, 255, .32);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(5, 24, 69, .95), rgba(14, 60, 131, .88));
    box-shadow: 0 18px 38px rgba(3, 13, 43, .4);
    backdrop-filter: blur(14px) saturate(1.14);
    -webkit-backdrop-filter: blur(14px) saturate(1.14);
    animation: auth-app-mini-open .2s ease both;
}

/* 2FA step (same ids as before; only restyled). */
.auth-page #twofa-section h6 { font-family: var(--pt-font); font-size: 18px; font-weight: 800; }
.auth-page #twofa-code { padding-inline: 16px; letter-spacing: .3em; font-size: 20px; }
.auth-page #twofa-back { color: var(--pt-muted); }

/* ---------------------------------------------------------------- notification */

/* Sign-in notification (#auth-toast, driven by login.js). It sits in the card between
   the subtitle and the form, so it never covers anything at any width: it opens by
   growing its own row and stays until it is closed, a field is edited or the 2FA
   step opens. */
.auth-page .auth-toast {
    --auth-tone: var(--pt-danger);
    --auth-tone-soft: #fdeef0;
    --auth-tone-line: rgba(217, 45, 58, .22);
    display: grid;
    grid-template-rows: 0fr;
    margin-bottom: 0;
    opacity: 0;
    visibility: hidden;
    scroll-margin: 16px;
    transition: grid-template-rows .3s ease, margin-bottom .3s ease, opacity .2s ease, visibility 0s linear .3s;
}

.auth-page .auth-toast.is-warning {
    --auth-tone: var(--pt-warning);
    --auth-tone-soft: #fff6e8;
    --auth-tone-line: rgba(228, 138, 11, .3);
}

.auth-page .auth-toast.is-open {
    grid-template-rows: 1fr;
    margin-bottom: 22px;
    opacity: 1;
    visibility: visible;
    transition: grid-template-rows .3s ease, margin-bottom .3s ease, opacity .25s ease .05s, visibility 0s;
}

.auth-page .auth-toast-inner { min-height: 0; overflow: hidden; }

.auth-page .auth-toast-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--auth-tone-soft);
    border: 1px solid var(--auth-tone-line);
    border-radius: 14px;
    font-family: var(--pt-font);
}

.auth-page .auth-toast-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #fff;
    color: var(--auth-tone);
    font-size: 21px;
    box-shadow: 0 2px 6px rgba(15, 27, 61, .08);
}

/* A repeated failure while the notice is already open makes its icon pop. */
.auth-page .auth-toast.is-again .auth-toast-icon { animation: auth-toast-pop .45s ease; }

.auth-page .auth-toast-text { flex: 1; min-width: 0; padding-top: 1px; }

.auth-page .auth-toast-title {
    display: block;
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--pt-text);
}

.auth-page .auth-toast-msg {
    display: block;
    margin-top: 2px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #5b6478;
}

.auth-page .auth-toast-close {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: -3px -4px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8a93a9;
    font-size: 19px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.auth-page .auth-toast-close:hover { background: rgba(255, 255, 255, .75); color: var(--pt-text); }

/* ---------------------------------------------------------------- contact */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: var(--auth-divider-gap) 0 var(--auth-divider-end);
    color: #8a93a9;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e3e8f2;
}

.auth-social { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

.auth-page .auth-social a {
    display: grid;
    place-items: center;
    width: var(--auth-social);
    height: var(--auth-social);
    border-radius: 13px;
    background: #f1f4fa;
    color: #4a5573;
    font-size: 20px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, transform .12s ease;
}

.auth-page .auth-social a:hover { background: #e6edff; color: var(--pt-primary); transform: translateY(-2px); }

.auth-contact { margin: var(--auth-contact-gap) 0 0; text-align: center; color: var(--pt-muted); font-size: 14px; }
.auth-page .auth-contact a { color: var(--pt-primary); font-weight: 700; text-decoration: none; }
.auth-copy { margin: var(--auth-copy-gap) 0 0; text-align: center; color: #a3abbd; font-size: 12px; }

/* ---------------------------------------------------------------- background */

/* The brand photo fills the page behind the card, drifting slowly. The card sits
   on the photo's city side so the warehouse, robot, fleet and screens stay in
   view (the photo's own text means it is never mirrored for English). */
.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #0b1d55 url("../images/authentication/login-background.webp") 30% center / cover no-repeat;
    transform-origin: 30% 60%;
    animation: auth-drift 28s ease-in-out infinite alternate;
}

/* Depth behind the card and a soft fade under the header. */
.auth-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to left, rgba(6, 16, 52, .55) 0%, rgba(6, 16, 52, .18) 34%, rgba(6, 16, 52, 0) 58%),
        linear-gradient(180deg, rgba(6, 16, 52, .35) 0%, rgba(6, 16, 52, 0) 18%);
}

.auth-stage-inner { z-index: 2; }

@keyframes auth-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-toast-pop { 40% { transform: scale(1.18) rotate(-8deg); } 70% { transform: scale(.96) rotate(4deg); } }
@keyframes auth-app-enter { from { opacity: 0; transform: translateY(12px); } }
@keyframes auth-app-mini-open { from { opacity: 0; transform: translate(var(--auth-mini-x), 8px); } }
@keyframes auth-drift {
    from { transform: scale(1.02) translate(0, 0); }
    to { transform: scale(1.09) translate(-1.2%, -1%); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card, .auth-bg { animation: none !important; }
    .auth-app-download--desktop, .auth-app-mini-panel { animation: none; }
    .auth-app-mini-chevron { transition: none; }
    .auth-page .auth-submit.is-loading::before { animation-duration: 2s; }
    /* The sign-in notice opens and closes without moving. */
    .auth-page .auth-toast, .auth-page .auth-toast.is-open { transition: none; }
    .auth-page .auth-toast.is-again .auth-toast-icon { animation: none; }
}

/* ---------------------------------------------------------------- responsive */

/* Order: narrow desktop, short desktop (height), then tablet and phone (width).
   The short-desktop rules are limited to the desktop layout (min-width: 900px),
   so they never reach the tablet and phone rules below them. */

/* Narrow desktops, and short laptop screens up to 1440px wide: there the photo is
   sized by the window's width and its phone ends at about 61% of it, so the wider
   card would cover the phone. */
@media (max-width: 1279.98px), (max-width: 1439.98px) and (max-height: 899.98px) {
    .auth-page { --auth-pad-x: 30px; --auth-card-top: 32px; --auth-card-bottom: 22px; --auth-logo: 70px; }
    .auth-stage-inner { padding-inline: 24px; }
    .auth-card { width: min(470px, 100%); }
}

/* Keep the landscape-tablet card compact inside the lower-left hero space. */
@media (min-width: 900px) and (max-width: 1099.98px) {
    .auth-app-download--desktop {
        inset-inline-start: auto;
        left: 18px;
        width: 250px;
        padding: 13px;
        border-radius: 16px;
    }
    .auth-app-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
    .auth-app-copy h2 { font-size: 14px; }
    .auth-app-copy p { margin-bottom: 10px; font-size: 10.5px; }
    .auth-app-download--desktop .auth-app-badges { gap: 5px; }
    .auth-app-download--desktop .auth-store-badge { gap: 4px; padding: 5px; border-radius: 8px; }
    .auth-app-download--desktop .auth-store-badge i { font-size: 18px; }
    .auth-app-download--desktop .auth-store-badge small { font-size: 6.5px; }
    .auth-app-download--desktop .auth-store-badge strong { font-size: 10px; }
}

/* Under 1000px wide the card starts close to the compact button. */
@media (max-width: 999.98px) {
    .auth-app-mini-panel { --auth-mini-x: 0%; left: auto; right: 0; }
}

/* Short desktop and laptop screens (under 900px tall): the full composition needs
   84px of header + a 773px card + 2 x 20px, so below that the header and the card
   scale down together. --auth-fit runs from 0px (560px tall and shorter) to 1px
   (900px tall), and each token below moves from its compact value at 0 to its
   full value at 1 (for the card's padding and logo, the narrow-desktop values
   above). The whole card fits without scrolling from 560px tall up - a 1366x768
   or 1280x720 laptop, or a 1920x1080 screen at 150% scaling, with the browser's
   own bars. Only shorter windows scroll, and nothing is clipped. */
@media (min-width: 900px) and (max-height: 899.98px) {
    .auth-page {
        --auth-fit: clamp(0px, (100vh - 560px) / 340, 1px);
        --auth-head: calc(56px + 28 * var(--auth-fit));
        --auth-gap: calc(6px + 14 * var(--auth-fit));
        --auth-card-top: calc(16px + 16 * var(--auth-fit));
        --auth-card-bottom: calc(10px + 12 * var(--auth-fit));
        --auth-logo: calc(38px + 32 * var(--auth-fit));
        --auth-logo-gap: calc(8px + 18 * var(--auth-fit));
        --auth-title: calc(20px + 8 * var(--auth-fit));
        --auth-subtitle-gap: calc(2px + 8 * var(--auth-fit));
        --auth-subtitle-end: calc(10px + 20 * var(--auth-fit));
        --auth-label-gap: calc(4px + 5 * var(--auth-fit));
        --auth-control: calc(44px + 12 * var(--auth-fit));
        --auth-field-gap: calc(10px + 10 * var(--auth-fit));
        --auth-forgot-end: calc(10px + 14 * var(--auth-fit));
        --auth-submit: calc(46px + 12 * var(--auth-fit));
        --auth-divider-gap: calc(10px + 18 * var(--auth-fit));
        --auth-divider-end: calc(8px + 8 * var(--auth-fit));
        --auth-social: calc(40px + 6 * var(--auth-fit));
        --auth-contact-gap: calc(6px + 10 * var(--auth-fit));
        --auth-copy-gap: calc(10 * var(--auth-fit));
    }
    /* Single-line texts in the card close their line spacing from 1.6 to 1.4 as the
       screen gets shorter; their font sizes do not change. */
    .auth-label, .auth-subtitle, .auth-row, .auth-divider, .auth-contact, .auth-copy {
        line-height: calc(1.4em + 3 * var(--auth-fit));
    }
    /* The header follows --auth-head; the logo and the language button keep at
       least 8px clear above and below. The nav links already stretch to its height. */
    .auth-page .pt-header-inner { min-height: var(--auth-head); }
    .auth-page .pt-brand img { max-height: calc(var(--auth-head) - 16px); }
    .auth-page .pt-lang { height: min(44px, calc(var(--auth-head) - 16px)); }
    /* Short laptop windows are usually wider than the photo (16:9), so it is cropped
       top and bottom: take more from the sky, which sits under the header anyway,
       than from the robot and the phone at the bottom. */
    .auth-bg { background-position: 30% 70%; }
    /* On a photo this short the full app box would sit over the robot, so it is
       left out here and the compact "Download app" button takes its place; taller
       screens show the full box, and the phone layout keeps its own copy inside
       the card under the sign-in button. */
    .auth-app-download--desktop { display: none; }
    .auth-app-mini { display: block; }
}

/* Phones and small tablets: a band of the photo first, then the card over it. */
@media (max-width: 899.98px) {
    .auth-stage-inner { justify-content: center; min-height: 0; padding: calc(var(--auth-head) + 190px) 16px 28px; }
    .auth-card { width: min(560px, 100%); }
    /* The photo band (warehouse sign and robot) fades into the navy under the card. */
    .auth-bg {
        --auth-bg-x: 10%;
        --auth-bg-y: calc(var(--auth-head) - 150px);
        --auth-bg-h: 680px;
        background:
            linear-gradient(180deg, rgba(11, 29, 85, 0) 70%, #0b1d55 100%) 0 var(--auth-bg-y) / 100% var(--auth-bg-h) no-repeat,
            #0b1d55 url("../images/authentication/login-background.webp") var(--auth-bg-x) var(--auth-bg-y) / auto var(--auth-bg-h) no-repeat;
        transform-origin: 20% 15%;
    }
    .auth-stage::after { background: linear-gradient(180deg, rgba(6, 16, 52, .3) 0%, rgba(6, 16, 52, 0) 30%, rgba(6, 16, 52, .35) 100%); }
    .auth-app-download--desktop { display: none; }
    .auth-app-download--mobile {
        display: block;
        margin: 20px 0 0;
        padding: 15px;
        border: 1px solid rgba(169, 210, 255, .48);
        border-radius: 16px;
        background: linear-gradient(135deg, #0d2d70, #174fb0);
        box-shadow: 0 10px 22px rgba(10, 48, 113, .15);
    }
    .auth-app-download--mobile .auth-app-copy p { margin-bottom: 12px; }
}

/* The public header wraps to two rows here (public-tracking.css). */
@media (max-width: 767.98px) {
    .auth-page { --auth-head: 114px; }
}

@media (max-width: 575.98px) {
    .auth-page {
        --auth-pad-x: 18px;
        --auth-card-top: 26px;
        --auth-card-bottom: 20px;
        --auth-logo: 62px;
        --auth-title: 24px;
        --auth-subtitle-end: 22px;
        --auth-social: 48px;
    }
    .auth-stage-inner { padding-top: calc(var(--auth-head) + 170px); }
    .auth-bg { --auth-bg-x: 6%; --auth-bg-y: calc(var(--auth-head) - 120px); --auth-bg-h: 600px; }
    .auth-card { border-radius: 22px; }
    .auth-subtitle { font-size: 14px; }
    .auth-social { gap: 10px; }
    .auth-app-download--mobile { margin-top: 18px; padding: 14px; }
    .auth-app-mark { width: 32px; height: 32px; }
    .auth-app-copy h2 { font-size: 15px; }
    .auth-app-copy p { font-size: 11.5px; }
    .auth-store-badge { padding-inline: 6px; }
    .auth-store-badge i { font-size: 20px; }
    .auth-store-badge small { font-size: 7px; }
    .auth-store-badge strong { font-size: 10.5px; }
}
