/* ============================================
   Login Page Styles
   ============================================
   Note: This file is loaded separately on login page only.
   It uses CSS variables from _variables.css (loaded via app.css).
   ============================================ */

/* ============================================================================
   The split: brand panel on the START edge, form beside it (2026-09-16)
   ============================================================================
   This page used to be one card centred on `background: var(--primary-fill)`,
   and that single line was most of what made it read as a different product
   from the app.

   --primary-fill is the brand as a FILL: the thing a LABEL SITS ON, tuned at
   the size of a button and measured against --on-primary-fill. Stretched to a
   whole viewport it gave two opposite extremes from one declaration — in
   ليموني's light theme a flat #0b333d wall with NO lime anywhere on the page,
   and in its dark theme a solid #b6e561 wall, 1440x900 of it. Neither is what
   the app looks like, where the lime is an ACCENT on dark teal chrome beside
   bright content.

   So the page is laid out the way the app is: the design's own --sidebar-bg
   on the start edge carrying the «ت» mark and the name, --bg beside it
   carrying the form. Same surfaces, same brand, same active-lime on the one
   button that matters.

   Every colour below is a TOKEN — including the glow, which is mixed from
   --nav-active-a rather than written as an rgba. A hardcoded lime here would
   paint ليموني's accent onto بنفسجي, نيلي and أخضر (CLAUDE.md rule 40). */
/* The FORM is the bigger half — 65/35 at a desktop width, where it was 49/51.
   A floor and a cap rather than two `fr`s, because neither side is elastic:
   .login-wrapper caps the card at 448px, so a wider form track only adds
   breathing room, while the brand panel has a hard content width and a
   proportional track would crush it.

   Why 28rem. The longest value line needs 258.9px of text plus the 34px icon
   and its 13.6px gap — 306.5px of content — and the panel's padding is
   `4.5vw` a side. That padding SHRINKS as the viewport narrows, so a
   fixed-width panel gets ROOMIER on a smaller screen, not tighter: the same
   416px panel wraps at 1440 and fits at 1024. The binding case is therefore
   the WIDEST viewport (padding capped at 4.5rem -> 450.5px needed), and the
   floor only takes over below ~1317px where the padding is small enough that
   448px is comfortable. Verified from 1920 down to 901 in both locales.

   Re-measure if the three login.brand.point* strings change — they are what
   the 258.9px is. The cap keeps a very wide screen from spending 900px on a
   dark column. Below 900px the block at the end of this file folds the whole
   thing to one column and none of this applies. */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: clamp(28rem, 34%, 42rem) 1fr;
    align-items: stretch;
    background: var(--bg);
    position: relative;
    padding: 0;
}

.login-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.25rem;
    /* Scaled with the column when the form took the bigger half. This was
       `clamp(2rem, 4.5vw, 4.5rem)`, sized for a panel that was ~51% of the
       viewport; on a 34% one it ate a quarter of the panel's own width.

       The ENGLISH value lines are the binding case, not the Arabic ones —
       «كل ملفات القضايا والأطراف في مكان واحد» is a good deal shorter than
       "Every case file, party and document in one place". At 4.5vw two of the
       three wrapped at every width from 1440 down; at 2.4vw they still wrapped
       in a 1100-1280 band; at 2vw both locales sit on one line from 2560 down
       to 901. Measured by counting each text node's line boxes with a Range on
       the rendered page — an element-height test does not work here, because
       an <li> holds an icon chip taller than its own text.

       Re-measure if the login.brand.point* strings change, in ENGLISH. */
    padding: 3rem clamp(1.35rem, 2vw, 2.5rem);
    background: var(--sidebar-bg);
    /* Two soft lifts of the design's own active colour. color-mix, not rgba:
       the accent differs per design and only the token knows it. */
    background-image:
        radial-gradient(90% 60% at 85% 8%, color-mix(in srgb, var(--nav-active-a) 22%, transparent), transparent 62%),
        radial-gradient(70% 55% at 5% 96%, color-mix(in srgb, var(--nav-active-a) 10%, transparent), transparent 70%);
    color: var(--sidebar-text);
}

