:root {
    --bg: #050507;
    --panel: rgba(18, 18, 23, .58);
    --panel-2: rgba(30, 30, 38, .42);
    --line: rgba(255, 255, 255, .10);
    --line-strong: rgba(255, 255, 255, .16);
    --text: #f6f7fb;
    --muted: #a9acb7;
    --muted-2: #7d818c;
    --accent: #ff2438;
    --accent-2: #930014;
    --accent-soft: rgba(255, 36, 56, .12);
    --success: #68e39f;
    --danger: #ffc2c9;
    --shadow: 0 40px 120px rgba(0, 0, 0, .62);
    --font-fa: primary-font, Tahoma, "Segoe UI", sans-serif;
    --font-latin: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    font-family: var(--font-fa);
    background:
        radial-gradient(circle at 15% 18%, rgba(255, 20, 45, .24), transparent 28%),
        radial-gradient(circle at 85% 82%, rgba(180, 0, 20, .16), transparent 25%),
        linear-gradient(135deg, #020204 0%, #09090d 46%, #030305 100%);
    color: var(--text);
}

button, input, textarea, select { font-family: inherit; }
a { color: inherit; }

body::before {
    content: "";
    position: fixed;
    inset: -20%;
    pointer-events: none;
    opacity: .7;
    background:
        repeating-linear-gradient(120deg, transparent 0 70px, rgba(255,255,255,.014) 71px 72px),
        repeating-linear-gradient(30deg, transparent 0 110px, rgba(255,0,30,.018) 111px 112px);
    animation: driftGrid 18s linear infinite alternate;
}

.ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(28px);
    opacity: .5;
    mix-blend-mode: screen;
}

.orb.one {
    width: 420px;
    height: 420px;
    left: -110px;
    top: 6%;
    background: radial-gradient(circle at 35% 35%, rgba(255,58,74,.95), rgba(130,0,12,.12) 70%);
    animation: floatOne 12s ease-in-out infinite;
}

.orb.two {
    width: 520px;
    height: 520px;
    right: -180px;
    bottom: -120px;
    background: radial-gradient(circle at 50% 50%, rgba(165,0,20,.62), rgba(0,0,0,0) 70%);
    animation: floatTwo 16s ease-in-out infinite;
}

.beam {
    position: absolute;
    width: 58vw;
    height: 120px;
    right: -12vw;
    top: 18vh;
    transform: rotate(-48deg);
    background: linear-gradient(90deg, transparent, rgba(255,24,48,.42), rgba(255,67,80,.75), transparent);
    filter: blur(10px);
    opacity: .5;
    animation: beamPulse 7s ease-in-out infinite;
}

.scene,
.auth-scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    perspective: 1400px;
}

.shell,
.auth-shell {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.025) 35%, rgba(255,255,255,.055));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.12);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform .18s ease-out;
}

.shell {
    width: min(1220px, 96vw);
    min-height: 390px;
    transition:
        transform .18s ease-out,
        width .55s cubic-bezier(.22,.8,.2,1),
        min-height .55s cubic-bezier(.22,.8,.2,1);
}

/* در حالت انتخاب شرکت، شیشه اصلی جمع‌وجور است؛
   با انتخاب شرکت برای فرم ورود به صورت نرم باز می‌شود. */
.shell.login-open {
    width: min(1080px, 94vw);
    min-height: 630px;
}

.auth-shell {
    width: min(920px, 94vw);
    min-height: 590px;
}

.shell::before,
.auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(255,255,255,.08), transparent 24%, transparent 75%, rgba(255,55,75,.08)),
        radial-gradient(circle at 72% 28%, rgba(255,36,56,.10), transparent 32%);
}

.shell::after,
.auth-shell::after {
    content: "";
    position: absolute;
    top: 0;
    left: -30%;
    width: 22%;
    height: 100%;
    transform: skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.11), transparent);
    animation: glassSweep 9s ease-in-out infinite;
    pointer-events: none;
}

.topbar {
    position: relative;
    z-index: 3;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0;
    font-family: var(--font-latin);
    font-size: 13px;
    letter-spacing: .3px;
    color: #eef0f5;
    direction: ltr;
}


