/* Sign-in page. Tokens (colours, fonts) come from style.css; the art side is always dark so it looks the same in both themes. */
body.lg { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); background: var(--bg); overflow-x: hidden; }

/* ------------------------------------------------------------ form side */
.lg-form-side { position: relative; display: grid; place-items: center; padding: 40px clamp(20px, 5vw, 72px); isolation: isolate; }
.lg-form-side::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 40% at 100% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%), radial-gradient(50% 40% at 0% 100%, color-mix(in srgb, var(--dep) 9%, transparent), transparent 70%); }
.lg-card { width: min(100%, 392px); }

.lg-theme { position: absolute; inset-block-start: 18px; inset-inline-end: 18px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow-sm); transition: color .15s, border-color .15s, transform .15s; }
.lg-theme:hover { color: var(--ink); border-color: var(--ink-3); transform: rotate(14deg); }

.lg-brand { display: flex; align-items: center; gap: 12px; margin-block-end: 34px; }
.lg-brand b { display: block; font-size: 15px; line-height: 1.4; }
.lg-brand small { display: block; color: var(--ink-3); font: 500 12px/1.3 var(--font); letter-spacing: .03em; direction: ltr; text-align: start; }
.lg-logo { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #fff; flex: none;
  background: linear-gradient(145deg, #5b74f5, #3a4fd0); box-shadow: 0 8px 20px -6px rgba(67, 97, 238, .65), inset 0 1px 0 rgba(255, 255, 255, .3); }

.lg-card h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; }
.lg-sub { margin: 0 0 26px; color: var(--ink-2); }
.lg-sub.warn { color: var(--warn); }

.lg-form { display: grid; gap: 18px; }
.lg-field { display: grid; gap: 7px; }
.lg-field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lg-input { position: relative; }
.lg-input input { width: 100%; height: 50px; padding: 0 46px 0 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); font: 500 15px/1 var(--font); text-align: right;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, background .15s; }
.lg-input input[type="password"]:not(:placeholder-shown), .lg-input input[type="password"] { letter-spacing: .02em; }
.lg-input input:hover { border-color: var(--ink-3); }
.lg-input input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
.lg-input input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 40px var(--surface) inset; transition: background-color 9999s; }
.lg-input .lg-ic { position: absolute; inset-inline-start: 15px; inset-block-start: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; transition: color .15s; }
.lg-input:focus-within .lg-ic { color: var(--primary); }
.lg-input:has(.lg-eye) input { padding-left: 46px; }
.lg-eye { position: absolute; inset-inline-end: 6px; inset-block-start: 50%; translate: 0 -50%; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s; }
.lg-eye:hover { background: var(--surface-2); color: var(--ink); }
.lg-eye:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; }
.lg-eye .off { display: none; }
.lg-eye[aria-pressed="true"] .on { display: none; }
.lg-eye[aria-pressed="true"] .off { display: block; }
.lg-caps { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--warn); font-size: 12.5px; font-weight: 600; }

.lg-alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--exp-soft); color: var(--exp); border: 1px solid color-mix(in srgb, var(--exp) 28%, transparent); font-size: 13.5px; font-weight: 600; line-height: 1.7; }
.lg-alert[hidden] { display: none; }
.lg-alert svg { flex: none; margin-block-start: 3px; }
.lg-alert.info { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 26%, transparent); }
.lg-alert.show { animation: lg-pop .35s cubic-bezier(.2, .8, .3, 1.2); }
.lg-form.shake .lg-field { animation: lg-shake .45s cubic-bezier(.36, .07, .19, .97); }

/* remember me: a switch */
.lg-remember { display: flex; align-items: center; gap: 11px; width: fit-content; color: var(--ink-2); font-size: 13.5px; cursor: pointer; user-select: none; }
.lg-remember input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lg-switch { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--surface-3); transition: background .2s; flex: none; }
.lg-switch::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: inset-inline-start .2s cubic-bezier(.3, .8, .3, 1); }
.lg-remember input:checked + .lg-switch { background: var(--primary); }
.lg-remember input:checked + .lg-switch::after { inset-inline-start: 19px; }
.lg-remember input:focus-visible + .lg-switch { outline: 2px solid var(--primary); outline-offset: 3px; }

/* submit */
.lg-submit { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; margin-block-start: 4px; border: 0; border-radius: 14px; cursor: pointer; overflow: hidden;
  color: #fff; font: 700 15.5px/1 var(--font); background: linear-gradient(135deg, #5b74f5 0%, #4361ee 45%, #6a4fe0 100%); background-size: 160% 100%;
  box-shadow: 0 12px 26px -10px rgba(67, 97, 238, .8), inset 0 1px 0 rgba(255, 255, 255, .28); transition: transform .15s, box-shadow .2s, background-position .4s, filter .2s; }