/* The «ت» exactly as the sidebar's brand block builds it — a MASK over a
   filled box, so one cached file serves every design and a new design adds no
   image. INVERTED here (the design's --logo-fg as the box, --logo-bg as the
   letter) because the panel is --sidebar-bg, which is the same colour as
   --logo-bg: the rail's own arrangement would paint an invisible box.
   NEVER WRITE `--` INSIDE tibyan-mark.svg's COMMENT — see CLAUDE.md. */
.login-brand-mark {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 76px;
    block-size: 76px;
    border-radius: 21px;
    background: var(--logo-fg);
    box-shadow: 0 8px 24px var(--nav-active-shadow);
    /* The head is a plain block here, so the mark stacks above the name and
       this is the gap between them. The band below 900px zeroes it and lays
       the head out as a row instead. */
    margin-block-end: 1.5rem;
}

.login-brand-mark::before {
    content: "";
    inline-size: 62%;
    block-size: 62%;
    background: var(--logo-bg);
    -webkit-mask: url('/imgs/icons/tibyan-mark.svg') center / contain no-repeat;
    mask: url('/imgs/icons/tibyan-mark.svg') center / contain no-repeat;
}

.login-brand-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.login-brand-points li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--sidebar-text);
    font-size: 1rem;
}

.login-brand-points i {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 34px;
    block-size: 34px;
    border-radius: var(--radius-icon-btn);
    background: var(--sidebar-hover-bg);
    border: 1px solid var(--sidebar-line);
    color: var(--logo-fg);
    font-size: 0.9rem;
}

/* =============================================================================
   The CORNER — language, then theme (2026-09-16)
   =============================================================================
   ONE fixed box holding both buttons, not two fixed buttons with an offset
   each: the row keeps the pair's gap and order with no arithmetic, and a flex
   row follows the page direction — so the language button, first in the
   markup, sits on the side toward the form in both locales while the theme
   button keeps the corner. error.html wears the same box around its theme
   button alone.

   inset-inline-end, not `right`: with the brand panel on the START edge, a
   physical right pinned this to the panel in Arabic and to the form in
   English — and on a phone, where the panel folds into a band, it landed
   directly on top of the «ت» mark. The logical edge is always the one the
   panel is NOT on.

   The three numbers are custom properties on the page because the band
   below 900px keeps the box's footprint clear from them. */
.login-page {
    --login-corner-edge: 1rem;
    --login-corner-size: 48px;
    --login-corner-gap: 0.5rem;
}

.login-corner {
    position: fixed;
    inset-block-start: var(--login-corner-edge);
    inset-inline-end: var(--login-corner-edge);
    z-index: var(--z-fixed, 1030);
    display: flex;
    gap: var(--login-corner-gap);
}

/* iOS: push the pair below the status bar / notch. Not gated on display-mode
   — see "iOS PWA SAFE-AREA" in _layout.css. */
.login-corner {
    inset-block-start: calc(var(--login-corner-edge) + env(safe-area-inset-top, 0px));
}

/* The status-bar strip, as .app-topbar's band (see "iOS PWA SAFE-AREA" in
   _layout.css): the app's own home-screen icon draws the clock and battery in
   WHITE, and above 900px — an iPad in landscape — the top of the form side is
   --bg, near-white in the light theme. Exactly the inset tall, in the brand
   panel's own colour, so over the panel it cannot be seen at all. Below 900px
   the page already opens on the dark band. Gated, like that band.

   A pseudo-element on the grid container stays out of the grid: a fixed
   child takes no cell. Under the corner's buttons, which sit below the inset
   anyway. */
@media (display-mode: standalone) and (min-width: 900.02px) {
    .login-page::before {
        content: "";
        position: fixed;
        inset-inline: 0;
        inset-block-start: 0;
        block-size: env(safe-area-inset-top, 0px);
        background: var(--sidebar-bg);
        z-index: var(--z-sticky, 1020);
        pointer-events: none;
    }
}