.secure {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.secure-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 14px rgba(104,227,159,.7);
}

.stage {
    position: relative;
    height: 300px;
    transition: height .55s cubic-bezier(.22,.8,.2,1);
}

.shell.login-open .stage {
    height: 540px;
}

.view {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 26px 42px 24px;
    opacity: 0;
    visibility: hidden;
    filter: blur(0);
    transform: translateY(24px) scale(.985);
    transition:
        opacity .68s cubic-bezier(.16,1,.3,1),
        transform .72s cubic-bezier(.16,1,.3,1),
        filter .72s cubic-bezier(.16,1,.3,1),
        visibility .68s;
    will-change: opacity, transform, filter;
}

.view.active {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    transform: translateY(0) scale(1);
}

/*
   Focus transition:
   View مقصد بلافاصله جایگزین می‌شود و از حالت شیشه‌ای/تار
   به فوکوس کامل می‌رسد؛ بنابراین هیچ فریم خالی بین دو صفحه نداریم.
*/
.view.focus-enter {
    opacity: .28;
    filter: blur(20px) saturate(.78) brightness(.78);
    transform: translateY(4px) scale(.972);
}

/* یک درخشش شیشه‌ای خیلی ظریف فقط حین فوکوس */
.view.focus-enter::after {
    opacity: .7;
}

.view::after {
    content: "";
    position: absolute;
    inset: 14px 20px;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    border-radius: 24px;
    background:
        linear-gradient(115deg,
            rgba(255,255,255,.055),
            transparent 30%,
            rgba(255,33,58,.035) 72%,
            transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    transition: opacity .58s cubic-bezier(.22,.8,.2,1);
}

.shell.is-switching {
    pointer-events: none;
}

#loginView {
    padding: 42px 52px 38px;
}

.branch-view-center {
    height: 100%;
    display: grid;
    align-items: center;
}

.eyebrow {
    color: #ff5366;
    font-family: var(--font-latin);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    direction: ltr;
}

.branch-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 0;
    width: 100%;
    padding-top: 64px;
    align-items: end;
}

/*
   کارت‌های انتخاب شرکت عمداً باریک شده‌اند.
   لوگو به جای قرار گرفتن داخل کارت، روی خط بالایی کارت می‌نشیند.
*/
.branch-card {
    position: relative;
    height: 118px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% -5%, rgba(255,255,255,.09), transparent 58%),
        linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.016));
    color: white;
    cursor: pointer;
    overflow: visible;
    isolation: isolate;
    transform-style: preserve-3d;
    box-shadow:
        0 18px 40px rgba(0,0,0,.20),
        inset 0 1px 0 rgba(255,255,255,.08);
    transition: border-color .35s, box-shadow .35s, transform .18s ease-out, background .35s;
}


.logo-fallback {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 78px;
    height: 58px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.16);
    background:
        linear-gradient(145deg, rgba(255,69,87,.26), rgba(120,0,18,.20)),
        rgba(255,255,255,.035);
    box-shadow:
        0 12px 26px rgba(0,0,0,.34),
        inset 0 1px 0 rgba(255,255,255,.16),
        0 0 26px rgba(255,33,56,.10);
    color: #fff;
    font-family: var(--font-latin);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1.8px;
    transition: opacity .25s ease, transform .35s ease;
}

.logo-wrap.has-logo .logo-fallback {
    position: absolute;
    opacity: 0;
    transform: scale(.82);
}

.branch-card--ui-only .logo-fallback {
    background:
        linear-gradient(145deg, rgba(255,96,42,.30), rgba(154,23,0,.18)),
        rgba(255,255,255,.035);
}

.branch-ui-notice {
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 26px;
    width: min(520px, calc(100vw - 30px));
    padding: 13px 18px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 16px;
    background: rgba(16,16,21,.80);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    backdrop-filter: blur(18px) saturate(130%);
    box-shadow: 0 20px 60px rgba(0,0,0,.40), inset 0 1px 0 rgba(255,255,255,.08);
    color: #d9dbe2;
    font-size: 11px;
    line-height: 1.9;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 14px);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s cubic-bezier(.22,.8,.2,1);
}

.branch-ui-notice.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.branch-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.18), transparent 38%);
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
}

