/* ==========================================================================
   Login — an immersive dark scene (both themes): a live synapse field
   (canvas, see login.js), soft aurora and grain, a product demo on the left
   and a glass sign-in card with a 3D mark and a light running on its border.
   ========================================================================== */
@property --lg-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

html:has(body.lg-body), body.lg-body { background: #05060b; }
body.lg-body {
  --lg-indigo: #818cf8;
  --lg-teal: #2dd4bf;
  --lg-text: #eceef6;
  --lg-muted: rgba(236, 238, 246, .64);
  --lg-faint: rgba(236, 238, 246, .4);
  --lg-line: rgba(255, 255, 255, .09);
  --lg-ease: cubic-bezier(.2, .8, .2, 1);
  --lg-spring: cubic-bezier(.34, 1.4, .64, 1);
  color: var(--lg-text); color-scheme: dark; overflow-x: hidden;
}
.lg-body ::selection { background: rgba(129, 140, 248, .35); }

/* ---------------- background layers ---------------- */
.lg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.lg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lg-fx i { position: absolute; border-radius: 50%; filter: blur(70px); mix-blend-mode: screen; }
.lg-fx .a1 { width: 640px; height: 640px; left: -200px; top: -240px; background: radial-gradient(closest-side, rgba(99, 102, 241, .5), transparent); animation: lg-drift-a 24s ease-in-out infinite alternate; }
.lg-fx .a2 { width: 580px; height: 580px; right: -180px; bottom: -220px; background: radial-gradient(closest-side, rgba(20, 184, 166, .4), transparent); animation: lg-drift-b 28s ease-in-out infinite alternate; }
.lg-fx .a3 { width: 440px; height: 440px; left: 40%; top: 32%; background: radial-gradient(closest-side, rgba(168, 85, 247, .22), transparent); animation: lg-drift-c 32s ease-in-out infinite alternate; }
.lg-fx::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 35%, rgba(3, 4, 8, .72) 100%); }
.lg-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- layout ---------------- */
.lg-body #app { position: relative; z-index: 1; }
.lg {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr); gap: 40px;
  padding: 0 clamp(24px, 5vw, 88px);
  transition: opacity .45s ease, transform .6s var(--lg-ease), filter .45s ease;
}
.lg.leaving { opacity: 0; transform: scale(1.03); filter: blur(8px); }