/* «العودة إلى الصفحة الرئيسية» is not offered inside the installed app: its
   home is the app, and the marketing page there is a detour
   (plans/implemented/pwa-install-support-plan.md, D4). A browser tab keeps it. */
@media (display-mode: standalone) {
    .login-home-link {
        display: none;
    }
}

/* One look for both buttons. The colours are .btn-light's, which
   _components.css maps to --card / --border / --text — the one surface that
   reads everywhere this pair can sit: over --bg in either theme on a desktop,
   and over the band's --sidebar-bg in either theme on a phone.

   Geometry goes through .btn's own variables (CLAUDE.md rule 36). The padding
   is the one that mattered: .btn pads 1.25rem a side, and a border-box can
   never be narrower than its padding plus its border, 42px — so the 40px phone
   button this replaced drew 42x40, and 42x44 under the touch floor. An oval,
   not a circle. */
.theme-toggle-login,
.login-lang-toggle {
    --bs-btn-padding-x: 0;
    --bs-btn-padding-y: 0;
    --bs-btn-border-radius: var(--radius-circle, 50%);
    width: var(--login-corner-size);
    height: var(--login-corner-size);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.2));
    transition: transform var(--transition-normal, 0.2s ease);
}

.theme-toggle-login:hover,
.login-lang-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle-login i {
    font-size: 1.25rem;
}

/* The letter of the language it switches TO, the header's convention. Bold,
   so it carries the weight of the solid icon beside it; line-height 1, so
   what gets centred is the letter rather than a 1.5 line box around it. */
.login-lang-toggle {
    --bs-btn-font-size: 1.1rem;
    --bs-btn-font-weight: 700;
    --bs-btn-line-height: 1;
}

/* «ع» is centred by its INK, not by its line box. Its tail hangs below the
   baseline, so a centred line box put the letter 4.3px low in the 48px circle
   — measured from the pixels, where "E" sat within 0.8px. In em, so it holds
   at both button sizes; keyed to the glyph's own lang, so "E" is untouched.
   Tuned against Segoe UI; a device that draws «ع» in another Arabic face gets
   the same nudge. */
.login-lang-letter:lang(ar) {
    translate: 0 -0.24em;
}

/* Login Wrapper — 448px, not the old clamp(400px, 28vw, 560px): the card no
   longer has the whole viewport to itself, and at 400px its content box is
   328px, where BOTH halves of the role toggle («دخول الموظفين» / «دخول
   الموكلين») wrap to two lines. */
.login-wrapper {
    width: 100%;
    max-width: 448px;
    margin-inline: auto;
    align-self: center;
    padding: 2rem 1.25rem;
}

/* Login Card */
.login-card {
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl, 16px);
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

/* Bootstrap's p-md-5 is 3rem !important, which put the card's content box back
   under the role toggle's floor. A class of our own beats fighting a utility
   with a second !important. */
.login-card-body {
    padding: 2.25rem;
}

[data-theme="dark"] .login-card {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Section headings — Bootstrap's --bs-heading-color never follows
   data-theme (this app sets data-theme, not data-bs-theme), so an unstyled
   h2/h5 renders near-black on the dark card. Pin to the project token. This
   no longer has to make room for .login-title: that is the brand PANEL's
   heading now and is outside .login-card entirely, so the h2/h5 of the
   forgot-password and password-change steps are all this reaches. */
.login-card h1, .login-card h2, .login-card h3,
.login-card h4, .login-card h5, .login-card h6 {
    color: var(--text);
}

/* The product's name, now the head of the BRAND PANEL rather than the first
   line inside the card.
   It is plain --sidebar-text. The clipped-gradient wordmark it replaces was
   carrying the brand colour at the same moment the «ت» mark above it does —
   two brand colours stacked, which reads as decoration rather than identity —
   and it took a --primary-fill / --primary+--accent pair plus a per-theme
   override and a descender-clipping fix to stay legible on two surfaces. The
   mark carries the colour; the name just has to be readable, and on
   --sidebar-bg one token is. */
.login-title {
    font-size: clamp(2rem, 2.4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--sidebar-text);
    margin: 0 0 0.35rem;
}

.login-tagline {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--sidebar-muted);
    margin-bottom: 0;
}

