/* Fix 90-3: страница входа — бренд слева, форма справа, анимированный фон. Тема — через html[data-theme]. */
body.jd-login-body {
    --jl-bg: #eef3f9;
    --jl-text: #0f172a;
    --jl-muted: #64748b;
    --jl-card: rgba(255, 255, 255, .82);
    --jl-card-border: rgba(255, 255, 255, .9);
    --jl-line: #dbe3ee;
    --jl-input: #ffffff;
    --jl-accent: #2563eb;
    --jl-btn: #0f172a;
    --jl-btn-hover: #1e293b;
    --jl-feature: rgba(255, 255, 255, .62);
    --jl-feature-border: rgba(255, 255, 255, .85);
    --jl-ico-bg: #0f172a;
    --jl-blob-1: rgba(37, 99, 235, .28);
    --jl-blob-2: rgba(14, 165, 233, .22);
    --jl-blob-3: rgba(124, 58, 237, .16);
    min-height: 100vh;
    margin: 0;
    background: var(--jl-bg) !important;
    color: var(--jl-text);
    overflow-x: hidden;
}
html[data-theme="dark"] body.jd-login-body {
    --jl-bg: #0b1120;
    --jl-text: #e5e7eb;
    --jl-muted: #94a3b8;
    --jl-card: rgba(17, 24, 39, .78);
    --jl-card-border: rgba(51, 65, 85, .7);
    --jl-line: #2a3a55;
    --jl-input: #0f172a;
    --jl-accent: #60a5fa;
    --jl-btn: #3b4f7a;
    --jl-btn-hover: #4a6194;
    --jl-feature: rgba(17, 24, 39, .55);
    --jl-feature-border: rgba(51, 65, 85, .6);
    --jl-ico-bg: #374666;
    --jl-blob-1: rgba(37, 99, 235, .3);
    --jl-blob-2: rgba(14, 165, 233, .16);
    --jl-blob-3: rgba(124, 58, 237, .2);
}

/* ---------- Фон: мягко плавающие пятна и сетка ---------- */
.jl-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.jl-blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.jl-blob-1 { width: 46vw; height: 46vw; left: -10vw; top: -14vw; background: var(--jl-blob-1); animation: jlFloat1 22s ease-in-out infinite alternate; }
.jl-blob-2 { width: 38vw; height: 38vw; right: -8vw; top: 30vh; background: var(--jl-blob-2); animation: jlFloat2 26s ease-in-out infinite alternate; }
.jl-blob-3 { width: 34vw; height: 34vw; left: 26vw; bottom: -18vw; background: var(--jl-blob-3); animation: jlFloat3 30s ease-in-out infinite alternate; }
.jl-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(100, 116, 139, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(100, 116, 139, .09) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
}
@keyframes jlFloat1 { to { transform: translate(8vw, 6vh) scale(1.08); } }
@keyframes jlFloat2 { to { transform: translate(-6vw, -8vh) scale(1.12); } }
@keyframes jlFloat3 { to { transform: translate(5vw, -6vh) scale(.94); } }

/* ---------- Раскладка ---------- */
body.jd-login-body main.auth-page.jl-page {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 440px); align-items: center; gap: clamp(32px, 6vw, 96px);
    width: 100%; max-width: 1180px; min-height: 100vh; margin: 0 auto; padding: 48px clamp(20px, 4vw, 48px);
    box-sizing: border-box; background: none !important;
}