.branch-card::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 16%;
    right: 16%;
    bottom: 8px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,15,42,.28);
    filter: blur(16px);
    opacity: 0;
    transition: .35s;
    pointer-events: none;
}

.branch-card:hover {
    border-color: rgba(255,70,88,.38);
    background:
        radial-gradient(circle at 50% -5%, rgba(255,50,70,.10), transparent 58%),
        linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.02));
    box-shadow:
        0 24px 52px rgba(0,0,0,.34),
        0 0 42px rgba(255,21,47,.10),
        inset 0 1px 0 rgba(255,255,255,.14);
}

.branch-card:hover::before,
.branch-card:hover::after { opacity: 1; }

.logo-wrap {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 50%;
    width: min(80%, 162px);
    height: 102px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%) translateZ(48px);
    pointer-events: none;
}

/* یک هاله‌ی بیضی بسیار ظریف خط بالای کارت را زیر لوگو محو می‌کند؛
   در نتیجه لوگو واقعاً روی لبه‌ی Glass دیده می‌شود، نه داخل یک باکس دیگر. */
.logo-wrap::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 118%;
    height: 66%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
        rgba(8,8,12,.96) 0%,
        rgba(8,8,12,.86) 38%,
        rgba(8,8,12,.44) 57%,
        transparent 74%);
    filter: blur(2px);
    opacity: .92;
    transition: opacity .35s, transform .35s;
}

.logo-wrap img {
    position: relative;
    z-index: 2;
    max-width: 100%;
    max-height: 94px;
    object-fit: contain;
    filter:
        drop-shadow(0 12px 12px rgba(0,0,0,.40))
        drop-shadow(0 0 12px rgba(255,35,58,.06));
    transition: transform .38s cubic-bezier(.22,.8,.2,1), filter .35s ease;
    will-change: transform;
}

.branch-card:hover .logo-wrap::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.07);
}

.branch-card:hover .logo-wrap img {
    transform: translateY(-6px) scale(1.065);
    filter:
        drop-shadow(0 18px 16px rgba(0,0,0,.46))
        drop-shadow(0 0 18px rgba(255,38,60,.14));
}

.branch-meta {
    position: absolute;
    z-index: 2;
    left: 16px;
    right: 16px;
    bottom: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #c6c8d0;
    font-family: var(--font-latin);
    font-size: 11px;
    transform: translateZ(24px);
    direction: ltr;
    transition: color .3s, transform .3s;
}

.branch-card:hover .branch-meta {
    color: #eef0f5;
    transform: translateZ(30px);
}

.branch-index {
    color: #ff5e70;
    font-variant-numeric: tabular-nums;
}

.login-layout {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 50px;
    align-items: center;
}

.selected-brand {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,.08);
    background:
        radial-gradient(circle at 50% 30%, rgba(255,38,60,.10), transparent 38%),
        rgba(255,255,255,.025);
    position: relative;
    overflow: hidden;
}

.selected-brand::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    left: 50%;
    bottom: -125px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255,18,45,.38), transparent 70%);
    filter: blur(16px);
}

.selected-logo {
    height: 128px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.selected-logo img {
    max-width: 76%;
    max-height: 118px;
    filter: drop-shadow(0 22px 18px rgba(0,0,0,.35));
    animation: selectedFloat 4.5s ease-in-out infinite;
}

.selected-brand h2 {
    font-size: 24px;
    margin: 0 0 9px;
}

.selected-brand p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.9;
    margin: 0;
}

.login-panel { padding: 8px 6px; }
.login-panel .title,
.auth-title {
    font-size: 30px;
    margin-bottom: 7px;
    font-weight: 700;
}

.login-panel .subtitle,
.auth-subtitle {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.9;
    margin-bottom: 26px;
}

.field,
.auth-field {
    position: relative;
    margin-bottom: 14px;
}

.field label,
.auth-field label {
    display: block;
    color: #d5d7de;
    font-size: 12px;
    margin: 0 4px 8px;
}

.field input,
.auth-field input {
    width: 100%;
    height: 54px;
    outline: none;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.045);
    color: white;
    padding: 0 16px;
    font: inherit;
    font-size: 13px;
    transition: .25s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.field input::placeholder,