/* Form Controls.
   Mostashar's original rules here were physical (border-right/left + corner
   radii) because its login page is forced LTR. This page is Arabic-default
   RTL: corner radii are left to Bootstrap's own input-group machinery, which
   the bootstrap.rtl.min.css build already mirrors, and each seam rule below
   picks logical vs html[dir]-pinned by what the element's own dir is — see
   the input rule's comment. */
.login-card .form-control {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-normal, 0.2s ease);
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* The icon boxes take the GLOBAL .input-group-text rule (_components.css):
   --bg-secondary fill, --border-strong boundary matching the .form-control
   beside them. A login-scoped rule used to repeat those values with a
   `border:` SHORTHAND — which pinned the add-on to plain --border (invisible
   once the inputs moved to --border-strong: the "no border around the icon"
   bug) and, at (0,2,0), re-added the seam border that .password-toggle's
   border-inline-start: none (_forms.css, (0,1,0)) removes. If login ever
   needs its own add-on styling again, set individual properties, never the
   border shorthand. */

/* Leading icon box: no border on the side facing the input (seamless join).
   Logical is CORRECT here — the <span> inherits the page direction, so its
   inline-end is always the side the input sits on. */
.login-card .input-group > .input-group-text:first-child {
    border-inline-end: none;
}

/* The input's seam side — the one facing the leading icon — is the PAGE's
   start edge. border-inline-start cannot say that here: every login input
   carries dir="ltr" (Latin email/password/code content), and a logical
   property resolves against the ELEMENT's own dir, not the page's — so in
   the Arabic locale it deleted the input's OUTER (left) border and left the
   seam border standing. Same trap as text-align: start (_forms.css header);
   same fix: pin the side to html[dir]. */
html[dir="ltr"] .login-card .input-group .form-control { border-left: none; }
html[dir="rtl"] .login-card .input-group .form-control { border-right: none; }

/* The eye toggle used to be styled here, scoped to .login-card. It moved to
   _forms.css (unscoped) when the /account/security change modal grew the same
   button — a login-scoped rule would have left that one unstyled, and a second
   copy of the rule is how the two drift apart. Nothing about it was ever
   login-specific. */

/* Submit Button */
.login-card .btn-primary {
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-normal, 0.2s ease);
}

/* Accent Button (Forgot Password section). The label is --on-accent: white on
   the light theme's deep accent, dark ink on the dark theme's light one, where
   white measured 2.97:1. The hover darkens that same accent; the #6a3f94 it
   replaces was one fixed colour for both themes. */
.login-card .btn-accent {
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    transition: all var(--transition-normal, 0.2s ease);
}

.login-card .btn-accent:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 85%, #000);
    border-color: color-mix(in srgb, var(--accent) 85%, #000);
    color: var(--on-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.4);
}

.login-card .btn-accent:active:not(:disabled) {
    transform: translateY(0);
}

.login-card .btn-accent:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-card .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
}

.login-card .btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.login-card .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Alerts */
.login-card .alert {
    border-radius: var(--radius-lg, 10px);
    border: none;
    display: flex;
    align-items: center;
}

/* Only the TINT is the login card's own business — it drops the border
   _components.css gives an alert, so it carries its own background. The colour
   is --*-text like every other alert in the app: #dc2626 measured 4.24:1 on
   its own tint and #16a34a 3.00:1, both under the floor, on the one screen
   where the alert IS the message and the reader is locked out while they read
   it. The dark twins go with them, because --*-text already flips. */
.login-card .alert-danger {
    background: rgba(var(--danger-rgb), 0.1);
    color: var(--danger-text);
}

[data-theme="dark"] .login-card .alert-danger {
    background: rgba(var(--danger-rgb), 0.15);
}

.login-card .alert-success {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--success-text);
}

[data-theme="dark"] .login-card .alert-success {
    background: rgba(var(--success-rgb), 0.15);
}