/* ---------------- intro ---------------- */
.lg-intro { display: flex; flex-direction: column; min-width: 0; padding: 36px 0 28px; }
.lg-brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; letter-spacing: .08em; animation: lg-rise .7s var(--lg-ease) both; }
.lg-brand img { width: 34px; height: 34px; border-radius: 10px; display: block; box-shadow: 0 0 0 .5px rgba(255, 255, 255, .16), 0 8px 24px -8px rgba(99, 102, 241, .7); }
.lg-intro-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 560px; padding: 28px 0; }
.lg-eyebrow {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 10px; border-radius: 99px;
  font-size: 12.5px; letter-spacing: .04em; color: #dfe3ff; background: rgba(129, 140, 248, .1); box-shadow: inset 0 0 0 .5px rgba(165, 180, 252, .35);
  animation: lg-rise .7s .05s var(--lg-ease) both;
}
.lg-eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--lg-teal); animation: lg-ping 2.4s ease-out infinite; }
.lg-title { margin: 20px 0 0; font-size: clamp(34px, 3.7vw, 54px); line-height: 1.14; font-weight: 700; letter-spacing: -.01em; animation: lg-rise .8s .1s var(--lg-ease) both; }
.lg-title em {
  font-style: normal; background: linear-gradient(100deg, #c7d2fe 0%, #a5f3fc 25%, #5eead4 50%, #a5f3fc 75%, #c7d2fe 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lg-shine 7s linear infinite;
}
.lg-lead { margin: 18px 0 0; max-width: 470px; font-size: 15px; line-height: 1.8; color: var(--lg-muted); animation: lg-rise .8s .16s var(--lg-ease) both; }
.lg-foot { font-size: 12px; color: var(--lg-faint); letter-spacing: .02em; }
.lg-foot-m { display: none; }

/* ---------------- live demo ---------------- */
.lg-demo {
  margin-top: 34px; max-width: 480px; border-radius: 20px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .02));
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .13), 0 30px 80px -30px rgba(0, 0, 0, .85);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  animation: lg-rise .9s .24s var(--lg-ease) both;
}
.lg-demo-head { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-bottom: .5px solid var(--lg-line); font-size: 13px; }
.lg-demo-head img { width: 20px; height: 20px; border-radius: 6px; display: block; }
.lg-demo-head b { font-weight: 600; }
.lg-demo-state { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font-size: 12px; color: var(--lg-faint); }
.lg-demo-state i { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }
.lg-demo-state.live i { background: var(--lg-indigo); animation: lg-blink 1s ease-in-out infinite; }
.lg-demo-dots { margin-left: auto; display: flex; gap: 5px; }
.lg-demo-dots i { width: 6px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .18); transition: width .35s var(--lg-ease), background .35s; }
.lg-demo-dots i.on { width: 18px; background: linear-gradient(90deg, var(--lg-indigo), var(--lg-teal)); }
.lg-demo-body { min-height: 262px; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; transition: opacity .4s ease, transform .4s var(--lg-ease); }
.lg-demo-body.out { opacity: 0; transform: translateY(-6px); }
.lg-bubble {
  align-self: flex-end; max-width: 88%; min-height: 42px; padding: 10px 14px; border-radius: 16px 16px 4px 16px;
  font-size: 14px; line-height: 1.6; background: rgba(129, 140, 248, .16); box-shadow: inset 0 0 0 .5px rgba(165, 180, 252, .3);
}
.lg-caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: #c7d2fe; animation: lg-blink 1s steps(2) infinite; }
.lg-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lg-steps li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--lg-muted); animation: lg-rise .35s var(--lg-ease) both; transition: color .3s; }
.lg-steps li.done { color: var(--lg-text); }
.lg-step-ic { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .06); transition: background .3s, color .3s; }
.lg-steps li.done .lg-step-ic { background: rgba(45, 212, 191, .16); color: #5eead4; animation: lg-pop .35s var(--lg-spring); }
.lg-step-ic .i > svg { width: 12px; height: 12px; stroke-width: 2.4; }
.lg-spin { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .2); border-top-color: #a5b4fc; animation: spin .7s linear infinite; }
.lg-skill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: #e0e7ff;
  background: linear-gradient(135deg, rgba(99, 102, 241, .38), rgba(20, 184, 166, .26)); box-shadow: inset 0 0 0 .5px rgba(165, 180, 252, .45);
}
.lg-skill .i > svg { width: 11px; height: 11px; }
.lg-file {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .12);
  animation: lg-file-in .55s var(--lg-spring) both;
}
.lg-file-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, #6366f1, #0d9488); box-shadow: 0 8px 18px -8px rgba(99, 102, 241, .8); }
.lg-file > div { flex: 1; min-width: 0; }
.lg-file b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-file > div > span { display: block; font-size: 12px; color: var(--lg-faint); }
.lg-file-dl { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: #0b0d14; background: #f5f7ff; }
.lg-file-dl .i > svg { width: 13px; height: 13px; }


/* ---------------- sign-in card ---------------- */
.lg-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 0; }
.lg-card {
  --mx: 50%; --my: 0%; --tx: 0deg; --ty: 0deg;
  position: relative; isolation: isolate; width: min(412px, 100%); padding: 32px 34px 24px; border-radius: 26px;
  background: rgba(11, 13, 21, .66); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 0 0 .5px rgba(255, 255, 255, .1), 0 40px 100px -40px rgba(0, 0, 0, .95), 0 0 90px -34px rgba(99, 102, 241, .45);
  animation: lg-card-in .9s .12s var(--lg-ease) both;
}
.lg-card::before {
  /* a light running around the border */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--lg-ang), transparent 0deg 240deg, rgba(129, 140, 248, .95) 295deg, rgba(94, 234, 212, .95) 330deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: lg-orbit 6s linear infinite;
}
.lg-card::after {
  /* spotlight under the pointer */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(129, 140, 248, .13), transparent 45%);
}
.lg-card:hover::after { opacity: 1; }

