/* ══ صحنه‌ی کنار کارت ورود ═════════════════════════════════════════════════
   کارتی شناور روی زمینه‌ی یاسی که با چرخشی سه‌بعدی صحنه عوض می‌کند و با کارت
   ورود هم‌قدم است (login-motion.js). حرکت‌های خودِ کارت ورود در login-motion.css. */

:root {
    --lx-ink: #1f1b2e;
    --lx-muted: #615d78;          /* ≥ ۴٫۵ روی سفید */
    --lx-accent: #4f46e5;
    --lx-accent-2: #6a5cf0;
    --lx-navy: #2e2a52;
    --lx-line: #e9e7f8;
}

/* ── چیدمان: کارت فرم و صحنه کنار هم روی دسکتاپ؛ در گوشی اول فرم ── */
.login-split .login-side { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1.75rem; }
@media (min-width: 960px) {
    .login-page.login-split {
        display: grid;
        grid-template-columns: minmax(360px, 420px) minmax(440px, 560px);
        justify-content: center; align-items: center;
        gap: clamp(2.5rem, 5vw, 4.5rem);
        min-height: calc(100vh - 4rem);
        padding-block: 1rem;
        /* «ویدیو و کارت ورود رو در یک راستا قرار بده، بالا و پایین نباشه»: نشان
           شرکت ردیفِ خودش را دارد، بالای کارت؛ کارت ورود و صحنه در ردیف دوم کنار
           هم‌اند و صحنه دقیقاً هم‌قدِ کارت می‌شود — لبه‌ی بالا و پایینشان یکی است. */
        grid-template-rows: auto auto;
        align-content: center;
        row-gap: 1.75rem;
    }
    .login-split .login-side { display: contents; }
    .login-split .login-brand { grid-column: 1; grid-row: 1; justify-self: center; }
    .login-split .login-box { grid-column: 1; grid-row: 2; align-self: stretch; }
    .login-split .lx-stage { grid-column: 2; grid-row: 2; align-self: stretch; min-height: 0; padding-block: 1.5rem; }
}

/* صفحه‌های کوتاه (لپ‌تاپ ۷۲۰ پیکسلی): نشان کوچک‌تر و فاصله‌ها کمتر، تا بی‌اسکرول جا شود */
@media (min-width: 960px) and (max-height: 780px) {
    .login-page.login-split { row-gap: 1rem; padding-block: 0; min-height: calc(100vh - 4rem); }
    .login-split .login-brand .brand-mark-lg { height: 64px; }
}