/* Footer Text */
.login-card .border-top {
    border-color: var(--border) !important;
}

/* ============================================
   MFA Verification Section
   ============================================ */

/* MFA Section Container */
#mfaSection {
    animation: fadeIn 0.3s ease-out;
}

/* MFA Icon */
#mfaSection .fa-shield-halved {
    color: var(--primary);
    opacity: 0.9;
}

/* MFA Code Input */
#mfaCode {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5rem;
    font-family: var(--font-mono);
    padding: 1rem;
}

#mfaCode:focus {
    letter-spacing: 0.5rem;
}

/* MFA Hint Text */
#mfaHint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Fallback Options */
#mfaFallbackOptions .btn-link {
    color: var(--primary);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

#mfaFallbackOptions .btn-link:hover {
    color: var(--primary-hover);
    text-decoration: underline !important;
}

/* Resend Timer */
#resendTimer {
    color: var(--text-muted);
    font-size: 0.875rem;
}

#resendOtpBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cancel Button */
#cancelMfaBtn {
    font-size: 0.875rem;
    color: var(--text-muted);
}

#cancelMfaBtn:hover {
    color: var(--text);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .login-title {
        font-size: 1.75rem;
    }
    
    .login-card .card-body {
        padding: 2rem 1.5rem !important;
    }
    
    /* 44px, not the 40 it was: the touch floor (_utilities.css) lifts any
       .btn to 44px tall on a coarse pointer, so a 40px circle became an oval
       on the very devices this block is for. */
    .login-page {
        --login-corner-size: 44px;
    }

    .theme-toggle-login i {
        font-size: 1.1rem;
    }

    .login-lang-toggle {
        --bs-btn-font-size: 1rem;
    }
    
    #mfaCode {
        font-size: 1.25rem;
        letter-spacing: 0.3rem;
    }
    
    #mfaSection .fa-shield-halved {
        font-size: 2.5rem !important;
    }
}
/* ============================================================================
   Role toggle — دخول الموظفين / دخول الموكلين (V18 client login)
   ============================================================================
   A segmented control: one track, two halves, the active half lifted out of
   it. Chosen over two separate buttons because the pair is ONE choice, and
   over a <select> because both options must be readable without opening
   anything.

   Every colour derives from project tokens via color-mix, so both themes are
   covered with no dark-mode override — and deliberately NOT from any --bs-*
   variable: Bootstrap switches on data-bs-theme, which this app never sets, so
   a .btn-outline-* here would keep its light-mode colours forever on a dark
   card. The demo's purple is not adopted; --primary is the app's own.

   Logical properties throughout (inline-size, padding-inline), so the track
   mirrors under RTL with no direction-specific rule.
   ========================================================================= */

.login-role-toggle {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.75rem);
    background: color-mix(in srgb, var(--primary) 5%, var(--card));
}

.login-role-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 44px floor — this is a standalone control a thumb lands on, so it is in
       scope for the tap-target rule (_utilities.css), not the inline-link
       exemption. */
    min-height: 44px;
    padding-block: 0.5rem;
    padding-inline: 0.75rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius-lg, 0.75rem) - 0.25rem);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    /* Named properties, never `all` — a blanket transition here would also
       animate the colour swap on theme change. */
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.login-role-btn:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.login-role-btn.is-active {
    background: var(--card);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Keyboard focus must stay visible on the INACTIVE half too, where there is no
   background change to read. */
.login-role-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .login-role-btn {
        font-size: 0.85rem;
        padding-inline: 0.5rem;
    }
}

/* =============================================================================
   The submit button — the app's ACTIVE nav item (2026-09-16)
   =============================================================================
   «تسجيل الدخول» used to be a plain .btn-primary, which resolves through
   --primary and therefore drew a DIFFERENT button in each theme: dark teal
   #0b333d in ليموني's light, lime #b6e561 in its dark. One action, two
   identities, and in the light theme the page's only accent was missing.

   It takes --nav-active-a/-b + --nav-active-text instead — the exact pair the
   sidebar's current page wears, and the pair every design tunes for a LABEL ON
   THE ACCENT. So it is the same button in both themes and stays the design's
   own colour in all four. Measured on the shipped ليموني: 11.0:1 light, 11.0:1
   dark, against the 4.5 floor.

   Only --bs-btn-* variables plus background-image — never a flat `background`,
   `padding` or `border` (CLAUDE.md rule 36). A flat background would also
   reset background-clip; `border: 0` would make this button 2px shorter than
   every other .btn on the page. The border stays, transparent. */