/* ---------- Левая часть: бренд ---------- */
.jl-hero { min-width: 0; }
.jl-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
body.jd-login-body .jl-logo { width: 56px; height: 56px; border-radius: 18px; font-size: 21px; box-shadow: 0 12px 30px rgba(15, 23, 42, .22); }
.jl-brand-name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.jl-brand-sub { margin-top: 3px; color: var(--jl-muted); font-size: 14px; }
.jl-title { margin: 0 0 30px; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.jl-title span { background: linear-gradient(90deg, #2563eb, #0ea5e9 55%, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jl-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.jl-feature {
    display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-radius: 18px;
    background: var(--jl-feature); border: 1px solid var(--jl-feature-border);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease;
}
.jl-feature:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15, 23, 42, .12); }
.jl-feature b { display: block; font-size: 15px; margin-bottom: 4px; }
.jl-feature small { display: block; color: var(--jl-muted); font-size: 13px; line-height: 1.4; }
.jl-ico { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: var(--jl-ico-bg); color: #fff; }
.jl-ico svg, .jl-help svg, .jl-input > svg, .jl-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Правая часть: карточка входа ---------- */
.jl-side { display: grid; gap: 14px; min-width: 0; }
body.jd-login-body .auth-card.jl-card {
    max-width: none; width: 100%; padding: 32px; border-radius: 26px; box-sizing: border-box;
    background: var(--jl-card) !important; border: 1px solid var(--jl-card-border) !important;
    -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
    box-shadow: 0 30px 80px rgba(15, 23, 42, .16) !important;
}
html[data-theme="dark"] body.jd-login-body .auth-card.jl-card { box-shadow: 0 30px 80px rgba(0, 0, 0, .45) !important; }
.jl-card-head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.jl-card-head p { margin: 0 0 24px; color: var(--jl-muted); font-size: 14px; line-height: 1.45; }
body.jd-login-body .auth-form.jl-form { gap: 16px; }
body.jd-login-body .jl-form .jl-field { gap: 8px; color: var(--jl-text); font-size: 13px; font-weight: 700; }
.jl-input { position: relative; display: flex; align-items: center; }
.jl-input > svg { position: absolute; left: 14px; color: var(--jl-muted); pointer-events: none; transition: color .2s ease; }
body.jd-login-body .jl-form .jl-input input {
    width: 100%; height: 50px; padding: 0 46px 0 44px; border-radius: 14px; box-sizing: border-box;
    border: 1px solid var(--jl-line) !important; background: var(--jl-input) !important; color: var(--jl-text);
    font-size: 15px; transform: none !important;
}
body.jd-login-body .jl-form .jl-input input:focus { border-color: var(--jl-accent) !important; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14) !important; }
.jl-input:focus-within > svg { color: var(--jl-accent); }
body.jd-login-body .jl-form .jl-field.is-invalid input { border-color: #ef4444 !important; box-shadow: 0 0 0 4px rgba(239, 68, 68, .12) !important; }
body.jd-login-body .jl-form button.jl-eye {
    position: absolute; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    margin: 0; padding: 0; border: 0; border-radius: 10px; background: transparent !important; color: var(--jl-muted); box-shadow: none !important; transform: none !important; cursor: pointer;
}
body.jd-login-body .jl-form button.jl-eye:hover { color: var(--jl-text); background: rgba(100, 116, 139, .12) !important; }
.jl-eye .jl-eye-closed, .jl-eye.is-on .jl-eye-open { display: none; }
.jl-eye.is-on .jl-eye-closed { display: block; }
.jl-caps { display: inline-flex; align-items: center; gap: 6px; color: #d97706; font-size: 12px; font-weight: 700; }
.jl-caps::before { content: "⇪"; font-size: 13px; }
.jl-caps[hidden] { display: none; }
body.jd-login-body .error-message.jl-error {
    min-height: 0; margin: 0; padding: 0; text-align: left; font-size: 13px; font-weight: 600; color: #dc2626;
    max-height: 0; opacity: 0; overflow: hidden; border-radius: 12px;
    transition: max-height .25s ease, opacity .2s ease, padding .25s ease;
}
body.jd-login-body .error-message.jl-error.is-on { max-height: 80px; opacity: 1; padding: 10px 12px; background: rgba(239, 68, 68, .1); }
html[data-theme="dark"] body.jd-login-body .error-message.jl-error { color: #fca5a5; }
body.jd-login-body .jl-form button.jl-submit {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; margin-top: 4px; padding: 0 18px;
    border: 0; border-radius: 14px; background: var(--jl-btn) !important; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
    transition: background-color .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease;
}
body.jd-login-body .jl-form button.jl-submit:hover:not(:disabled) { background: var(--jl-btn-hover) !important; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15, 23, 42, .25); }
body.jd-login-body .jl-form button.jl-submit:active:not(:disabled) { transform: scale(.98); }
body.jd-login-body .jl-form button.jl-submit:disabled { cursor: progress; opacity: .85; }
.jl-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: jlSpin .7s linear infinite; }
.jl-submit.is-busy .jl-spinner { display: inline-block; }
@keyframes jlSpin { to { transform: rotate(360deg); } }
.jl-help { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--jl-line); color: var(--jl-muted); font-size: 13px; line-height: 1.4; }
.jl-help svg { flex: 0 0 auto; color: #229ed9; }

.jl-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.jd-login-body .jl-tools .jd-theme-toggle, body.jd-login-body .jl-tools .jd-scale-control { margin: 0; background: var(--jl-card); border-color: var(--jl-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

/* ---------- Анимации появления и ошибки ---------- */
.jl-in { opacity: 0; transform: translateY(14px); animation: jlIn .6s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: var(--d, 0ms); }
@keyframes jlIn { to { opacity: 1; transform: none; } }
.jl-features .jl-in { animation-name: jlInFeature; }
@keyframes jlInFeature { to { opacity: 1; transform: none; } }
.jl-in.is-shown { opacity: 1; transform: none; animation: none; }
.jl-card.jl-shake { opacity: 1; animation: jlShake .42s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes jlShake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(5px); } 45%, 55% { transform: translateX(-7px); } }

/* ---------- Телефон и планшет ---------- */
@media (max-width: 900px) {
    body.jd-login-body main.auth-page.jl-page { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 28px 16px 32px; align-content: start; max-width: 520px; }
    .jl-brand { margin-bottom: 14px; }
    .jl-title { margin-bottom: 0; font-size: 28px; }
    .jl-features { display: none; }
    body.jd-login-body .auth-card.jl-card { padding: 24px 20px; border-radius: 22px; }
}
@media (max-width: 380px) { .jl-tools { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
    .jl-blob, .jl-in, .jl-card.jl-shake, .jl-spinner { animation: none !important; }
    .jl-in { opacity: 1; transform: none; }
    .jl-feature, body.jd-login-body .jl-form button.jl-submit { transition: none; }
}
html body.jd-login-body main.jl-page .auth-card.jl-card > .jl-card-head.jl-card-head, html body.jd-login-body main.jl-page .jl-card-head h2, html body.jd-login-body main.jl-page .jl-card-head p { background: transparent !important; box-shadow: none !important; border: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }

/* Fix 90-5: созвездия на фоне */
.jl-bg .jl-stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
