﻿:root {
    --page-bg: #f4f7fb;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --ink: #0b1220;
    --muted: #5d6b82;
    --soft: #e4eaf2;
    --soft-strong: #ccd7e5;
    --primary: #0b5cff;
    --primary-dark: #0743bb;
    --primary-soft: #eaf2ff;
    --success: #0f9f6e;
    --warning: #c77a05;
    --panel-a: #0b1220;
    --panel-b: #12223a;
    --panel-c: #183f7c;
    --danger: #c24141;
    --accent-teal: #8ee8cf;
    --shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.18);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    /* Public Sans is the same font the rest of the app loads (Views/Shared/Sections/_Styles.cshtml)
       - this page has no shared layout, so it loads its own copy (see Login.cshtml <head>). "Inter"
       was never actually loaded here, so it was silently falling back to this same Segoe UI/Arial
       chain anyway. */
    font-family: "Public Sans", "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--page-bg);
    text-rendering: geometricPrecision;
}

/* Arabic text on this page - same target font wwwroot/css/site-rtl.css already declares for RTL
   everywhere else in the app (html.rtl body, input, select, textarea, button), scoped here via the
   dir attribute this page's own <html> tag actually sets, rather than that stylesheet's .rtl
   class. Targets body/input/etc directly (not just [dir="rtl"] on <html>) because those elements
   each carry their own explicit font-family already (see body{} above and .form-control{font:
   inherit} et al) - inheritance alone from <html> would never reach past body's own rule. Cairo is
   loaded in the same <head> font request as Public Sans above, so Arabic no longer silently falls
   back to whatever Arabic glyphs the OS's default UI font happens to ship (usually visibly
   thinner/lighter-weight than Public Sans Bold, which is what made "ريفا" look weaker than "REVA"
   before). */
[dir="rtl"] body,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea,
[dir="rtl"] button {
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

button,
input {
    font: inherit;
}

/* Hidden SVG sprite holding the shared #revaMark symbol and its gradients. */
.reva-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.login-page {
    height: 100%;
    min-height: 100%;
    padding: 32px;
    display: grid;
    place-items: center;
    position: relative;
    /* overflow-y: auto exists ONLY so a genuinely short viewport (a laptop at 1280x720/1366x768,
       or a zoomed-in browser) can still reach .login-shell if IT is taller than the available
       space - content must never be silently clipped. It must react to .login-shell's real height
       only. The decorative glow blobs below used to be direct ::before/::after children of THIS
       element, and both deliberately bleed past its edges for a soft off-canvas look; horizontal
       bleed was already clipped by overflow-x: hidden, but the vertical bleed had nothing to clip
       it, so it silently added to *this* element's own scrollHeight - a phantom ~250px of
       "content" that was actually invisible gradient fade, producing exactly one unwanted
       scrollbar plus a stretch of blank space below the card on any viewport tall enough that
       .login-shell itself did not need to scroll at all. Fixed by moving the blobs onto their own
       .login-page-decor layer (below), clipped independently of this element's own scroll
       calculation - never by shrinking the blobs or hiding this element's real overflow. */
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 16% 16%, rgba(11, 92, 255, 0.16), transparent 28%),
        radial-gradient(circle at 84% 12%, rgba(15, 159, 110, 0.13), transparent 24%),
        linear-gradient(135deg, #f8fbff 0%, #eef3f9 52%, #f6f8fb 100%);
}

/* Purely decorative glow layer, sized to exactly fill .login-page's own box (inset: 0, same
   positioned ancestor, no padding/border of its own) so it never itself overflows .login-page -
   only the ::before/::after blobs inside it bleed past ITS edges, and this layer's own
   overflow: hidden clips that bleed locally, keeping it completely invisible to .login-page's
   scrollHeight/overflow-y: auto above. Sits behind .login-shell (z-index: 1, unchanged) with no
   z-index of its own needed - source order alone puts it behind a later positioned sibling with a
   higher stacking level. aria-hidden in the markup since this is decoration only. */
.login-page-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-page-decor::before,
.login-page-decor::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
}

.login-page-decor::before {
    width: 560px;
    height: 560px;
    left: -230px;
    bottom: -250px;
    background: radial-gradient(circle, rgba(11, 92, 255, 0.12), transparent 66%);
}

.login-page-decor::after {
    width: 720px;
    height: 720px;
    right: -310px;
    top: -340px;
    background: radial-gradient(circle, rgba(24, 63, 124, 0.16), transparent 64%);
}

.login-shell {
    width: min(1160px, 100%);
    min-height: 680px;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
    border: 1px solid rgba(204, 215, 229, 0.8);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(24px);
}