/* ── صحنه ── */
.lx-stage {
    position: relative; isolation: isolate; overflow: hidden;
    width: 100%; min-height: 560px;
    border-radius: 32px; padding: 2.5rem 1.5rem;
    display: grid; place-items: center;
    background: linear-gradient(150deg, #f6f5ff 0%, #ecebfc 55%, #e3e1fa 100%);
    border: 1px solid #e6e3f8;
    perspective: 1200px;
    user-select: none;
    animation: lx-stage-in 1.1s var(--lx-ease) .25s both;
}
@keyframes lx-stage-in { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
.lx-glow {
    position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; border-radius: 50%;
    inset-block-start: 8%; inset-inline-start: 15%;
    background: radial-gradient(circle, rgba(106, 92, 240, .18) 0%, transparent 65%);
    filter: blur(10px);
}
.lx-ring {
    position: absolute; z-index: -1; border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .95);
    animation: lx-drift 18s ease-in-out infinite alternate;
}
.lx-ring-a { width: 460px; height: 460px; inset-block-end: -260px; inset-inline-start: -170px; }
.lx-ring-b { width: 300px; height: 300px; inset-block-start: -120px; inset-inline-end: -110px; animation-duration: 23s; }
@keyframes lx-drift { to { transform: translate(28px, -18px) rotate(8deg); } }

/* ── کارت شناور: مثل کارت ورود، از عمق با چرخش ظاهر می‌شود ── */
.lx-device {
    position: relative; width: min(340px, 100%);
    border-radius: 34px; background: #ffffff; border: 1px solid #eceaf9;
    box-shadow: 0 30px 70px -20px rgba(64, 52, 170, .35), 0 8px 22px rgba(64, 52, 170, .08);
    padding: 1.25rem 1.4rem 1.2rem;
    transform-style: preserve-3d;
    transform-origin: 50% 80%;
    animation: lx-float 7s ease-in-out infinite;
}
/* the opening plays only until the page settles; otherwise every later turn
   would restart it and the card would blink out and back in */
.login-anim:not(.is-settled) .lx-device { animation: lx-device-in 1.1s var(--lx-ease) .45s both, lx-float 7s ease-in-out 1.6s infinite; }
@keyframes lx-device-in {
    0% { opacity: 0; transform: translateY(40px) rotateX(22deg) rotateY(12deg) scale(.86); filter: blur(6px); }
    60% { opacity: 1; filter: none; }
    100% { opacity: 1; transform: none; }
}
@keyframes lx-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.lx-device.is-turning { animation: lx-turn .85s var(--lx-ease), lx-float 7s ease-in-out infinite; }
@keyframes lx-turn {
    0% { transform: none; }
    42% { transform: rotateY(-16deg) rotateX(5deg) scale(.94); }
    100% { transform: none; }
}
/* رمز اشتباه: صحنه هم با کارت ورود می‌لرزد */
.lx-device.is-shake { animation: lx-shake .5s var(--lx-ease); }
/* ورود موفق: صحنه هم‌پای کارت ورود رو به جلو می‌چرخد و محو می‌شود، کمی دیرتر */
.lx-device.is-entering { animation: lx-device-go 1.05s cubic-bezier(.6, 0, .2, 1) .45s forwards; }
@keyframes lx-device-go {
    0% { transform: none; opacity: 1; }
    38% { transform: rotateY(18deg) rotateX(6deg) scale(.93); opacity: 1; }
    100% { transform: rotateY(-62deg) rotateX(-4deg) translateZ(220px) scale(1.2); opacity: 0; }
}
.lx-stage.is-leaving .lx-ring, .lx-stage.is-leaving .lx-glow { transition: opacity .6s; opacity: 0; }

/* ── میدانِ نقش ── */
.lx-art { position: relative; height: 230px; display: grid; place-items: center; margin-bottom: .6rem; }
.lx-grid {
    position: absolute; inset: 14px 6px;
    background:
        linear-gradient(to right, transparent calc(18% - .5px), var(--lx-line) 18%, transparent calc(18% + .5px),
                        transparent calc(82% - .5px), var(--lx-line) 82%, transparent calc(82% + .5px)),
        linear-gradient(to bottom, transparent calc(22% - .5px), var(--lx-line) 22%, transparent calc(22% + .5px),
                        transparent calc(78% - .5px), var(--lx-line) 78%, transparent calc(78% + .5px));
    opacity: .9;
}
.lx-spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #c9c5ea; animation: lx-blink 4s ease-in-out infinite; }
.lx-spark-a { inset-block-start: 40%; inset-inline-start: 8%; }
.lx-spark-b { inset-block-start: 22%; inset-inline-end: 9%; background: var(--lx-accent); opacity: .55; animation-delay: 1.3s; }
.lx-spark-c { inset-block-end: 16%; inset-inline-end: 22%; width: 4px; height: 4px; animation-delay: 2.4s; }
@keyframes lx-blink { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.4); opacity: .3; } }

.lx-scene {
    position: absolute; inset: 0; display: grid; place-items: center;
    opacity: 0; transform: scale(.86);
    transition: opacity .45s var(--lx-ease), transform .6s var(--lx-ease);
    pointer-events: none;
}
[data-slide="1"] .lx-scene-key, [data-slide="2"] .lx-scene-code, [data-slide="3"] .lx-scene-lock {
    opacity: 1; transform: none; transition-delay: .18s;
}