.lg-submit::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); transform: translateX(120%); transition: transform .7s; }
.lg-submit:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 16px 30px -10px rgba(67, 97, 238, .9), inset 0 1px 0 rgba(255, 255, 255, .28); }
.lg-submit:hover::after { transform: translateX(-120%); }
.lg-submit:hover .lg-arrow { transform: translateX(-4px); }
.lg-submit:active { transform: translateY(1px) scale(.995); }
.lg-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 3px; }
.lg-submit .lg-arrow { transition: transform .2s; }
.lg-submit .lg-check, .lg-submit .lg-spin { position: absolute; opacity: 0; scale: .5; transition: opacity .2s, scale .25s cubic-bezier(.3, 1.6, .5, 1); }
.lg-submit .lg-spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: lg-rot .7s linear infinite; }
.lg-submit.busy { pointer-events: none; }
.lg-submit.busy .lg-label, .lg-submit.busy .lg-arrow { opacity: 0; transition: opacity .15s; }
.lg-submit.busy .lg-spin { opacity: 1; scale: 1; }
.lg-submit.done { background: linear-gradient(135deg, #1fb58b, #0a8f62); pointer-events: none; }
.lg-submit.done .lg-label, .lg-submit.done .lg-arrow, .lg-submit.done .lg-spin { opacity: 0; }
.lg-submit.done .lg-check { opacity: 1; scale: 1; }
.lg-submit:disabled { filter: grayscale(.6) opacity(.7); cursor: not-allowed; }

.lg-foot { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 26px 0 0; color: var(--ink-3); font-size: 12.5px; }
.lg-foot.ok { color: var(--dep); }
.lg-help { margin: 8px 0 0; text-align: center; color: var(--ink-3); font-size: 12.5px; line-height: 1.8; }

/* staggered entrance */
.lg-in { animation: lg-rise .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 55ms + 60ms); }

/* ------------------------------------------------------------ art side */
.lg-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: clamp(28px, 4vw, 56px); color: #fff; overflow: hidden; isolation: isolate;
  background: radial-gradient(70% 55% at 15% 8%, #3b52d6 0%, transparent 60%), radial-gradient(60% 55% at 92% 88%, #6d3fd6 0%, transparent 62%), linear-gradient(165deg, #0e1646, #070a20); }
.lg-grid { position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 44px 44px;
  mask-image: radial-gradient(75% 65% at 50% 45%, #000 20%, transparent 78%); -webkit-mask-image: radial-gradient(75% 65% at 50% 45%, #000 20%, transparent 78%); }
.lg-blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; }
.lg-blob.b1 { width: 340px; height: 340px; background: #4f6bff; inset-block-start: -90px; inset-inline-start: -70px; animation: lg-drift 16s ease-in-out infinite alternate; }
.lg-blob.b2 { width: 300px; height: 300px; background: #8a4dff; inset-block-end: -80px; inset-inline-end: -60px; animation: lg-drift 19s ease-in-out -6s infinite alternate-reverse; }
.lg-blob.b3 { width: 200px; height: 200px; background: #19c9a0; opacity: .28; inset-block-start: 46%; inset-inline-end: 12%; animation: lg-drift 22s ease-in-out -3s infinite alternate; }
.lg-art .lg-logo { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.lg-art-top { display: flex; align-items: center; gap: 11px; font-weight: 600; letter-spacing: .01em; color: rgba(255, 255, 255, .92); }

.lg-stage { flex: 1; display: grid; place-items: center; min-height: 0; }
.lg-illus { width: min(100%, 540px); height: auto; max-height: 100%; overflow: visible; filter: drop-shadow(0 30px 40px rgba(2, 4, 24, .45)); }
.lg-illus .card { animation: lg-float 7s ease-in-out infinite; }
.lg-illus .c2 { animation-duration: 8.5s; animation-delay: -2s; }
.lg-illus .c3 { animation-duration: 9.5s; animation-delay: -4s; }
.lg-illus .bars rect { transform-box: fill-box; transform-origin: bottom; animation: lg-grow .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d) * 70ms + 400ms); }
.lg-illus .trend { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lg-draw 1.8s cubic-bezier(.4, 0, .2, 1) .9s forwards; }
.lg-illus .trend-glow { opacity: 0; animation: lg-fade 1s ease 2.2s forwards; }
.lg-illus .pulse, .lg-illus .ring { opacity: 0; animation: lg-fade .4s ease 2.5s forwards; }
.lg-illus .ring { transform-box: fill-box; transform-origin: center; animation: lg-fade .4s ease 2.5s forwards, lg-ring 2.4s ease-out 2.6s infinite; }
.lg-illus .seg { animation: lg-fade .6s ease both; }
.lg-illus .s1 { animation-delay: 1s; } .lg-illus .s2 { animation-delay: 1.2s; } .lg-illus .s3 { animation-delay: 1.4s; }

.lg-art-copy h2 { margin: 0 0 8px; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.4; font-weight: 800; }
.lg-art-copy p { margin: 0 0 18px; max-width: 46ch; color: rgba(255, 255, 255, .74); }
.lg-art-copy ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lg-art-copy li { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .88); font-size: 14px; }
.lg-art-copy li svg { flex: none; width: 24px; height: 24px; padding: 5px; border-radius: 50%; background: rgba(111, 231, 193, .18); color: #6fe7c1; box-sizing: border-box; }

/* ------------------------------------------------------------ keyframes */
@keyframes lg-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes lg-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes lg-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes lg-rot { to { transform: rotate(360deg); } }
@keyframes lg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes lg-grow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes lg-draw { to { stroke-dashoffset: 0; } }
@keyframes lg-fade { to { opacity: 1; } }
@keyframes lg-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
@keyframes lg-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 30px) scale(1.15); } }

/* ------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  body.lg { grid-template-columns: minmax(0, 1fr); }
  .lg-art { display: none; }
  .lg-form-side { align-items: start; padding-block: 72px 32px; min-height: 100dvh; }
  .lg-card h1 { font-size: 26px; }
}
@media (max-height: 640px) and (min-width: 901px) { .lg-art-copy ul { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .lg *, .lg *::before, .lg *::after { animation: none !important; transition-duration: .01s !important; }
  .lg-illus .trend { stroke-dashoffset: 0; } .lg-illus .trend-glow, .lg-illus .pulse, .lg-illus .seg { opacity: 1; }
}