.brand-panel {
    position: relative;
    padding: 52px 54px 44px;
    color: #f8fbff;
    /* Deep navy at the top-left, warming into blue toward the lower-right, with a soft blue glow
       rising from the bottom - the reference's background tone. */
    background:
        radial-gradient(ellipse 70% 55% at 80% 105%, rgba(37, 99, 235, 0.55), transparent 70%),
        radial-gradient(ellipse 60% 40% at 30% 110%, rgba(34, 211, 238, 0.14), transparent 70%),
        linear-gradient(160deg, #0a1730 0%, #0d1f45 45%, #12327a 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
}

/* Subtle technology grid, fading out toward the bottom-right. */
.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(160deg, black 0%, transparent 75%);
    pointer-events: none;
}

/* Rising glow lines near the bottom - restrained, static. */
.brand-panel::after {
    content: "";
    position: absolute;
    inset: auto -10% -8% -10%;
    height: 42%;
    background:
        linear-gradient(112deg, transparent 38%, rgba(96, 165, 250, 0.32) 39%, rgba(96, 165, 250, 0.32) 39.4%, transparent 40%),
        linear-gradient(112deg, transparent 47%, rgba(34, 211, 238, 0.28) 48%, rgba(34, 211, 238, 0.28) 48.3%, transparent 49%),
        linear-gradient(112deg, transparent 55%, rgba(96, 165, 250, 0.18) 56%, rgba(96, 165, 250, 0.18) 56.3%, transparent 57%),
        radial-gradient(circle at 18% 92%, rgba(34, 211, 238, 0.55) 0 2px, transparent 3px),
        radial-gradient(circle at 34% 78%, rgba(96, 165, 250, 0.6) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 52% 88%, rgba(34, 211, 238, 0.5) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 70% 70%, rgba(96, 165, 250, 0.55) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 86% 84%, rgba(34, 211, 238, 0.5) 0 2px, transparent 3px);
    pointer-events: none;
}

/* Faint hexagonal geometric shape in the upper-right (outline only). */
.brand-hex {
    position: absolute;
    top: 40px;
    right: -60px;
    width: 260px;
    height: 260px;
    clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%);
    background: linear-gradient(150deg, rgba(96, 165, 250, 0.22), rgba(96, 165, 250, 0.02));
    pointer-events: none;
}

.brand-hex::before {
    content: "";
    position: absolute;
    inset: 2px;
    clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%);
    background: #0d1f45;
    opacity: 0.92;
}

.brand-header,
.brand-accent-line,
.brand-copy,
.capability-grid,
.brand-footer {
    position: relative;
    z-index: 1;
}

/* Product identity - the dominant element of the panel, as in the reference. */
.brand-header {
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand-mark {
    flex: none;
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 14px 28px rgba(2, 6, 23, 0.45));
}

.brand-wordmark {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* One cohesive wordmark: REVA and ريفا sized/weighted to read as equally strong (Cairo needs a few
   px more than Public Sans to reach the same visual cap-height), a thin, quiet separator with
   breathing room, and the whole line kept LTR/nowrap regardless of page direction. */
.brand-name {
    display: inline-flex;
    align-items: baseline;
    gap: 16px;
    line-height: 1;
    white-space: nowrap;
}

.brand-name-en {
    color: #ffffff;
    font-family: "Public Sans", "Segoe UI", Arial, sans-serif;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.brand-name-sep {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
    font-size: 34px;
    transform: translateY(-2px);
}

.brand-name-ar {
    color: #ffffff;
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.brand-by {
    color: #c7d7f2;
    font-size: 15px;
    font-weight: 400;
    padding-inline-start: 2px;
}

.accent {
    color: var(--accent-teal);
    font-weight: 600;
}

/* Short cyan accent line under the identity block. */
.brand-accent-line {
    display: block;
    width: 44px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #22d3ee, #60a5fa);
    margin-top: -6px;
}

.brand-copy p {
    max-width: 470px;
    margin: 0;
    color: #f1f6ff;
    font-size: 21px;
    line-height: 1.5;
    font-weight: 400;
}

.capability-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.capability-card {
    min-height: 112px;
    padding: 18px 12px 16px;
    border: 1px solid rgba(125, 176, 255, 0.34);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 43, 90, 0.62), rgba(12, 28, 62, 0.62));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 26px rgba(2, 6, 23, 0.28);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
}

.capability-card i {
    color: #5fd9ff;
    font-size: 30px;
    line-height: 1;
}

.capability-card span {
    color: #eaf2ff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.brand-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #d3deef;
    font-size: 14px;
    font-weight: 400;
}

.brand-footer-icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
}

