/* The sign-in page: full bleed, no frame. The floating paths on the left,
   the form on the right. Colours come from the dashboard's theme tokens, so
   it follows light and dark like the rest of the app.

   Every rule is scoped under #loginView: styles.css still carries legacy
   #loginView rules (inputs, focus rings, headings) that would otherwise
   outrank these. */

#loginView.lg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100svh; margin: 0; padding: 0;
  color: var(--text); background: var(--page, var(--bg)); -webkit-font-smoothing: antialiased; }

/* -- left: the floating paths ---------------------------------------- */
/* contain: paint keeps the panel's every-frame repaint inside the panel, so it never invalidates the form beside it. */
#loginView .lg-art { position: relative; display: flex; flex-direction: column; overflow: hidden; contain: paint; padding: 40px; border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-sunken) 60%, var(--page, var(--bg))); }
#loginView .lg-art::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, var(--page, var(--bg)) 0%, color-mix(in srgb, var(--page, var(--bg)) 40%, transparent) 26%, transparent 48%); }
#loginView .lg-quote { position: relative; z-index: 2; max-width: 520px; margin: auto 0 0; }
#loginView .lg-quote p { margin: 0; color: var(--ink); font-size: 21px; font-weight: 500; letter-spacing: -.015em; line-height: 1.4; }
#loginView .lg-quote footer { margin: 12px 0 0; padding: 0; border: 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 600; }
/* All 72 paths share one layer (will-change), repainted as a whole. */
#loginView .lg-paths { position: absolute; inset: 0; color: var(--ink); pointer-events: none; will-change: transform; }
#loginView .lg-paths svg { width: 100%; height: 100%; overflow: visible; }
:root[data-theme="light"] #loginView .lg-paths { opacity: .55; }
/* Each path is one long dash flowing along itself (pathLength="1"). Never
   animate a path's opacity as well: Chrome and Firefox then give each of the
   72 paths its own compositor layer and repaint all of them every frame —
   frames were dropped and painted without the paths (the flicker), while
   Safari, which does not composite them, was fine. The depth comes from the
   fixed stroke-opacity each path is drawn with instead. */
#loginView .lg-paths path { fill: none; stroke: currentColor; stroke-dasharray: .8 .2; animation: lg-flow 24s linear infinite; }
#loginView .lg-paths path.d1 { animation-duration: 20s; }
#loginView .lg-paths path.d2 { animation-duration: 23s; }
#loginView .lg-paths path.d3 { animation-duration: 26s; }
#loginView .lg-paths path.d4 { animation-duration: 29s; }
#loginView .lg-paths path.d5 { animation-duration: 22s; }
#loginView .lg-paths path.d6 { animation-duration: 28s; }
@keyframes lg-flow { to { stroke-dashoffset: -2; } }

/* -- right: the form ------------------------------------------------- */
#loginView .lg-main { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; min-height: 100svh; overflow: hidden; padding: 28px 20px; }
#loginView .lg-glow { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; filter: blur(2px); }
#loginView .lg-glow.a { top: -320px; right: -120px; width: 560px; height: 760px; transform: rotate(-45deg);
  background: radial-gradient(68% 69% at 55% 31%, color-mix(in srgb, var(--accent) 16%, transparent) 0, color-mix(in srgb, var(--accent) 4%, transparent) 50%, transparent 80%); }
#loginView .lg-glow.b { top: -120px; right: 60px; width: 240px; height: 680px; transform: rotate(-45deg);
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--ink) 7%, transparent) 0, transparent 100%); }
#loginView .lg-top { position: absolute; top: 26px; right: 28px; left: 28px; display: flex; justify-content: flex-end; }
#loginView .lg-chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; }
#loginView .lg-form-wrap { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 384px; margin: 0 auto; }
#loginView .lg-title h1 { margin: 0; color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
#loginView .lg-title p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
#loginView .lg-form { display: flex; flex-direction: column; gap: 12px; }
#loginView .lg-field { display: flex; flex-direction: column; gap: 6px; }
#loginView .lg-field > span:first-child { color: var(--text); font-size: 12.5px; font-weight: 600; }
#loginView .lg-input { position: relative; display: block; }
#loginView .lg-input input { width: 100%; height: 42px; padding: 0 40px 0 38px; border: 1px solid var(--line-strong); border-radius: 10px; outline: none;
  color: var(--ink); background: color-mix(in srgb, var(--surface) 70%, transparent); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
#loginView .lg-input input::placeholder { color: var(--faint); }
#loginView .lg-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
#loginView .lg-input > svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
#loginView .lg-input input:focus ~ svg { color: var(--accent); }
#loginView .lg-eye { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px;
  transform: translateY(-50%); color: var(--faint); background: none; cursor: pointer; }
#loginView .lg-eye:hover, #loginView .lg-eye[aria-pressed="true"] { color: var(--ink); background: var(--surface-sunken); }
#loginView .lg-eye:focus-visible { outline: 2px solid var(--focus-ring, var(--accent)); outline-offset: 1px; }
#loginView .lg-eye svg { width: 16px; height: 16px; }
#loginView .lg-ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#loginView .lg-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; margin-top: 4px; border: 0; border-radius: 10px;
  color: var(--page, var(--bg)); background: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: opacity .15s, transform .15s; }
#loginView .lg-submit:hover { opacity: .9; }
#loginView .lg-submit:active { transform: translateY(1px); }
#loginView .lg-submit:focus-visible { outline: 2px solid var(--focus-ring, var(--accent)); outline-offset: 2px; }
#loginView .lg-submit svg { width: 16px; height: 16px; transition: transform .15s; }
#loginView .lg-submit:hover svg { transform: translateX(2px); }
#loginView .lg-error { min-height: 1.2em; margin: 0; color: var(--bad-ink); font-size: 13px; }
#loginView .lg-sep { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
#loginView .lg-sep::before, #loginView .lg-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#loginView .lg-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
#loginView .lg-foot { position: absolute; margin: 0; padding: 0; border: 0; right: 28px; bottom: 22px; left: 28px; display: flex; justify-content: space-between; gap: 12px; color: var(--faint); font-size: 12px; }

@media (max-width: 1023px) {
  #loginView.lg { grid-template-columns: minmax(0, 1fr); }
  #loginView .lg-art { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #loginView .lg-paths path { animation: none; }
}

/* Global dark-theme rules the old sign-in stylesheet carried, which the rest
   of the dashboard still picks up; kept as they were. */
:root[data-theme="dark"] h1 {
  color: #cdd9e5;
}

:root[data-theme="dark"] .error {
  color: #f0837c;
}