/* 3D mark: the logo's cube, built from six faces */
.lg-cube-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto 14px; display: grid; place-items: center; perspective: 520px; }
.lg-cube-glow {
  position: absolute; inset: -22px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(129, 140, 248, .5), rgba(45, 212, 191, .18) 55%, transparent 76%);
  filter: blur(6px); animation: lg-breathe 4.6s ease-in-out infinite; transition: opacity .45s;
}
.lg-cube-float { transform-style: preserve-3d; animation: lg-float 4.6s ease-in-out infinite; }
.lg-cube-tilt { transform-style: preserve-3d; transform: rotateX(var(--ty)) rotateY(var(--tx)); transition: transform .6s var(--lg-ease); }
.lg-cube-pop { transform-style: preserve-3d; transition: transform 1s var(--lg-ease); }
.lg-cube {
  --s: 46px; position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d;
  transform: rotateX(-30deg) rotateY(-45deg); /* the logo's view (indigo left, teal right); also the pose without motion */
  animation: lg-cube-spin 18s linear infinite;
}
.lg-cube i { position: absolute; inset: 0; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38), inset 0 0 14px rgba(255, 255, 255, .16); }
.lg-cube .f1 { transform: translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, rgba(165, 180, 252, .94), rgba(79, 70, 229, .94)); }
.lg-cube .f2 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, rgba(165, 180, 252, .94), rgba(79, 70, 229, .94)); }
.lg-cube .f3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, rgba(94, 234, 212, .94), rgba(13, 148, 136, .94)); }
.lg-cube .f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, rgba(94, 234, 212, .94), rgba(13, 148, 136, .94)); }
.lg-cube .f5 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, #eef2ff, #a5f3fc); }
.lg-cube .f6 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, #312e81, #134e4a); }
.lg-cube-core {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none;
  background: #fff; box-shadow: 0 0 10px 3px rgba(224, 242, 254, .85), 0 0 26px 8px rgba(129, 140, 248, .5);
  animation: lg-float 4.6s ease-in-out infinite; transition: opacity .35s, transform .35s var(--lg-ease);
}
.lg-cube-shadow {
  position: absolute; bottom: 2px; left: 50%; width: 56px; height: 10px; margin-left: -28px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(99, 102, 241, .55), transparent); filter: blur(3px); animation: lg-shadow 4.6s ease-in-out infinite;
}
/* typing a password: the mark dims its light */
.lg-card.pw .lg-cube-glow { opacity: .28; }
.lg-card.pw .lg-cube-core { opacity: .15; }
.lg-card.busy .lg-cube-glow { animation-duration: 1.1s; }
.lg-card.ok .lg-cube-pop { transform: rotateY(360deg) scale(1.16); }
.lg-card.ok .lg-cube-glow { opacity: 1; animation-duration: .9s; }