.brand-footer-icon i {
    font-size: 19px;
    color: #ffffff;
}

.login-panel {
    padding: 32px;
    display: grid;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 255, 0.96)),
        var(--surface);
}

.login-card {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid rgba(204, 215, 229, 0.9);
    border-radius: 24px;
    background: var(--surface-strong);
    box-shadow: var(--shadow-md);
}

.login-card-top {
    margin-bottom: 20px;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Same #revaMark artwork as the left panel, scaled down - no container box, exactly as the
   reference shows the small brand above "Welcome Back". */
.login-brand-mark {
    flex: none;
    width: 30px;
    height: 30px;
}

.login-brand-name {
    color: var(--ink);
    font-family: "Public Sans", "Segoe UI", Arial, sans-serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.login-header {
    margin-top: 12px;
}

.login-header h2 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 31px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-header p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 14px;
}

/* The validation summary used to be .login-form's own first grid child, so its 14px gap always
   separated it from the first field even while empty. Now that the summary is a sibling (see
   Login.cshtml), restore that same 14px only for the common empty/no-error case - the non-empty
   case already gets its own margin-bottom below, and giving both at once would double the gap. */
.validation-summary:empty + .login-form {
    margin-top: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1f2a3a;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Default state: clean white surface with a quiet neutral border (the reference's inputs), so the
   blue accent only appears on hover/focus rather than tinting the resting field. */
.input-shell {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #d8e0ea;
    border-radius: 14px;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-shell:hover {
    border-color: #c3cfdd;
}

.input-shell:focus-within {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(11, 92, 255, 0.14);
}

.input-shell > i {
    position: absolute;
    inset-inline-start: 15px;
    color: #7a8799;
    font-size: 20px;
    pointer-events: none;
}

.form-control {
    width: 100%;
    height: 52px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    padding: 0 48px;
    font-size: 15px;
}

.form-control::placeholder {
    color: #93a0b2;
}

.password-field .form-control {
    padding-inline-end: 54px;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 8px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #69778a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: var(--primary-soft);
    color: var(--primary);
    outline: 0;
}

.password-toggle i {
    font-size: 20px;
}

.login-btn {
    width: 100%;
    height: 54px;
    margin-top: 4px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(11, 92, 255, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 38px rgba(11, 92, 255, 0.34);
    filter: saturate(1.08);
}

.login-btn:focus-visible {
    outline: 3px solid rgba(11, 92, 255, 0.24);
    outline-offset: 3px;
}

.login-btn i {
    font-size: 21px;
}


.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--soft);
}

.microsoft-login-btn {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--soft-strong);
    border-radius: 14px;
    background: #ffffff;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.microsoft-login-btn:hover {
    border-color: var(--primary);
    background: #fbfdff;
    color: var(--ink);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.microsoft-login-btn:focus-visible {
    outline: 3px solid rgba(11, 92, 255, 0.24);
    outline-offset: 3px;
}

.microsoft-login-btn i {
    color: #2563eb;
    font-size: 21px;
}

.validation-summary {
    color: var(--danger);
    background: #fff1f1;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.validation-summary:not(:empty) {
    border: 1px solid #f4c7c7;
    padding: 11px 12px;
    /* Now a sibling of .login-form rather than its first grid child (see Login.cshtml - it must
       render even when the password form itself is absent), so its own margin replaces the gap
       .login-form's grid used to provide. Only applied :not(:empty), so an empty summary (the
       common case) contributes no extra spacing, same as before. */
    margin-bottom: 14px;
}

.field-validation {
    display: block;
    min-height: 18px;
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}

.assurance-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--soft);
}

.assurance-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    /* Icon and label always stay together as one unit - the row wraps between items, never
       inside one. */
    white-space: nowrap;
}

.assurance-row i {
    color: var(--success);
    font-size: 16px;
}

[dir="rtl"] .login-btn i {
    transform: scaleX(-1);
}

/* Microsoft-only mode - applied to .login-shell as login-shell--microsoft-only in Login.cshtml,
   driven purely by !Model.IsPasswordLoginAvailable (Development, where the password form is
   always present, never gets this class, so nothing here ever touches it). Additive/scoped only:
   every selector below either targets the modifier class itself or a descendant of it, so the
   existing unqualified .login-shell/.login-panel/.login-card rules above are untouched.

   Placed here, immediately before @media (max-width: 900px), so the plain .login-shell rule
   inside that query - same (0,1,0) specificity as .login-shell--microsoft-only, unchanged, not
   duplicated - still wins at narrower widths exactly as it already does for every other state;
   the modifier only ever widens/narrows the two-column split at the same desktop sizes the base
   .login-shell rule itself applies at. */