.auth-field input::placeholder { color: #777b86; }

.field input:focus,
.auth-field input:focus {
    border-color: rgba(255,62,82,.45);
    background: rgba(255,255,255,.065);
    box-shadow: 0 0 0 4px rgba(255,29,52,.07), inset 0 1px 0 rgba(255,255,255,.05);
}

.input-with-action input { padding-left: 76px; }

.pass-toggle,
.input-action {
    position: absolute;
    left: 9px;
    bottom: 9px;
    height: 36px;
    min-width: 52px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #a8abb4;
    cursor: pointer;
    transition: .2s;
    font-size: 11px;
}

.pass-toggle:hover,
.input-action:hover {
    background: rgba(255,255,255,.05);
    color: white;
}

.captcha-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 12px;
    margin: 10px 0 14px;
}

.captcha-token {
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px 0 16px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px;
    background:
        repeating-linear-gradient(-25deg, rgba(255,255,255,.02) 0 4px, transparent 4px 8px),
        rgba(255,255,255,.04);
    color: #f8f8fb;
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: 14px;
    direction: ltr;
    letter-spacing: 1px;
    user-select: none;
}

.captcha-refresh {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: rgba(255,255,255,.06);
    color: #dfe1e7;
    cursor: pointer;
    transition: .25s;
}

.captcha-refresh:hover {
    background: rgba(255,38,60,.14);
    color: white;
    transform: rotate(25deg);
}

.captcha-refresh.spin { transform: rotate(180deg); }

.actions,
.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

.login-btn,
.auth-btn {
    height: 52px;
    min-width: 160px;
    border: 0;
    border-radius: 16px;
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(120deg, #d70725, #ff3a4f);
    box-shadow: 0 14px 32px rgba(229,0,34,.28), inset 0 1px 0 rgba(255,255,255,.26);
    transition: .25s;
    position: relative;
    overflow: hidden;
}

.auth-btn { width: 100%; }

.login-btn::after,
.auth-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.24), transparent);
    transition: .55s;
}

.login-btn:hover,
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(229,0,34,.38);
}

.login-btn:hover::after,
.auth-btn:hover::after { transform: translateX(120%); }

.text-link,
.auth-link {
    color: #b8bac2;
    text-decoration: none;
    font-size: 11px;
    transition: .2s;
}

.text-link:hover,
.auth-link:hover { color: white; }

.back-btn,
.auth-back {
    z-index: 8;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.045);
    color: #d8dae0;
    height: 40px;
    padding: 0 14px;
    border-radius: 13px;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    backdrop-filter: blur(10px);
    transition: .25s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.back-btn {
    position: absolute;
    top: 25px;
    right: 28px;
}

.back-btn:hover,
.auth-back:hover {
    background: rgba(255,255,255,.08);
    color: white;
    transform: translateY(-1px);
}

.validation-box,
.field-validation-error,
.auth-validation {
    color: var(--danger);
    font-size: 11px;
    line-height: 1.8;
}

.validation-box,
.auth-validation {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(255,62,82,.22);
    background: rgba(185,0,25,.10);
    border-radius: 14px;
}

.validation-box ul,
.auth-validation ul {
    margin: 0;
    padding-right: 18px;
}

.input-validation-error {
    border-color: rgba(255,62,82,.52) !important;
    box-shadow: 0 0 0 4px rgba(255,29,52,.06) !important;
}

.status-toast {
    position: absolute;
    top: 104px;
    left: 50%;
    z-index: 20;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 48px));
    padding: 12px 16px;
    border: 1px solid rgba(104,227,159,.24);
    border-radius: 15px;
    background: rgba(18,70,44,.28);
    color: #c8ffe0;
    font-size: 12px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0,0,0,.28);
    backdrop-filter: blur(14px);
    animation: toastIn .45s ease both;
}

.footer-note {
    position: absolute;
    left: 34px;
    bottom: 18px;
    color: #747781;
    font-family: var(--font-latin);
    font-size: 9px;
    letter-spacing: .5px;
    direction: ltr;
}