#loginBtn {
    --bs-btn-bg: transparent;
    --bs-btn-hover-bg: transparent;
    --bs-btn-active-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
    --bs-btn-color: var(--nav-active-text);
    --bs-btn-hover-color: var(--nav-active-text);
    --bs-btn-active-color: var(--nav-active-text);
    background-image: linear-gradient(var(--nav-active-dir), var(--nav-active-a), var(--nav-active-b));
    box-shadow: 0 6px 18px var(--nav-active-shadow);
    font-weight: 600;
}

#loginBtn:hover {
    filter: brightness(1.04);
}

/* =============================================================================
   Below 900px — the panel FOLDS into a band, it does not disappear
   =============================================================================
   display:none was what the mockup did and it is wrong in the build: since the
   name and the tagline moved out of the card, this panel is the only thing on
   the page carrying the brand at all, so hiding it opened a login page with no
   «ت», no «تبيان» and no tagline on every phone.

   900px, not a Bootstrap breakpoint: it is where the two columns stop being
   able to hold a 448px card and a panel wide enough to read. */
@media (max-width: 900px) {
    .login-page {
        grid-template-columns: 1fr;
        /* The band takes what it needs, the FORM row takes everything left,
           and .login-wrapper's own `align-self: center` then centres the card
           in it. This replaced `align-content: start`, which packed both rows
           against the top and left the whole remainder of the screen empty
           under the card.

           Safe on a short phone because `1fr` is `minmax(auto, 1fr)`: the row
           can never be shorter than its content, so when the card plus the
           band exceed the viewport the row simply grows, the centring becomes
           a no-op and the page scrolls. Nothing is ever clipped off the top —
           which is what a plain `center` on a fixed-height row would do. */
        grid-template-rows: auto 1fr;
    }

    .login-brand-panel {
        gap: 0;
        /* The band is at the very top of the screen, so it — not the tree
           below it — is what sits under a notch. */
        padding: calc(1.15rem + env(safe-area-inset-top, 0px)) 1.25rem 1.15rem;
        /* The corner's two buttons float over this band's inline-end side,
           out of flow, so the band keeps their footprint clear itself: the
           edge, two buttons, the gap between them and the same gap again
           before the words. On a narrow phone the tagline then wraps instead
           of running under the language button. */
        padding-inline-end: calc(var(--login-corner-edge) + 2 * var(--login-corner-size) + 2 * var(--login-corner-gap));
    }

    /* mark | (name over tagline) — the .login-brand-words wrapper is what
       keeps the two words a stack instead of a third item in this row. */
    .login-brand-head {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .login-brand-words {
        min-width: 0;
    }

    /* The three value lines are the part that does not survive the fold: they
       are the panel's argument for the product, and a phone opening the login
       page has already chosen it. */
    .login-brand-points {
        display: none;
    }

    .login-brand-mark {
        inline-size: 52px;
        block-size: 52px;
        border-radius: 15px;
        margin-block-end: 0;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-tagline {
        font-size: 0.85rem;
    }
}

/* The band's narrowest floor. Its reserve for the corner is padding, and
   padding counts toward the band's minimum width: edge padding + mark + gap +
   the longest word that cannot wrap ("Management", 82px) + reserve came to
   290px, so a 280px screen (a folded phone's cover display) scrolled sideways
   by 10px in English. The mark and its gap give up 16px: a 274px floor. */
@media (max-width: 300px) {
    .login-brand-mark {
        inline-size: 40px;
        block-size: 40px;
        border-radius: 12px;
    }

    .login-brand-head {
        gap: 0.75rem;
    }
}