.login-shell--microsoft-only {
    /* Gives more of the shell's fixed width back to the branding panel and narrows the auth
       column, so a lighter Microsoft-only card doesn't sit in the same wide flat panel the full
       password form used to fill. */
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.6fr);
}

.login-shell--microsoft-only .login-panel {
    /* Soft, restrained tint (existing --primary-soft/--surface tokens, no new colors) so the
       narrower column reads as an intentional single-provider panel rather than flat white. */
    background:
        radial-gradient(circle at 30% 15%, rgba(11, 92, 255, 0.06), transparent 60%),
        linear-gradient(180deg, var(--primary-soft) 0%, var(--surface) 100%);
}

.login-shell--microsoft-only .login-card {
    /* Compact card for a single button rather than a multi-field form - still fully
       content-driven (no min-height/height added), just a smaller ceiling. */
    max-width: 380px;
}

/* Password AND Microsoft both unavailable - a generic, non-leaking notice (no environment name,
   no configuration/DB details) shown in the card instead of the previous no-action dead end.
   Styled with the existing --warning token (distinct from --danger, used by
   .validation-summary, since this is a system-unavailable state rather than a user input error). */
.microsoft-unavailable-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid #f0d9a8;
    border-radius: 12px;
    background: #fff8ec;
    color: var(--warning);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.microsoft-unavailable-notice i {
    flex: none;
    margin-top: 1px;
    font-size: 20px;
}

/* This threshold was originally 1024px, which is exactly where the real, structural desktop
   scrollbar bug lived: 1024px-wide viewports (a very common laptop/browser width - confirmed
   directly against the real running Login page, not a static reproduction) matched this query,
   dropping .login-shell to a SINGLE-COLUMN stack (branding panel above the login card instead of
   beside it). Stacked, the two sections' heights ADD instead of sharing one row, so total content
   height (measured directly: ~1197px, brand-panel ~510px + login-panel ~687px) badly exceeded any
   normal 700-800px-tall viewport - .login-page's overflow-y: auto then had genuine work to do,
   producing a real, visible scrollbar with no amount of padding/gap trimming able to fix it (this
   is a WIDTH-driven layout switch, not a height/padding budget problem - the two separate
   .validation-summary-related padding trims added previously, further below, address a real but
   DIFFERENT short-HEIGHT case and are unrelated to this one). Confirmed directly (temporarily
   forcing the two-column grid-template-columns back on at 1024px and again at 900px width) that
   the existing two-column layout already fits comfortably at both widths with its normal padding -
   .login-panel's own minmax(420px, ...) floor is what actually constrains how narrow the two-
   column split can go, not this breakpoint's old 1024px choice. Lowered to 900px, comfortably
   below that floor's practical limit, so any genuinely "desktop" width (1024px included) keeps the
   short, side-by-side layout instead of unnecessarily switching to the much taller stacked one;
   only truly narrow tablet-and-below widths still get this stacked treatment. */
