/* ──────────────────────────────────────────────────────────────
   login-modal.css — Split modal login (HaloWiFi system-aligned)
   Left:  Animated dark command-bridge (matches dashboard hero)
   Right: Warm ivory form panel (matches operator console)
   ────────────────────────────────────────────────────────────── */

:root {
  --lm-radius-xl: 24px;
  --lm-radius-lg: 18px;
  --lm-radius-md: 12px;
  --lm-shadow:
    0 30px 80px -40px rgba(26, 26, 26, 0.22),
    0 12px 30px -16px rgba(26, 26, 26, 0.10);

  /* ── Scene tokens · LIGHT (default) ──────────────────────────
     The command-bridge + recap read these. Dark theme overrides
     them under body.theme-dark below. */
  --lm-hero-text:  #222a39;
  --lm-hero-mute:  rgba(34, 42, 57, 0.62);
  --lm-hero-faint: rgba(34, 42, 57, 0.42);
  --lm-hero-rule:  rgba(34, 42, 57, 0.12);
  --lm-hero-glass: rgba(34, 42, 57, 0.045);
  --lm-pulse:      #2fa968;

  /* Foreground ink for line art (stars / waves / links / guides) */
  --lm-ink-rgb: 46, 56, 78;
  --lm-grain:   rgba(30, 40, 60, 0.05);

  /* Scene + recap backgrounds */
  --lm-stage-grad:
    radial-gradient(ellipse 70% 90% at 92% 12%, rgba(125, 106, 191, 0.16), transparent 58%),
    radial-gradient(ellipse 60% 80% at 8% 90%,  rgba(58, 166, 106, 0.14), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(217, 154, 58, 0.10), transparent 65%),
    linear-gradient(165deg, #f6f4ee 0%, #efece3 58%, #e7e3d7 100%);
  --lm-recap-grad:
    radial-gradient(ellipse 60% 60% at 50% 28%,  rgba(125, 106, 191, 0.16), transparent 60%),
    radial-gradient(ellipse 70% 60% at 14% 100%, rgba(58, 166, 106, 0.13), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 4%,  rgba(217, 154, 58, 0.10), transparent 60%),
    linear-gradient(165deg, #f7f5ef 0%, #f0ede4 60%, #e9e5d9 100%);

  /* Location node accents (deeper for contrast on light) */
  --lm-node-green:  #2f9d63;
  --lm-node-iris:   #6f5fce;
  --lm-node-honey:  #bd8628;
  --lm-node-cobalt: #4a8ccc;

  /* Centre hub chip */
  --lm-hub-fill:   #ffffff;
  --lm-hub-stroke: rgba(34, 42, 57, 0.08);
  --lm-hub-shadow: 0 8px 22px rgba(40, 44, 64, 0.16);

  /* Primary action button (recap) — inverts vs. theme */
  --lm-enter-bg:    #1c2230;
  --lm-enter-bg-h:  #2a3346;
  --lm-enter-ink:   #f4f6f9;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body[data-login="modal"] {
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
  color: var(--ink, #1a1a1a);
  background: var(--bg, #f6f4ef);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dark theme tokens (match shell/sidebar.css) */
body.theme-dark[data-login="modal"] {
  --bg: #12151f;
  --ink: #e7ebf2;
  --ink2: #b8bfcc;
  --mute: #8a93a4;
  --faint: #6b7585;
  --rule: #232a3e;
  --panel: #161b2a;
  --border: #232a3e;
  --surface-2: #1d2538;
  --lm-shadow:
    0 30px 80px -40px rgba(0, 0, 0, 0.6),
    0 12px 30px -16px rgba(0, 0, 0, 0.4);

  /* ── Scene tokens · DARK ──────────────────────────────────── */
  --lm-hero-text:  #ecf0f5;
  --lm-hero-mute:  rgba(236, 240, 245, 0.66);
  --lm-hero-faint: rgba(236, 240, 245, 0.42);
  --lm-hero-rule:  rgba(236, 240, 245, 0.14);
  --lm-hero-glass: rgba(236, 240, 245, 0.06);
  --lm-pulse:      #6cd28e;

  --lm-ink-rgb: 236, 240, 245;
  --lm-grain:   rgba(255, 255, 255, 0.06);

  --lm-stage-grad:
    radial-gradient(ellipse 70% 90% at 92% 12%, rgba(125, 106, 191, 0.36), transparent 58%),
    radial-gradient(ellipse 60% 80% at 8% 90%,  rgba(58, 166, 106, 0.24), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(217, 154, 58, 0.16), transparent 65%),
    linear-gradient(165deg, #1c2230 0%, #141822 60%, #0e1118 100%);
  --lm-recap-grad:
    radial-gradient(ellipse 60% 60% at 50% 28%,  rgba(125, 106, 191, 0.30), transparent 60%),
    radial-gradient(ellipse 70% 60% at 14% 100%, rgba(58, 166, 106, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 4%,  rgba(217, 154, 58, 0.16), transparent 60%),
    linear-gradient(165deg, #1c2230 0%, #141822 60%, #0e1118 100%);

  --lm-node-green:  #6cd28e;
  --lm-node-iris:   #9b8cf0;
  --lm-node-honey:  #e0b46a;
  --lm-node-cobalt: #7fb2e0;

  --lm-hub-fill:   rgba(255, 255, 255, 0.97);
  --lm-hub-stroke: rgba(255, 255, 255, 0.2);
  --lm-hub-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);

  --lm-enter-bg:    #ecedef;
  --lm-enter-bg-h:  #ffffff;
  --lm-enter-ink:   #14171c;
}

/* ── Page ────────────────────────────────────────────────────── */
.lm-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  position: relative;
  background:
    radial-gradient(70% 50% at 12% 8%, rgba(183, 92, 78, 0.06) 0%, transparent 55%),
    radial-gradient(60% 50% at 92% 92%, rgba(58, 166, 106, 0.05) 0%, transparent 55%),
    var(--bg, #f6f4ef);
}

body.theme-dark .lm-page {
  background:
    radial-gradient(70% 50% at 12% 8%, rgba(58, 166, 106, 0.08) 0%, transparent 55%),
    radial-gradient(60% 50% at 92% 92%, rgba(125, 106, 191, 0.06) 0%, transparent 55%),
    var(--bg, #12151f);
}

.lm-page-actions {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.lm-theme-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule, #e8e3d6);
  background: var(--panel, #fff);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--ink2, #4a4843);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lm-theme-btn:hover {
  background: var(--surface-2, #fafbfc);
  border-color: var(--ink, #1a1a1a);
  color: var(--ink, #1a1a1a);
}

body.theme-dark .lm-theme-btn {
  background: var(--panel, #161b2a);
  border-color: var(--rule, #232a3e);
  color: var(--mute, #8a93a4);
}

body.theme-dark .lm-theme-btn:hover {
  border-color: var(--ink, #e7ebf2);
  color: var(--ink, #e7ebf2);
}

.lm-theme-btn .ico {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Modal ───────────────────────────────────────────────────── */
.lm-modal {
  position: relative;
  width: 100%;
  max-width: 960px;
  background: var(--panel, #fff);
  border: 1px solid var(--rule, #e8e3d6);
  border-radius: var(--lm-radius-xl);
  box-shadow: var(--lm-shadow);
  overflow: hidden;
}

body.theme-dark .lm-modal {
  border-color: rgba(255, 255, 255, 0.06);
}

/* ── Split layout ────────────────────────────────────────────── */
.lm-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
}

/* ══════════════════════════════════════════════════════════════
   LEFT — Animated command-bridge (matches dashboard hero)
   ══════════════════════════════════════════════════════════════ */
.lm-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--lm-hero-text);
  padding: 36px 36px 32px;
  display: flex;
  flex-direction: column;
  transition: color 0.45s ease;
}

/* Same gradient as dashboard hero — theme-aware */
.lm-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--lm-stage-grad);
  z-index: -2;
  transition: background 0.45s ease;
}

/* Same dot grain mask */
.lm-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--lm-grain) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.12) 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.12) 70%, transparent);
  z-index: -1;
  pointer-events: none;
}

/* Top: light logo */
.lm-stage-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--lm-hero-text);
}

.lm-stage-brand img {
  height: 22px;
  width: auto;
  display: block;
  /* Light PNG already includes wordmark */
}

.lm-stage-brand .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Wordmark swaps with theme (dark stage → light wordmark) */
.lm-stage-brand .brand-on-dark { display: none; }
body.theme-dark .lm-stage-brand .brand-on-light { display: none; }
body.theme-dark .lm-stage-brand .brand-on-dark  { display: block; }

/* Center: animated constellation */
.lm-stage-canvas {
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  margin: 8px 0 12px;
}

.lm-stage-canvas svg {
  width: 100%;
  height: 100%;
  max-width: 360px;
  max-height: 360px;
  display: block;
  overflow: visible;
  /* Pointer parallax — vars set by login-modal.js */
  transform: translate3d(calc(var(--lm-px, 0) * 12px), calc(var(--lm-py, 0) * 12px), 0);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}

/* ── Live network scene ───────────────────────────────────────
   A breathing HaloWiFi hub broadcasts Wi‑Fi waves while location
   nodes orbit on hairline rings, trading data packets with the
   core. A faint starfield adds depth and a slow scanner ring
   circles the hub. The whole scene drifts with the pointer
   (parallax) for a premium, alive feel.
   ─────────────────────────────────────────────────────────── */

/* Hairline guide rings */
.lm-stage-canvas .guide {
  fill: none;
  stroke: rgba(var(--lm-ink-rgb), 0.08);
  stroke-width: 1;
}

/* Starfield */
.lm-stage-canvas .star {
  fill: rgba(var(--lm-ink-rgb), 0.55);
  transform-box: fill-box;
  transform-origin: center;
  animation: lm-twinkle 4.5s ease-in-out infinite;
}
.lm-stage-canvas .star:nth-child(2n) { animation-duration: 5.6s; animation-delay: -1.2s; }
.lm-stage-canvas .star:nth-child(3n) { animation-duration: 6.8s; animation-delay: -2.6s; fill: rgba(125, 106, 191, 0.7); }
.lm-stage-canvas .star:nth-child(4n) { animation-delay: -3.4s; fill: rgba(108, 210, 142, 0.7); }
.lm-stage-canvas .star:nth-child(5n) { animation-duration: 5.1s; animation-delay: -0.8s; }
.lm-stage-canvas .star:nth-child(7n) { animation-delay: -4.2s; fill: rgba(217, 154, 58, 0.65); }

@keyframes lm-twinkle {
  0%, 100% { opacity: 0.12; transform: scale(0.7); }
  50%      { opacity: 0.9;  transform: scale(1.15); }
}

/* Wi‑Fi broadcast waves */
.lm-stage-canvas .wave {
  fill: none;
  stroke-width: 1.4;
  opacity: 0;
  transform-box: view-box;
  transform-origin: 180px 180px;
  animation: lm-wave 4.6s cubic-bezier(0.22, 0.7, 0.25, 1) infinite;
}
.lm-stage-canvas .wave.w1 { stroke: rgba(58, 166, 106, 0.55); }
.lm-stage-canvas .wave.w2 { stroke: rgba(var(--lm-ink-rgb), 0.34); animation-delay: 1.53s; }
.lm-stage-canvas .wave.w3 { stroke: rgba(125, 106, 191, 0.48); animation-delay: 3.06s; }

@keyframes lm-wave {
  0%   { transform: scale(0.28); opacity: 0; }
  14%  { opacity: 0.85; }
  100% { transform: scale(3.35); opacity: 0; }
}

/* Orbits — each <g> rotates around the SVG centre */
.lm-stage-canvas .orbit {
  transform-origin: 180px 180px;
  transform-box: view-box;
}
.lm-stage-canvas .orbit.o1 { animation: lm-orbit 34s linear infinite; }
.lm-stage-canvas .orbit.o2 { animation: lm-orbit 27s linear infinite reverse; }
.lm-stage-canvas .orbit.o3 { animation: lm-orbit 22s linear infinite; }
.lm-stage-canvas .orbit.o4 { animation: lm-orbit 30s linear infinite reverse; }

@keyframes lm-orbit {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}

/* Connector links hub↔node */
.lm-stage-canvas .link {
  stroke: rgba(var(--lm-ink-rgb), 0.14);
  stroke-width: 1;
}

/* Data packets riding the connectors */
.lm-stage-canvas .packet {
  offset-rotate: 0deg;
  opacity: 0;
}
.lm-stage-canvas .pk1 {
  fill: #6cd28e; filter: drop-shadow(0 0 5px rgba(108, 210, 142, 0.95));
  offset-path: path('M180 180 L180 25');
  animation: lm-pkt 3.4s ease-in-out infinite;
}
.lm-stage-canvas .pk2 {
  fill: #9b8cf0; filter: drop-shadow(0 0 5px rgba(155, 140, 240, 0.95));
  offset-path: path('M180 180 L295 180');
  animation: lm-pkt 3.0s ease-in-out 0.6s infinite reverse;
}
.lm-stage-canvas .pk3 {
  fill: #e0b46a; filter: drop-shadow(0 0 5px rgba(224, 180, 106, 0.95));
  offset-path: path('M180 180 L180 105');
  animation: lm-pkt 2.6s ease-in-out 1.1s infinite;
}
.lm-stage-canvas .pk4 {
  fill: #7fb2e0; filter: drop-shadow(0 0 5px rgba(127, 178, 224, 0.95));
  offset-path: path('M180 180 L92 255');
  animation: lm-pkt 3.8s ease-in-out 0.3s infinite reverse;
}

@keyframes lm-pkt {
  0%   { offset-distance: 0%;   opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* Location nodes */
.lm-stage-canvas .node-glow { opacity: 0.5; filter: blur(4px); }
.lm-stage-canvas .node-ring { fill: none; stroke-width: 1.4; opacity: 0.85; }
.lm-stage-canvas .node-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: lm-node 3.2s ease-in-out infinite;
}
.lm-stage-canvas .o2 .node-core { animation-delay: -0.8s; }
.lm-stage-canvas .o3 .node-core { animation-delay: -1.6s; }
.lm-stage-canvas .o4 .node-core { animation-delay: -2.4s; }

@keyframes lm-node {
  0%, 100% { transform: scale(0.8); }
  50%      { transform: scale(1.15); }
}

.lm-stage-canvas .node-green  .node-glow,
.lm-stage-canvas .node-green  .node-core { fill: var(--lm-node-green); }
.lm-stage-canvas .node-green  .node-ring { stroke: var(--lm-node-green); }
.lm-stage-canvas .node-iris   .node-glow,
.lm-stage-canvas .node-iris   .node-core { fill: var(--lm-node-iris); }
.lm-stage-canvas .node-iris   .node-ring { stroke: var(--lm-node-iris); }
.lm-stage-canvas .node-honey  .node-glow,
.lm-stage-canvas .node-honey  .node-core { fill: var(--lm-node-honey); }
.lm-stage-canvas .node-honey  .node-ring { stroke: var(--lm-node-honey); }
.lm-stage-canvas .node-cobalt .node-glow,
.lm-stage-canvas .node-cobalt .node-core { fill: var(--lm-node-cobalt); }
.lm-stage-canvas .node-cobalt .node-ring { stroke: var(--lm-node-cobalt); }

/* Centre hub — soft breathing aura */
.lm-stage-canvas .hub-aura {
  fill: rgba(108, 210, 142, 0.18);
  filter: blur(16px);
  transform-origin: 180px 180px;
  transform-box: view-box;
  animation: lm-breathe 9s ease-in-out infinite;
}

@keyframes lm-breathe {
  0%, 100% { transform: scale(1);    opacity: 0.5; }
  50%      { transform: scale(1.2);  opacity: 0.95; }
}

/* Slow dotted scanner ring hugging the hub */
.lm-stage-canvas .hub-scan {
  fill: none;
  stroke: rgba(108, 210, 142, 0.55);
  stroke-width: 1.2;
  stroke-dasharray: 2 9;
  stroke-linecap: round;
  transform-origin: 180px 180px;
  transform-box: view-box;
  animation: lm-orbit 16s linear infinite;
}

.lm-stage-canvas .hub-bg {
  fill: var(--lm-hub-fill);
  stroke: var(--lm-hub-stroke);
  stroke-width: 1;
  filter: drop-shadow(var(--lm-hub-shadow));
}

/* Bottom: live caption + ticker */
.lm-stage-foot {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lm-kicker {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lm-hero-text);
  background: var(--lm-hero-glass);
  border: 1px solid var(--lm-hero-rule);
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.lm-kicker .pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lm-pulse);
}

.lm-kicker .pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--lm-pulse);
  animation: lm-kicker-pulse 2.4s ease-out infinite;
}

@keyframes lm-kicker-pulse {
  0%        { transform: scale(1);   opacity: 0.7; }
  80%, 100% { transform: scale(2.8); opacity: 0; }
}

.lm-stage-headline {
  font-family: var(--font-display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
  color: var(--lm-hero-text);
  max-width: 22ch;
}

.lm-stage-headline em {
  font-style: italic;
  font-weight: 500;
  color: var(--lm-hero-mute);
}

/* Live events ticker */
.lm-ticker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--lm-hero-mute);
  overflow: hidden;
}

.lm-ticker-dot {
  position: relative;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lm-pulse);
}

.lm-ticker-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--lm-pulse);
  animation: lm-kicker-pulse 2.4s ease-out infinite;
}

.lm-ticker-text {
  display: inline-block;
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.lm-ticker-text.is-out {
  opacity: 0;
  transform: translateY(-6px);
}

.lm-stage-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--lm-hero-rule);
  padding-top: 16px;
}

/* Live session counter — gentle flash on each update */
.lm-stage-stat .v[data-live-sessions] {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.lm-stage-stat .v.is-bump { color: var(--lm-pulse); }

.lm-stage-stat {
  position: relative;
  padding: 0 12px;
}

.lm-stage-stat + .lm-stage-stat {
  border-left: 1px solid var(--lm-hero-rule);
}

.lm-stage-stat .v {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--lm-hero-text);
}

.lm-stage-stat .l {
  display: block;
  margin-top: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lm-hero-faint);
}