.lg-card h1 { margin: 0; text-align: center; font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.lg-sub { margin: 8px 0 24px; text-align: center; font-size: 13.5px; color: var(--lg-muted); }

.lg-form { display: flex; flex-direction: column; gap: 14px; }
.lg-form.shake { animation: lg-shake .45s var(--lg-ease); }
.lg-field { position: relative; }
.lg-field > .i { position: absolute; left: 16px; top: 19px; z-index: 1; color: rgba(236, 238, 246, .42); pointer-events: none; transition: color .2s; }
.lg-field input {
  width: 100%; height: 56px; padding: 22px 16px 6px 46px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04); color: #fff; font-size: 15px; outline: none; caret-color: #a5b4fc;
  transition: border-color .2s, box-shadow .25s var(--lg-ease), background .2s;
}
.lg-field input:hover { border-color: rgba(255, 255, 255, .18); }
.lg-field input:focus { border-color: rgba(129, 140, 248, .85); background: rgba(129, 140, 248, .06); box-shadow: 0 0 0 4px rgba(129, 140, 248, .16); }
.lg-field:has(.lg-eye) input { padding-right: 50px; }
.lg-field label {
  position: absolute; left: 46px; top: 17px; font-size: 14.5px; color: rgba(236, 238, 246, .5); pointer-events: none;
  transform-origin: left top; transition: transform .22s var(--lg-ease), color .2s;
}
.lg-field input:focus + label,
.lg-field input:not(:placeholder-shown) + label,
.lg-field input:-webkit-autofill + label { transform: translateY(-10px) scale(.78); }
.lg-field input:focus + label { color: #a5b4fc; }
.lg-field:focus-within > .i { color: #a5b4fc; }
.lg-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #141726 inset; -webkit-text-fill-color: #fff; }
.lg-eye {
  position: absolute; right: 9px; top: 10px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: rgba(236, 238, 246, .5);
  display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s;
}
.lg-eye:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.lg-eye:focus-visible { outline: 2px solid rgba(129, 140, 248, .7); outline-offset: 1px; }
.lg-caps { display: flex; align-items: center; gap: 6px; margin-top: -6px; font-size: 12.5px; color: #fbbf24; }
.lg-caps:empty { display: none; }
.lg-caps .i > svg { width: 14px; height: 14px; }

.lg-submit {
  /* no isolation here: the glow (::before, z-index -1) must sit behind the button, inside the card */
  position: relative; margin-top: 6px; height: 54px; border: 0; border-radius: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 650; letter-spacing: .14em; color: #0a0b12;
  background: linear-gradient(180deg, #ffffff, #e4e8f6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 12px 30px -14px rgba(129, 140, 248, .8);
  transition: transform .15s var(--lg-ease), box-shadow .25s, background .3s;
}
.lg-submit::before {
  /* brand glow underneath, stronger on hover */
  content: ""; position: absolute; inset: 4px 10px -6px; z-index: -1; border-radius: 16px; pointer-events: none;
  background: linear-gradient(90deg, #818cf8, #2dd4bf, #a855f7, #818cf8); background-size: 300% 100%;
  filter: blur(16px); opacity: .55; transition: opacity .3s; animation: lg-shine 5s linear infinite;
}
.lg-submit::after {
  /* light sweep across the face on hover */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(129, 140, 248, .22) 45%, rgba(45, 212, 191, .22) 55%, transparent 65%);
  background-size: 250% 100%; background-position: 130% 0; transition: background-position .8s var(--lg-ease);
}
.lg-submit:hover:not(:disabled)::before { opacity: 1; }
.lg-submit:hover:not(:disabled)::after { background-position: -30% 0; }
.lg-submit:active:not(:disabled) { transform: scale(.985); }
.lg-submit:disabled { cursor: default; }
.lg-submit:focus-visible { outline: 2px solid rgba(165, 180, 252, .9); outline-offset: 3px; }
.lg-submit .i > svg { width: 17px; height: 17px; stroke-width: 2.2; transition: transform .25s var(--lg-ease); }
.lg-submit:hover:not(:disabled) .i > svg { transform: translateX(3px); }
.lg-submit .spinner { width: 16px; height: 16px; border-color: rgba(10, 11, 18, .2); border-top-color: #0a0b12; }
.lg-submit.ok { background: linear-gradient(180deg, #ecfdf5, #a7f3d0); }
.lg-submit.ok .i > svg { transform: none; animation: lg-pop .4s var(--lg-spring); }

.lg-err {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 20px;
  color: #fecaca; background: rgba(239, 68, 68, .1); box-shadow: inset 0 0 0 .5px rgba(248, 113, 113, .4); animation: lg-rise .3s var(--lg-ease);
}
.lg-err .i { margin-top: 2px; color: #f87171; }
.lg-err .i > svg { width: 15px; height: 15px; }
.lg-help { margin-top: 22px; padding-top: 18px; border-top: .5px solid var(--lg-line); text-align: center; font-size: 12.5px; color: var(--lg-faint); }
.lg-trust { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--lg-faint); animation: lg-rise .8s .4s var(--lg-ease) both; }
.lg-trust .i > svg { width: 14px; height: 14px; color: #5eead4; }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .lg { grid-template-columns: minmax(0, 1fr); }
  .lg-intro { display: none; }
  .lg-side { min-height: 100vh; min-width: 0; }
  .lg-card { width: 100%; max-width: 412px; }
  .lg-foot-m { display: block; margin-top: 6px; }
}
@media (max-width: 480px) {
  .lg { padding: 0 16px; }
  .lg-card { padding: 26px 22px 20px; border-radius: 22px; }
}

/* ---------------- motion ---------------- */
@keyframes lg-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes lg-file-in { from { opacity: 0; transform: translateY(10px) scale(.95); } }
@keyframes lg-card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes lg-orbit { to { --lg-ang: 360deg; } }
@keyframes lg-shine { to { background-position: -200% 0; } }
@keyframes lg-ping { 0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, .6); } 80%, 100% { box-shadow: 0 0 0 8px rgba(45, 212, 191, 0); } }
@keyframes lg-blink { 50% { opacity: .25; } }
@keyframes lg-pop { from { transform: scale(.4); } }
@keyframes lg-breathe { 50% { transform: scale(1.1); opacity: .75; } }
@keyframes lg-float { 50% { transform: translateY(-6px); } }
@keyframes lg-shadow { 50% { transform: scaleX(.78); opacity: .6; } }
/* starts at the logo's view: a corner toward the viewer, top face visible */
@keyframes lg-cube-spin { from { transform: rotateX(-30deg) rotateY(-45deg); } to { transform: rotateX(-30deg) rotateY(315deg); } }
@keyframes lg-drift-a { to { transform: translate(140px, 90px) scale(1.12); } }
@keyframes lg-drift-b { to { transform: translate(-120px, -100px) scale(1.08); } }
@keyframes lg-drift-c { to { transform: translate(-160px, 70px) scale(1.2); } }
@keyframes lg-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) {
  .lg-body *, .lg-body *::before, .lg-body *::after { animation: none !important; transition: none !important; }
}