/* Shared secondary auth pages */
.auth-content {
    position: relative;
    z-index: 2;
    min-height: 500px;
    padding: 44px 48px 42px;
    display: grid;
    grid-template-columns: .86fr 1.14fr;
    gap: 40px;
    align-items: center;
}

.auth-visual {
    position: relative;
    min-height: 370px;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,.08);
    background:
        radial-gradient(circle at 50% 35%, rgba(255,38,60,.15), transparent 35%),
        linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.018));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px;
}

.auth-visual::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,29,52,.36), rgba(255,29,52,.05) 44%, transparent 70%);
    filter: blur(8px);
    animation: authPulse 5s ease-in-out infinite;
}

.auth-visual::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 1px;
    bottom: 82px;
    background: linear-gradient(90deg, transparent, rgba(255,71,91,.85), transparent);
    box-shadow: 0 0 20px rgba(255,36,56,.45);
}

.auth-symbol {
    position: relative;
    z-index: 2;
    width: 126px;
    height: 126px;
    border-radius: 34px;
    border: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.025));
    box-shadow: 0 24px 70px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.18), 0 0 44px rgba(255,27,50,.12);
    display: grid;
    place-items: center;
    transform: rotate(-6deg);
    animation: authFloat 5s ease-in-out infinite;
}

.auth-symbol svg {
    width: 62px;
    height: 62px;
    fill: none;
    stroke: #ff4054;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 12px rgba(255,36,56,.42));
}

.auth-visual-label {
    position: relative;
    z-index: 2;
    margin-top: 26px;
    color: #e5e6eb;
    font-size: 12px;
    text-align: center;
    line-height: 1.9;
}

.auth-logo {
    position: relative;
    z-index: 2;
    width: min(76%, 250px);
    max-height: 125px;
    object-fit: contain;
    filter: drop-shadow(0 24px 22px rgba(0,0,0,.42));
    animation: selectedFloat 4.5s ease-in-out infinite;
}

.auth-card {
    position: relative;
    padding: 4px 2px;
    animation: authCardIn .55s cubic-bezier(.22,.8,.2,1) both;
}

.auth-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.auth-heading-row .auth-back { flex: 0 0 auto; }

.auth-step {
    display: flex;
    gap: 6px;
    direction: ltr;
    margin-top: 10px;
}

.auth-step span {
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
}