@media (max-width: 900px) {
    .login-page {
        padding: 22px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .brand-panel {
        min-height: 430px;
        padding: 42px;
    }

    .brand-copy p {
        max-width: 640px;
    }

    .login-panel {
        padding: 34px;
    }
}

/* Genuinely tall-enough-but-short desktop/laptop viewports (1280x720 - still a common laptop
   resolution - and similar) only needed a little less than the default 32px .login-page/
   .login-panel padding demanded, never a smaller two-column layout. .login-shell's own
   min-height: 680px is the real floor here: trimming .login-panel's padding lets the column
   settle at that floor (confirmed directly - trimming further has no additional effect once the
   floor is reached), and .login-page's own outer padding is the only remaining lever after that.
   Together these remove a small, fixed amount of non-essential OUTER padding only - never text
   size, inputs, buttons, icons, touch targets, or the two-column layout itself - leaving a few
   pixels of safety margin at 720px tall so no scrollbar appears. Scoped to min-width: 901px so it
   never overlaps the width-driven single-column stack above (@media max-width: 900px above,
   lowered from its original 1024px once THAT was confirmed to be the actual structural cause of
   the real scrollbar - see the comment on that query), which already handles its own, much
   taller, stacked layout. Below this height range (e.g.
   1280x600), .login-page's own overflow-y: auto (declared on .login-page above) still takes over
   and scrolls - genuinely short viewports are still allowed to scroll, exactly as required.

   The trims above were tuned against the empty/first-load state only - confirmed directly (a
   failed sign-in attempt, the single most common way a real user actually sees this state) that
   .validation-summary:not(:empty) rendering its error text adds enough height to push
   .login-shell to ~749px, past the ~688px this breakpoint leaves available at 720px tall, so
   .login-page's overflow-y: auto genuinely activates on an otherwise-normal 1280x720 viewport.
   The rules below close exactly that gap: the same small, fixed, non-essential-padding-only trim
   already used above, extended to .login-card's own padding, .login-card-top's spacing below the
   "Welcome Back" heading, .login-form's field gap, and the validation summary's own padding/
   margin - never the error text's size, the summary's visibility, or any input/button/icon.
   Confirmed directly (triggering a real failed-login response at 1280x720, the exact scenario
   that first surfaced this) that this combination removes the scrollbar with a comfortable
   safety margin, not just a 1px squeak-by.

   max-height was originally 760px, chosen only against the empty/short-error case above. That
   left a real gap: measured directly on the real running page (not a static harness) with the
   UNTRIMMED (>760px-tall) layout, a realistic two-line validation message (this app's own
   longer auth-error copy, e.g. the deactivated-account message, wraps to two lines the same way)
   pushes .login-shell to ~793px - taller than the ~763px a short single-line error needs, and
   tall enough that any viewport between ~761px and ~793px (untrimmed, i.e. NOT yet covered by
   this breakpoint) still overflows and scrolls. That is exactly the reported "Bookmark Bar"
   case: a normal laptop viewport that is comfortably above 760px with the toolbar hidden can
   land inside that untrimmed 761-793px gap once the toolbar/bookmark bar takes its ~30-40px, and
   still scroll despite being a perfectly normal desktop height. Raised max-height from 760px to
   800px - just above the measured ~793px worst case, not tied to any one toolbar's exact pixel
   height - so every viewport in the former gap now gets this breakpoint's trims instead of being
   left untrimmed. Confirmed directly that the trims above still comfortably absorb the same
   two-line error even at the bottom of this widened range (measured ~741px trimmed .login-shell
   height with the two-line message at 700px tall, well under the padding/gap trims' own floor),
   so widening the range introduces no new overflow of its own. */
@media (min-width: 901px) and (max-height: 800px) {
    .login-page {
        padding: 16px 32px;
    }

    .login-panel {
        padding: 24px 32px;
    }

    .login-card {
        padding: 22px 28px;
    }

    .login-card-top {
        margin-bottom: 10px;
    }

    .login-form {
        gap: 12px;
    }

    .validation-summary:not(:empty) {
        padding: 8px 12px;
        margin-bottom: 10px;
    }
}

@media (max-width: 720px) {
    .login-page {
        padding: 0;
        display: block;
        overflow: auto;
    }

    .login-shell {
        width: 100%;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* Natural document order on narrow screens: REVA branding first, Login form second - matches
       the approved mobile design. No order/flex reordering here (previously order: -1 flipped the
       login form to render first; that has been removed per the confirmed requirement). */
    .login-panel {
        padding: 22px;
    }

    .brand-panel {
        min-height: auto;
        padding: 34px 22px;
        gap: 22px;
    }

    .brand-header {
        gap: 16px;
    }

    .brand-mark {
        width: 60px;
        height: 60px;
    }

    .brand-name {
        gap: 12px;
    }

    .brand-name-en {
        font-size: 30px;
    }

    .brand-name-sep {
        font-size: 26px;
    }

    .brand-name-ar {
        font-size: 32px;
    }

    .brand-copy p {
        font-size: 17px;
    }

    .capability-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .capability-card {
        min-height: 96px;
        padding: 14px 10px;
    }

    .login-card {
        max-width: none;
        padding: 26px 22px;
        border-radius: 22px;
    }

    /* Developer credit on narrow screens: the sentence wraps to two lines, so balance them
       ("Developed by the TechnoVal / Development Team.") instead of stranding "Team." alone, keep
       the icon top-aligned with the first line, and give the wrapped text a comfortable
       line-height. Text and icon are unchanged. */
    .brand-footer {
        align-items: flex-start;
        gap: 12px;
        line-height: 1.45;
    }

    .brand-footer-icon {
        width: 34px;
        height: 34px;
        margin-top: -1px;
    }

    .brand-footer-icon i {
        font-size: 17px;
    }

    .brand-footer > span:last-child {
        max-width: 24ch;
        text-wrap: balance;
    }
}

@media (max-width: 420px) {
    .login-header h2 {
        font-size: 27px;
    }

    .brand-name-en {
        font-size: 26px;
    }

    .brand-name-ar {
        font-size: 28px;
    }

    /* Stacked, one trust signal per line - both always visible, no overflow at 320px. */
    .assurance-row {
        display: grid;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