/* ۱ — صفحه‌ی مدرج و کلید */
.lx-dial { width: 168px; height: 168px; animation: lx-spin 60s linear infinite; }
.lx-dial-out { fill: #fafaff; stroke: #ebe9f8; stroke-width: 1.5; }
.lx-dial-in { fill: #f0eefb; stroke: #e2dff6; stroke-width: 1; }
.lx-ticks circle { fill: #c3bfe4; transition: fill .3s; }
.lx-device.is-typing-user .lx-dial { animation-duration: 6s; }          /* نوشتن نام کاربری: صفحه تندتر می‌چرخد */
.lx-device.is-typing-user .lx-ticks circle { fill: var(--lx-accent-2); }
.lx-core {
    position: absolute; width: 68px; height: 68px; border-radius: 50%;
    display: grid; place-items: center; color: #ffffff;
    background: var(--lx-navy);
    box-shadow: 0 10px 24px rgba(46, 42, 82, .3), inset 0 0 0 6px rgba(255, 255, 255, .08);
}
.lx-pulse { position: absolute; width: 68px; height: 68px; border-radius: 50%; border: 2px solid rgba(79, 70, 229, .45); animation: lx-press 2.6s var(--lx-ease) infinite; }
@keyframes lx-press { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(2.1); opacity: 0; } }
.lx-draw { stroke-dasharray: 60; stroke-dashoffset: 60; }
[data-slide="1"] .lx-core-key .lx-draw { animation: lx-ink 1s var(--lx-ease) .35s forwards; }
@keyframes lx-ink { to { stroke-dashoffset: 0; } }

/* ۲ — کد امن */
.lx-scene-code { grid-auto-flow: column; gap: .7rem; }
.lx-otp { display: flex; gap: .4rem; }
.lx-otp span {
    position: relative; width: 34px; height: 44px; border-radius: 11px;
    display: grid; place-items: center;
    background: #fafaff; border: 1.5px solid #e1def5;
    font-size: 1.15rem; font-weight: 700; color: var(--lx-ink);
    transition: border-color .25s, box-shadow .25s, transform .25s;
}
.lx-otp i { font-style: normal; opacity: 0; transform: translateY(8px); }
.lx-otp b { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--lx-ink); opacity: 0; transform: scale(.2); transition: opacity .2s, transform .25s var(--lx-back); }
[data-slide="2"]:not(.is-typing-pass) .lx-otp i { animation: lx-type .32s var(--lx-ease) forwards; }
[data-slide="2"]:not(.is-typing-pass) .lx-otp span:nth-child(1) i { animation-delay: .45s; }
[data-slide="2"]:not(.is-typing-pass) .lx-otp span:nth-child(2) i { animation-delay: .7s; }
[data-slide="2"]:not(.is-typing-pass) .lx-otp span:nth-child(3) i { animation-delay: .95s; }
[data-slide="2"]:not(.is-typing-pass) .lx-otp span:nth-child(4) i { animation-delay: 1.2s; }
[data-slide="2"]:not(.is-typing-pass) .lx-otp span:nth-child(5) i { animation-delay: 1.45s; }
[data-slide="2"]:not(.is-typing-pass) .lx-otp span { animation: lx-box .4s ease 1.8s forwards; }
@keyframes lx-type { to { opacity: 1; transform: none; } }
@keyframes lx-box { to { border-color: var(--lx-accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); } }
/* نوشتن رمز: به ازای هر حرف یک خانه با یک نقطه پر می‌شود — خودِ حرف هیچ‌جا نیست */
.lx-otp span.is-on { border-color: var(--lx-accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); transform: translateY(-2px); }
.lx-otp span.is-on b { opacity: 1; transform: none; }
.lx-plus { font-size: 1.3rem; color: #b9b5dc; opacity: 0; }
.lx-ok {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #ffffff;
    background: linear-gradient(145deg, var(--lx-accent-2), var(--lx-accent));
    box-shadow: 0 10px 22px rgba(79, 70, 229, .3);
    opacity: 0; transform: scale(.5);
}
[data-slide="2"]:not(.is-typing-pass) .lx-plus { animation: lx-type .3s ease 1.9s forwards; }
[data-slide="2"]:not(.is-typing-pass) .lx-ok { animation: lx-pop .5s var(--lx-back) 2.05s forwards; }
[data-slide="2"]:not(.is-typing-pass) .lx-ok .lx-draw { animation: lx-ink .45s var(--lx-ease) 2.35s forwards; }
.lx-device.is-typing-pass .lx-plus { opacity: 1; transition: opacity .3s; }
@keyframes lx-pop { to { opacity: 1; transform: none; } }

/* ۳ — قفل کارینا و بخش‌های سامانه */
.lx-core-lock { background: linear-gradient(145deg, var(--lx-accent-2), var(--lx-accent)); width: 74px; height: 74px; z-index: 1; }
.lx-core-lock .lx-shackle { transform-box: fill-box; transform-origin: 70% 100%; transition: transform .45s var(--lx-ease); }
[data-slide="3"]:not(.is-entering) .lx-core-lock .lx-shackle { animation: lx-unlock 3.2s var(--lx-ease) .9s infinite; }
.lx-device.is-entering .lx-core-lock .lx-shackle { transform: translateY(-3px) rotate(-18deg); }
@keyframes lx-unlock { 0%, 55%, 100% { transform: none; } 20%, 40% { transform: translateY(-3px) rotate(-14deg); } }
.lx-links { position: absolute; width: 300px; height: 200px; }
.lx-links line { stroke: #dcd9f3; stroke-width: 1.2; stroke-dasharray: 130; stroke-dashoffset: 130; }
[data-slide="3"] .lx-links line { animation: lx-ink .7s var(--lx-ease) .55s forwards; }
.lx-chip {
    position: absolute; padding: .28rem .7rem; border-radius: 999px;
    font-size: .78rem; font-weight: 700; white-space: nowrap;
    background: #ffffff; border: 1px solid #e6e3f7; box-shadow: 0 6px 16px rgba(64, 52, 170, .12);
    color: var(--lx-ink);
    opacity: 0; transform: translate(0, 0) scale(.4);
}
.lx-chip::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: .35rem; vertical-align: middle; background: var(--c, var(--lx-accent)); }
.lx-c1 { --c: #f59e0b; } .lx-c2 { --c: #6a5cf0; } .lx-c3 { --c: #10b981; }
.lx-c4 { --c: #0ea5e9; } .lx-c5 { --c: #e11d48; } .lx-c6 { --c: #334155; }
[data-slide="3"] .lx-chip { animation: lx-seat .7s var(--lx-back) forwards; }
[data-slide="3"] .lx-c1 { animation-delay: .35s; } [data-slide="3"] .lx-c2 { animation-delay: .45s; }
[data-slide="3"] .lx-c3 { animation-delay: .55s; } [data-slide="3"] .lx-c4 { animation-delay: .65s; }
[data-slide="3"] .lx-c5 { animation-delay: .75s; } [data-slide="3"] .lx-c6 { animation-delay: .85s; }
@keyframes lx-seat { to { opacity: 1; transform: translate(var(--x), var(--y)) scale(1); } }

/* ── نوشته‌ها و نقطه‌ها ── */
.lx-copy { position: relative; min-height: 150px; text-align: center; }
.lx-say { position: absolute; inset: 0; opacity: 0; transform: translateY(12px); filter: blur(4px); transition: opacity .45s var(--lx-ease), transform .55s var(--lx-ease), filter .45s; }
[data-slide="1"] .lx-say-1, [data-slide="2"] .lx-say-2, [data-slide="3"] .lx-say-3 { opacity: 1; transform: none; filter: none; transition-delay: .22s; }
.lx-eyebrow { margin: 0 0 .3rem; font-size: .82rem; font-weight: 700; color: var(--lx-ink); }
.lx-head { margin: 0 0 .45rem; font-size: 1.5rem; line-height: 1.45; font-weight: 800; color: var(--lx-ink); }
.lx-note { margin: 0; font-size: .85rem; line-height: 1.7; color: var(--lx-muted); }
.lx-dots { display: flex; justify-content: center; gap: .4rem; margin-top: 1rem; }
.lx-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: #d9d6f1; cursor: pointer; transition: width .35s var(--lx-ease), background .35s; }
.lx-dot.is-on { width: 22px; background: var(--lx-accent); }

/* ── گوشی و تبلت: اول فرم، بعد صحنه‌ای جمع‌وجور زیرش ── */
@media (max-width: 959px) {
    .login-split { gap: 1.25rem; }
    .lx-stage { min-height: 0; max-width: 420px; padding: 1rem .85rem; border-radius: 24px; }
    .lx-device { width: 100%; padding: .75rem .85rem .85rem; border-radius: 22px; animation: none; }
    .login-anim:not(.is-settled) .lx-device { animation: lx-device-in 1s var(--lx-ease) .45s both; }
    .lx-art { height: 150px; margin-bottom: .3rem; }
    .lx-dial { width: 118px; height: 118px; }
    .lx-core, .lx-pulse { width: 56px; height: 56px; }
    .lx-core-lock { width: 60px; height: 60px; }
    .lx-copy { min-height: 118px; }
    .lx-head { font-size: 1.15rem; }
    .lx-note { font-size: .8rem; }
    .lx-ring-a { width: 300px; height: 300px; }
    .lx-scene-code { gap: .4rem; }
    .lx-otp { gap: .25rem; }
    .lx-otp span { width: 28px; height: 38px; border-radius: 9px; font-size: 1rem; }
    .lx-ok { width: 38px; height: 38px; border-radius: 12px; }
    .lx-chip { font-size: .7rem; padding: .22rem .55rem; }
    [data-slide="3"] .lx-scene-lock { transform: scale(.78); }
}

/* ── «کاهش حرکت» ── */
@media (prefers-reduced-motion: reduce) {
    .lx-stage, .lx-device, .lx-ring, .lx-dial, .lx-pulse, .lx-spark,
    .lx-device.is-turning, .lx-device.is-shake, .lx-device.is-entering { animation: none !important; }
    .lx-draw, .lx-links line { stroke-dashoffset: 0; animation: none !important; }
    .lx-otp i, .lx-plus, .lx-ok, .lx-chip { animation: none !important; opacity: 1; transform: none; }
    .lx-chip { transform: translate(var(--x), var(--y)); }
    .lx-say, .lx-scene { transition: opacity .2s linear; transform: none; filter: none; }
    [data-slide="3"] .lx-core-lock .lx-shackle { animation: none; }
}

/* ── گوشی: فرم ورود بی‌اسکرول در صفحه ──
   «صفحه لاگین روی گوشی ریسپانسیو بشه»: on a 320×640 phone the button sat
   below the screen — the 96px logo, the 84px seal and three layers of
   padding took 190px before the card began. On a phone the brand and the
   seal are smaller, the card uses the width with a 16px gutter, and the
   whole form, button included, is on the first screen. */
@media (max-width: 600px) {
    body.no-chrome main.container { padding: 0; }
    .login-page.login-split {
        min-height: 0; justify-content: flex-start;
        padding: 20px 16px 28px; gap: 16px;
    }
    .login-split .login-side { gap: 16px; }
    .login-brand { gap: 0.6rem; }
    .login-split .login-brand .brand-mark-lg { height: 52px; }
    .login-brand-title { font-size: 1rem; }
    .login-brand-sub { font-size: 0.8rem; }
    .login-box { max-width: none; padding: 1.4rem 1.1rem 1.2rem; border-radius: 20px; }
    .login-seal { width: 60px; height: 60px; margin: 0 auto 0.9rem; }
    .login-seal svg { width: 24px; height: 24px; }
    .login-box h1 { font-size: 1.1rem; }
    .login-hint { font-size: 0.84rem; margin-bottom: 1rem; }
    .login-box form input:not([type="checkbox"]):not([type="radio"]) { min-height: 46px; }
    .login-box .btn { min-height: 46px; }
    .login-split .lx-stage { max-width: none; width: 100%; box-sizing: border-box; }
}
/* A phone turned on its side: height is what is short, so the brand shrinks
   to a line and the seal and the hint step aside for the fields. */
@media (max-width: 959px) and (max-height: 500px) and (orientation: landscape) {
    body.no-chrome main.container { padding: 0; }
    .login-split .login-brand { display: none; }
    .login-page.login-split { min-height: 0; justify-content: flex-start; padding: 12px 16px 20px; gap: 12px; }
    .login-split .login-side { gap: 12px; }
    .login-split .login-brand .brand-mark-lg { height: 40px; }
    .login-brand-sub { display: none; }
    .login-box { padding: 1rem 1.25rem 1.1rem; }
    .login-seal, .login-hint { display: none; }
    .login-box h1 { margin-bottom: 0.6rem; }
}