.auth-step span.active {
    background: linear-gradient(90deg, #ff2438, #ff6575);
    box-shadow: 0 0 14px rgba(255,36,56,.28);
}

.auth-note {
    margin-top: 15px;
    color: var(--muted-2);
    font-size: 11px;
    line-height: 1.9;
}

.otp-input {
    direction: ltr;
    text-align: center;
    font-family: var(--font-latin) !important;
    letter-spacing: 12px;
    font-size: 20px !important;
    font-weight: 700;
    padding-right: 28px !important;
}

.password-rules {
    margin: 2px 0 15px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
    color: var(--muted-2);
    font-size: 10px;
    line-height: 1.9;
}

@keyframes driftGrid { to { transform: translate3d(34px, -22px, 0); } }
@keyframes floatOne { 50% { transform: translate(70px, 45px) scale(1.05); } }
@keyframes floatTwo { 50% { transform: translate(-80px, -40px) scale(.94); } }
@keyframes beamPulse { 50% { opacity: .24; transform: rotate(-48deg) translateX(45px); } }
@keyframes glassSweep {
    0%, 22% { left: -34%; opacity: 0; }
    37% { opacity: .7; }
    52%, 100% { left: 120%; opacity: 0; }
}
@keyframes selectedFloat { 50% { transform: translateY(-8px) rotate(.6deg); } }
@keyframes authFloat { 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes authPulse { 50% { transform: scale(1.12); opacity: .7; } }
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 980px) {
    body { overflow: auto; }
    .scene, .auth-scene { padding: 18px; min-height: 100vh; }
    .shell { min-height: 650px; }
    .stage { height: 760px; }
    .shell.login-open { min-height: 720px; }
    .shell.login-open .stage { height: 630px; }
    .branch-grid {
        grid-template-columns: repeat(6, 1fr);
        column-gap: 14px;
        row-gap: 72px;
        padding-top: 58px;
    }
    .branch-card {
        grid-column: span 2;
        height: 108px;
    }
    .login-layout { grid-template-columns: .85fr 1.15fr; gap: 24px; }
    .view { padding: 28px 30px 24px; }
    #loginView { padding: 36px 30px 30px; }

    .auth-shell { min-height: 680px; }
    .auth-content { grid-template-columns: .8fr 1.2fr; gap: 24px; padding: 36px 30px; }
}

@media (max-width: 720px) {
    .scene, .auth-scene { padding: 10px; }
    .shell, .auth-shell { width: 100%; border-radius: 26px; }
    .shell { min-height: 840px; }
    .shell.login-open { min-height: 780px; }
    .auth-shell { min-height: 760px; }
    .topbar { height: 74px; padding: 0 20px; }
    .secure { display: none; }
    .stage { height: 760px; }
    .shell.login-open .stage { height: 700px; }
    .view { padding: 24px 18px; }
    #loginView { padding: 28px 18px; }
    .branch-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 12px;
        row-gap: 68px;
        padding-top: 56px;
    }
    .branch-card {
        grid-column: span 1;
        height: 100px;
        border-radius: 20px;
    }
    .logo-wrap { width: min(74%, 136px); height: 86px; }
    .logo-wrap img { max-height: 78px; }
    .login-layout { grid-template-columns: 1fr; gap: 18px; align-content: start; }
    .selected-brand { min-height: 180px; padding: 18px; }
    .selected-logo { height: 70px; margin-bottom: 8px; }
    .selected-logo img { max-height: 72px; }
    .selected-brand p { display: none; }
    .login-panel .title, .auth-title { font-size: 25px; }
    .captcha-row { grid-template-columns: 1fr; }
    .actions, .auth-actions { align-items: stretch; flex-direction: column; }
    .login-btn { width: 100%; }
    .footer-note { display: none; }
    .status-toast { top: 86px; }

    .auth-content {
        min-height: 650px;
        grid-template-columns: 1fr;
        align-content: start;
        padding: 26px 18px 30px;
        gap: 20px;
    }

    .auth-visual { min-height: 180px; padding: 18px; }
    .auth-symbol { width: 90px; height: 90px; border-radius: 26px; }
    .auth-symbol svg { width: 46px; height: 46px; }
    .auth-visual-label { margin-top: 14px; }
    .auth-logo { max-height: 82px; width: min(70%, 220px); }
    .auth-heading-row { margin-bottom: 18px; }
}

@media (max-width: 460px) {
    .branch-grid { row-gap: 62px; padding-top: 54px; }
    .branch-card { height: 94px; border-radius: 18px; }
    .logo-wrap { width: min(72%, 122px); height: 80px; }
    .logo-wrap img { max-height: 72px; }
    .branch-meta { font-size: 9px; left: 12px; right: 12px; bottom: 11px; }
    .auth-heading-row { display: block; }
    .auth-heading-row .auth-back { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ===== Single-row company layout override ===== */
@media (min-width: 981px) {
    .shell {
        width: min(1220px, 96vw);
        min-height: 390px;
    }

    .stage {
        height: 300px;
    }

    .branch-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 16px;
        padding-top: 64px;
    }

    .branch-card {
        grid-column: auto;
        width: auto;
        min-width: 0;
        height: 118px;
    }
}

@media (max-width: 980px) and (min-width: 721px) {
    .shell {
        min-height: 520px;
    }

    .stage {
        height: 430px;
    }

    .branch-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 16px;
        row-gap: 72px;
        padding-top: 58px;
    }

    .branch-card {
        grid-column: auto;
        width: auto;
        min-width: 0;
        height: 108px;
    }
}

@media (max-width: 720px) {
    .shell {
        min-height: 650px;
    }

    .stage {
        height: 560px;
    }

    .branch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 68px;
        padding-top: 56px;
    }

    .branch-card {
        grid-column: auto;
        width: auto;
        min-width: 0;
        height: 100px;
    }
}

@media (max-width: 460px) {
    .shell {
        min-height: 650px;
    }

    .stage {
        height: 560px;
    }

    .branch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 62px;
        padding-top: 54px;
    }

    .branch-card {
        height: 94px;
    }
}