/* ══════════════════════════════════════════════════════════════
   RIGHT — Form panel
   ══════════════════════════════════════════════════════════════ */
.lm-form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 48px 44px;
  background: var(--panel, #fff);
}

body.theme-dark .lm-form-side {
  background: var(--panel, #161b2a);
}

.lm-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  text-decoration: none;
  color: var(--ink, #1a1a1a);
}

.lm-brand img {
  height: 26px;
  width: auto;
  display: block;
}

.lm-brand .brand-on-dark { display: none; }
body.theme-dark .lm-brand .brand-on-light { display: none; }
body.theme-dark .lm-brand .brand-on-dark  { display: block; }

/* ── Views: signin ↔ forgot ─────────────────────────────────── */
.lm-view {
  animation: lm-view-in 0.36s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.lm-view[hidden] { display: none; }

@keyframes lm-view-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lm-welcome {
  font-family: var(--font-display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink, #1a1a1a);
  margin: 0 0 8px;
  text-wrap: balance;
}

.lm-welcome .accent {
  color: var(--mute, #7d7a72);
  font-weight: 500;
}

.lm-lede {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--mute, #7d7a72);
  max-width: 36ch;
}

/* ── Form ────────────────────────────────────────────────────── */
.lm-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.lm-form[hidden] { display: none; }

.lm-inset {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--rule, #e8e3d6);
  border-radius: var(--lm-radius-md);
  padding: 0 14px;
  min-height: 50px;
  background: var(--surface-2, #fafaf8);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

body.theme-dark .lm-inset {
  background: var(--surface-2, #1d2538);
}

.lm-inset:hover:not(:focus-within) { border-color: #d5dbe3; }

.lm-inset:focus-within {
  background: var(--panel, #fff);
  border-color: var(--ink, #1a1a1a);
  box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.06);
}

body.theme-dark .lm-inset:focus-within {
  background: var(--panel, #161b2a);
  box-shadow: 0 0 0 4px rgba(231, 235, 242, 0.06);
}

.lm-inset-label {
  flex: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2, #4a4843);
  min-width: 72px;
}

.lm-inset input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink, #1a1a1a);
  padding: 13px 0;
  outline: none;
  text-align: right;
}

.lm-inset input::placeholder { color: var(--faint, #9a978c); }

.lm-inset.has-toggle { padding-right: 6px; }

.lm-inset-toggle {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--faint, #9a978c);
  transition: color 0.15s, background 0.15s;
}

.lm-inset-toggle:hover {
  color: var(--ink, #1a1a1a);
  background: var(--rule, #e8e3d6);
}

body.theme-dark .lm-inset-toggle:hover { background: var(--rule, #232a3e); }

.lm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 0;
}

.lm-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--mute, #7d7a72);
  cursor: pointer;
  user-select: none;
}

.lm-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--rule, #e8e3d6);
  border-radius: 5px;
  flex: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: var(--panel, #fff);
  transition: border-color 0.15s, background 0.15s;
  margin: 0;
}

.lm-check input:checked {
  background: var(--ink, #1a1a1a);
  border-color: var(--ink, #1a1a1a);
}

.lm-check input:checked::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 1.6px solid #fff;
  border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

body.theme-dark .lm-check input:checked {
  background: #ecedef;
  border-color: #ecedef;
}

body.theme-dark .lm-check input:checked::after { border-color: #14171c; }

.lm-link {
  font-size: 13px;
  color: var(--ink, #1a1a1a);
  font-weight: 500;
  text-decoration: none;
}

.lm-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* CTA */
.lm-continue {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  width: 100%;
  margin: 12px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--panel, #fff);
  background: var(--ink, #1a1a1a);
  border-radius: var(--lm-radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.lm-continue:hover { background: #333; }
.lm-continue:active { transform: translateY(1px); }
.lm-continue:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

body.theme-dark .lm-continue {
  background: #ecedef;
  color: #14171c;
}

body.theme-dark .lm-continue:hover { background: #fff; }

.lm-continue svg { transition: transform 0.2s; }
.lm-continue:hover svg { transform: translateX(2px); }

.lm-or {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px 0 14px;
  font-size: 12px;
  color: var(--faint, #9a978c);
}

.lm-or::before,
.lm-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule, #e8e3d6);
}

.lm-or span { padding: 0 14px; }

.lm-social-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid var(--rule, #e8e3d6);
  background: var(--panel, #fff);
  border-radius: var(--lm-radius-md);
  padding: 13px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink, #1a1a1a);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
}

.lm-social-btn:hover {
  border-color: var(--ink, #1a1a1a);
  background: var(--surface-2, #fafbfc);
}

body.theme-dark .lm-social-btn { background: var(--panel, #161b2a); }

.lm-foot {
  margin: 28px 0 0;
  font-size: 13px;
  color: var(--mute, #7d7a72);
}

.lm-foot a {
  color: var(--ink, #1a1a1a);
  font-weight: 600;
  text-decoration: none;
}

.lm-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Back link in forgot view */
.lm-foot-back { margin-top: 22px; }

.lm-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mute, #7d7a72) !important;
  font-weight: 500 !important;
}

.lm-back svg { transition: transform 0.2s; }
.lm-back:hover { color: var(--ink, #1a1a1a) !important; text-decoration: none !important; }
.lm-back:hover svg { transform: translateX(-2px); }

/* Reset-link sent confirmation */
.lm-sent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--rule, #e8e3d6);
  background: var(--surface-2, #fafaf8);
  border-radius: var(--lm-radius-md);
}

body.theme-dark .lm-sent {
  background: var(--surface-2, #1d2538);
  border-color: var(--rule, #232a3e);
}

.lm-sent[hidden] { display: none; }

.lm-sent-mark {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(58, 166, 106, 0.14);
  color: #2f9a5e;
  display: grid;
  place-items: center;
}

body.theme-dark .lm-sent-mark {
  background: rgba(108, 210, 142, 0.12);
  color: #6cd28e;
}

.lm-sent b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
  margin-bottom: 2px;
}

.lm-sent p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mute, #7d7a72);
}

.lm-sent [data-sent-email] {
  color: var(--ink, #1a1a1a);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   POST SIGN-IN RECAP — "while you were away"
   Full-screen dark takeover that plays staged stats before the
   dashboard. Reuses the command-bridge gradient + dot grain.
   ══════════════════════════════════════════════════════════════ */
.lm-recap {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  color: var(--lm-hero-text);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lm-recap[hidden] { display: none; }
.lm-recap.is-open { opacity: 1; }

body.lm-recap-active { overflow: hidden; }

.lm-recap-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--lm-recap-grad);
  animation: lm-recap-drift 22s ease-in-out infinite alternate;
}

.lm-recap-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--lm-grain) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at center, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 70% at center, #000 25%, transparent 78%);
}

@keyframes lm-recap-drift {
  from { transform: scale(1)    translateY(0); }
  to   { transform: scale(1.08) translateY(-12px); }
}

.lm-recap-skip {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--lm-hero-mute);
  background: var(--lm-hero-glass);
  border: 1px solid var(--lm-hero-rule);
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}

.lm-recap-skip:hover {
  color: var(--lm-hero-text);
  border-color: rgba(var(--lm-ink-rgb), 0.34);
}

.lm-recap-skip svg { transition: transform 0.2s; }
.lm-recap-skip:hover svg { transform: translateX(2px); }

.lm-recap-inner {
  position: relative;
  width: min(680px, 90vw);
  padding: 32px 40px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.lm-recap-brand {
  height: 24px;
  width: auto;
  opacity: 0.92;
}

.lm-recap-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 106px;
  height: 106px;
  padding: 3px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(var(--lm-ink-rgb), 0.12) 0%,
    rgba(var(--lm-ink-rgb), 0.04) 50%,
    rgba(var(--lm-ink-rgb), 0.10) 100%
  );
  box-shadow:
    0 2px 8px rgba(var(--lm-ink-rgb), 0.08),
    0 16px 40px -8px rgba(var(--lm-ink-rgb), 0.14);
}

.lm-recap-avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--lm-hero-rule);
  pointer-events: none;
  animation: lm-recap-avatar-ring 3.2s ease-out infinite;
}

@keyframes lm-recap-avatar-ring {
  0%   { opacity: 0.55; transform: scale(1); }
  60%  { opacity: 0.18; transform: scale(1.10); }
  100% { opacity: 0.55; transform: scale(1); }
}

.lm-recap-avatar {
  display: block;
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--lm-hero-glass);
}

body.theme-dark .lm-recap-avatar-wrap {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(255, 255, 255, 0.10) 100%
  );
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.22),
    0 16px 40px -8px rgba(0, 0, 0, 0.40);
}

.lm-recap-brand.brand-on-dark { display: none; }
body.theme-dark .lm-recap-brand.brand-on-light { display: none; }
body.theme-dark .lm-recap-brand.brand-on-dark  { display: block; }

.lm-recap-stage-wrap {
  position: relative;
  width: 100%;
  min-height: 268px;
  display: grid;
  place-items: center;
}

.lm-recap-stage {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.lm-recap-stage[hidden] { display: none; }

/* Both the outgoing + incoming stage are visible at once (stacked in
   the same grid cell) for a true, smooth crossfade. */
.lm-recap-stage.is-in {
  animation: lm-recap-in 0.7s cubic-bezier(0.22, 0.61, 0.18, 1) both;
}

.lm-recap-stage.is-out {
  animation: lm-recap-out 0.42s cubic-bezier(0.4, 0, 0.2, 1) both;
  pointer-events: none;
}

@keyframes lm-recap-in {
  from { opacity: 0; transform: translateY(18px) scale(0.99); filter: blur(2px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes lm-recap-out {
  from { opacity: 1; transform: none; filter: blur(0); }
  to   { opacity: 0; transform: translateY(-14px) scale(0.99); filter: blur(3px); }
}

/* Inner content gently rises as the overlay opens */
.lm-recap.is-open .lm-recap-inner {
  animation: lm-recap-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Avatar blooms in ahead of the card text — scale from 0.6, blur clears */
.lm-recap.is-open .lm-recap-avatar-wrap {
  animation: lm-recap-avatar-in 0.72s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

@keyframes lm-recap-avatar-in {
  0%   { opacity: 0; transform: scale(0.60); filter: blur(8px); }
  55%  { opacity: 1; filter: blur(0); }
  75%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes lm-recap-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.lm-recap-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lm-hero-text);
  background: var(--lm-hero-glass);
  border: 1px solid var(--lm-hero-rule);
  padding: 7px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.lm-recap-kicker .pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lm-pulse);
}

.lm-recap-kicker .pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--lm-pulse);
  animation: lm-kicker-pulse 2.4s ease-out infinite;
}

.lm-recap-num {
  font-family: var(--font-display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: clamp(56px, 12vw, 104px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--lm-hero-text);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 48px rgba(125, 106, 191, 0.28);
}

.lm-recap-stage.is-in .lm-recap-num {
  animation: lm-recap-num-pop 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes lm-recap-num-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.94); filter: blur(7px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.lm-recap-cap {
  margin: 0;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.5;
  color: var(--lm-hero-mute);
  max-width: 30ch;
}

.lm-recap-cap em { font-style: italic; color: var(--lm-hero-text); }

.lm-recap-greet {
  font-family: var(--font-display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: clamp(26px, 4.5vw, 42px);
  line-height: 1.15;
  margin: 0;
  color: var(--lm-hero-text);
  max-width: 20ch;
}

.lm-recap-greet em { font-style: italic; font-weight: 500; color: var(--lm-hero-mute); }

/* Summary */
.lm-recap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  border-top: 1px solid var(--lm-hero-rule);
  border-bottom: 1px solid var(--lm-hero-rule);
  margin: 6px 0 4px;
}

.lm-recap-cell {
  padding: 22px 10px;
}

.lm-recap-cell + .lm-recap-cell { border-left: 1px solid var(--lm-hero-rule); }

.lm-recap-summary.is-in .lm-recap-cell {
  animation: lm-recap-cell-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.lm-recap-summary.is-in .lm-recap-cell:nth-child(1) { animation-delay: 0.18s; }
.lm-recap-summary.is-in .lm-recap-cell:nth-child(2) { animation-delay: 0.28s; }
.lm-recap-summary.is-in .lm-recap-cell:nth-child(3) { animation-delay: 0.38s; }

@keyframes lm-recap-cell-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.lm-recap-cell .v {
  display: block;
  font-family: var(--font-display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--lm-hero-text);
  font-variant-numeric: tabular-nums;
}

.lm-recap-cell .l {
  display: block;
  margin-top: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lm-hero-faint);
}

.lm-recap-enter {
  appearance: none;
  border: 0;
  cursor: pointer;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--lm-enter-ink);
  background: var(--lm-enter-bg);
  border-radius: 12px;
  padding: 14px 22px;
  box-shadow: 0 10px 26px -14px rgba(20, 24, 34, 0.5);
  transition: transform 0.05s, background 0.15s;
}

.lm-recap-enter:hover { background: var(--lm-enter-bg-h); }
.lm-recap-enter:active { transform: translateY(1px); }
.lm-recap-enter svg { transition: transform 0.2s; }
.lm-recap-enter:hover svg { transform: translateX(3px); }

/* Progress dots */
.lm-recap-progress {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.lm-recap-progress .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--lm-hero-rule);
  transition: background 0.3s, width 0.3s;
}

.lm-recap-progress .dot.is-done { background: var(--lm-hero-mute); }

.lm-recap-progress .dot.is-on {
  width: 22px;
  background: var(--lm-pulse);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 880px) {
  .lm-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .lm-stage {
    padding: 28px 28px 28px;
    min-height: 280px;
  }

  .lm-stage-canvas {
    margin: 0 0 12px;
  }

  .lm-stage-canvas svg {
    max-width: 200px;
    max-height: 200px;
  }

  .lm-form-side { padding: 32px 28px 32px; }

  .lm-inset input { text-align: left; }
}

@media (max-width: 480px) {
  .lm-page { padding: 14px 12px; }
  .lm-page-actions { top: 12px; right: 12px; }
  .lm-modal { border-radius: 20px; }
  .lm-social { grid-template-columns: 1fr; }
  .lm-stage-stats { grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 12px; }
  .lm-stage-stat:nth-child(3) { display: none; }
  .lm-stage-stat + .lm-stage-stat { border-left: 0; }
  .lm-stage-canvas svg { max-width: 160px; max-height: 160px; }
}

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

  /* Keep one Wi‑Fi wave + the stars visible as a calm, static scene */
  .lm-stage-canvas .wave.w1 { opacity: 0.4; transform: scale(2.4); }
  .lm-stage-canvas .star { opacity: 0.5; }
}
