.auth-v3 {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 42%, oklch(from var(--bg-2) l c h / 0.45) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, oklch(from var(--bg) calc(l - 0.012) c h) 100%);
  overflow: hidden;
}

.auth-v3::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, oklch(from var(--line-2) l c h / 0.10) 1px, transparent 1px);
  background-size: 96px 96px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 65% 80% at 50% 50%, black 30%, transparent 100%);
}
.auth-v3::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.025;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}
.auth-v3 > * { position: relative; z-index: 2; }

.av3-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px 40px;
}
.av3-brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.av3-brand-txt {
  display: flex; flex-direction: column; line-height: 1.0; gap: 3px;
}
.av3-brand-txt b {
  font-family: var(--mono); font-size: 13.5px; font-weight: 500;
  letter-spacing: 0.04em;
}
.av3-brand-txt i {
  font-family: var(--serif); font-style: normal;
  font-size: 11px; letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.av3-back {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute);
  background: transparent; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 180ms;
}
.av3-back:hover { color: var(--ink); }
.av3-back .arr { font-size: 14px; }

.av3-main {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px 64px;
}
.av3-card {
  width: 100%;
  max-width: 460px;
  position: relative;
}

.av3-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 40px;
  border-top: 1px solid var(--line-2);
  background: oklch(from var(--bg) l c h / 0.55);
  backdrop-filter: blur(6px);
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute);
}
.av3-foot-l { display: inline-flex; align-items: center; }
.av3-foot-r { display: inline-flex; align-items: center; gap: 18px; }
.av3-foot a {
  color: var(--ink-mute); text-decoration: none;
  transition: color 180ms;
}
.av3-foot a:hover { color: var(--ink); }
.av3-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 999px; background: var(--good);
  box-shadow: 0 0 8px var(--good);
  margin-right: 10px; vertical-align: middle;
}
.av3-dot.live { animation: av3Blink 2.4s ease-in-out infinite; }
@keyframes av3Blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

@media (max-width: 640px) {
  .av3-top { padding: 20px 20px; }
  .av3-main { padding: 24px 20px 40px; }
  .av3-foot { padding: 12px 20px; flex-direction: column; gap: 8px; align-items: flex-start; }
  .av3-foot-r { flex-wrap: wrap; gap: 14px; }
}

.lf-form {
  display: flex; flex-direction: column;
}
.lf-eyebrow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-2);
}
.lf-num {
  font-family: var(--serif); font-style: normal;
  font-size: 32px; line-height: 1;
  color: var(--ink);
  background: linear-gradient(180deg, oklch(1 0 0) 0%, oklch(0.78 0.003 250) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.lf-eyebrow-l {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}
.lf-eyebrow-r {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-mute);
  text-align: right;
  white-space: nowrap;
}

.lf-title {
  font-family: var(--serif); font-weight: 400;
  font-size: 56px; line-height: 1.0; letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.lf-title em {
  font-style: normal;
  background: linear-gradient(180deg, oklch(1 0 0) 0%, oklch(0.86 0.003 250) 50%, oklch(0.62 0.003 250) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.lf-sub {
  margin: 0 0 36px;
  font-size: 14.5px; line-height: 1.6;
  color: var(--ink-dim);
  max-width: 42ch;
}

.lf-fields {
  display: flex; flex-direction: column; gap: 22px;
  margin-bottom: 22px;
}
.lf-options {
  margin: 0 0 24px;
}

.lf-oauth {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.lf-oauth-lbl {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}
.lf-oauth-row {
  display: inline-flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.lf-oauth-btn {
  background: transparent; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 150ms, border-color 150ms;
}
.lf-oauth-btn:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.lf-oauth-btn svg { opacity: 0.85; }
.lf-oauth-sep {
  color: var(--ink-mute); opacity: 0.5; font-family: var(--mono);
}

.lf-error {
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid oklch(from var(--bad) l c h / 0.6);
  background: oklch(from var(--bad) l c h / 0.08);
  color: oklch(from var(--bad) l c h);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.totp-panel { display: flex; flex-direction: column; gap: 12px; }
.totp-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}
.totp-title {
  font-family: var(--serif); font-style: normal; font-size: 18px;
  letter-spacing: -0.01em; color: var(--ink);
}
.totp-sub { font-size: 12px; line-height: 1.5; }
.totp-qr-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 700px) {
  .totp-qr-row { grid-template-columns: 1fr; }
}
.totp-qr {
  border: 1px solid var(--line-2);
  background: oklch(0.96 0.003 250);
  padding: 6px;
  width: 232px;
  height: 232px;
  display: grid;
  place-items: center;
}
.totp-secret-block { display: flex; flex-direction: column; gap: 8px; }
.totp-secret {
  font-size: 13px;
  letter-spacing: 0.08em;
  word-break: break-all;
  color: var(--ink);
  background: oklch(from var(--bg-2) l c h / 0.7);
  padding: 10px 12px;
  border: 1px solid var(--line-2);
}
.totp-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 6px;
}
.btn.danger { color: oklch(from var(--bad) l c h); border-color: oklch(from var(--bad) l c h / 0.5); }
.btn.danger:hover { color: var(--ink); background: oklch(from var(--bad) l c h / 0.1); }

.wl-row-editor {
  background: oklch(from var(--bg-2) l c h / 0.55);
  border-bottom: 1px solid var(--line-2);
  padding: 16px 22px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.wl-re-hd {
  display: flex; align-items: baseline; gap: 14px;
  font-size: 14px;
}
.wl-re-list {
  display: flex; flex-direction: column; gap: 6px;
  padding: 4px 0;
}
.wl-re-item {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  background: oklch(from var(--bg) l c h / 0.6);
  font-size: 12px;
}
.wl-re-form { padding-top: 4px; }
.wl-re-fields {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.wl-re-input {
  flex: 1; min-width: 180px;
  background: oklch(from var(--bg) l c h / 0.7);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 13px;
  letter-spacing: 0.04em;
  outline: none;
}
.wl-re-input:focus { border-color: oklch(0.78 0.003 250); }
.btn.sm { padding: 8px 14px; font-size: 11px; }
.pill.up { color: oklch(from var(--good) l c h); border-color: oklch(from var(--good) l c h / 0.5); }
.pill.dn { color: oklch(from var(--bad)  l c h); border-color: oklch(from var(--bad)  l c h / 0.5); }

.al-form { width: 100%; max-width: 760px; }
.al-form-fields {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.al-fld { display: flex; flex-direction: column; gap: 6px; }
.al-fld label { padding-left: 2px; }
@media (max-width: 900px) {
  .al-form-fields { grid-template-columns: 1fr; }
  .al-form .wl-re-input { min-width: 0; width: 100%; }
  .al-fld .btn.primary { width: 100%; }
}

.wl-table.simple .wl-head,
.wl-table.simple .wl-row {
  grid-template-columns: 44px 1.4fr 1fr 0.8fr 1fr 24px;
}

.wl-picker-search { margin-bottom: 14px; }
.wl-picker-list {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--line-2);
  background: oklch(from var(--bg) l c h / 0.55);
}
.wl-picker-row {
  display: grid;
  grid-template-columns: 38px auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  cursor: default;
  transition: background 100ms;
}
.wl-picker-row:last-child { border-bottom: 0; }
.wl-picker-row:hover { background: oklch(from var(--bg-2) l c h / 0.6); }
.wl-picker-star {
  background: transparent; border: 0;
  font-size: 18px; line-height: 1;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 4px;
  transition: color 100ms, transform 100ms;
}
.wl-picker-star:hover { color: var(--ink); transform: scale(1.1); }
.wl-picker-star.on { color: oklch(from var(--accent) l c h); }
.wl-picker-star:disabled { cursor: default; transform: none; }

.lf-toggle {
  margin-top: 26px;
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.lf-toggle a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  transition: color 150ms, border-color 150ms;
  margin-left: 4px;
}
.lf-toggle a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.lf-toggle .arr { display: inline-block; margin-left: 4px; }

.av3-card .input {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: border-color 180ms;
  position: relative;
}
.av3-card .input:hover { border-bottom-color: oklch(from var(--line) l c h / 0.9); }
.av3-card .input:focus-within {
  border-color: var(--ink);
  background: transparent;
}
.av3-card .input input {
  padding: 12px 0 10px;
  font-size: 16px;
  font-family: var(--sans);
  font-feature-settings: "tnum";
  letter-spacing: -0.005em;
  color: var(--ink);
}
.av3-card .input input::placeholder {
  font-family: var(--serif); font-style: normal;
  font-size: 16px;
  color: var(--ink-mute); opacity: 0.5;
  letter-spacing: 0;
}
.av3-card .input.with-icon input { padding-right: 36px; }
.av3-card .input-icon { right: 0; }

.av3-card .field { margin-bottom: 0; }
.av3-card .field-row { margin-bottom: 4px; }
.av3-card .field-label {
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-mute);
}
.av3-card .field-addon a {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-mute);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 150ms, border-color 150ms;
}
.av3-card .field-addon a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.av3-card.page-enter {
  animation: av3PageIn 480ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes av3PageIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.av3-card .input-icon.eye-btn {
  background: transparent;
  border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--ink-mute);
  opacity: 0.55;
  cursor: pointer;
  padding: 0;
  transition: color 160ms, opacity 160ms;
  position: absolute;
  right: 0; bottom: 6px;
  top: auto; transform: none;
}
.av3-card .input-icon.eye-btn:hover { color: var(--ink); opacity: 1; }
.av3-card .input-icon.eye-btn svg { display: block; }

.match-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding-bottom: 1px;
  font-weight: 500;
}
.match-tag.ok  { color: var(--good); }
.match-tag.no  { color: var(--bad); }
.match-tag .check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 4px; height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  font-size: 0;
}

.av3-card .field .pwd-meter {
  margin-top: 12px;
  margin-bottom: 0;
  gap: 12px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.av3-card .field .pwd-bars { gap: 3px; }
.av3-card .field .pwd-bars span { height: 2px; }
.av3-card .field .pwd-label { white-space: nowrap; }

.lf-form .lf-title,
.lf-form .lf-sub {
  text-align: center;
}
.lf-form .lf-sub {
  margin-left: auto;
  margin-right: auto;
}
.lf-form .lf-title { letter-spacing: -0.018em; }
.lf-form .lf-toggle { text-align: center; }

.reg-ledger {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  margin: 0 0 26px;
}
.rl-row {
  display: grid;
  grid-template-columns: 44px 1fr 28px;
  align-items: start;
  gap: 16px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
  transition: background 240ms;
}
.rl-row:last-child { border-bottom: 0; }
.rl-row:focus-within {
  background: oklch(from var(--bg-2) l c h / 0.35);
}
.rl-row:focus-within::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--ink);
}

.rl-num {
  font-family: var(--serif); font-style: normal;
  font-size: 32px; line-height: 1;
  color: var(--ink-mute);
  text-align: center;
  padding-top: 4px;
  font-feature-settings: "smcp", "c2sc";
  letter-spacing: 0.04em;
  transition: color 220ms, transform 220ms;
}
.rl-row.filled .rl-num,
.rl-row:focus-within .rl-num {
  color: var(--ink);
  transform: translateY(-1px);
}

.rl-body {
  display: flex; flex-direction: column;
  min-width: 0;
}
.rl-label {
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 4px;
  display: flex; align-items: baseline; gap: 4px;
}
.rl-inline-tag {
  font-family: var(--serif); font-style: normal;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 400;
}
.rl-inline-tag.ok { color: var(--good); }
.rl-inline-tag.no { color: var(--bad); }

.rl-body .input {
  border: 0 !important;
  background: transparent;
  padding: 0;
  position: relative;
}
.rl-body .input input {
  padding: 4px 0 0;
  font-size: 17px;
  font-family: var(--sans);
  font-feature-settings: "tnum";
  color: var(--ink);
  background: transparent;
}
.rl-body .input input::placeholder {
  font-family: var(--serif); font-style: normal;
  color: var(--ink-mute); opacity: 0.5;
  letter-spacing: 0;
}
.rl-body .input.with-icon input { padding-right: 32px; }
.rl-body .input-icon.eye-btn {
  background: transparent; border: 0;
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-mute); opacity: 0.55;
  cursor: pointer;
  transition: opacity 160ms, color 160ms;
}
.rl-body .input-icon.eye-btn:hover { opacity: 1; color: var(--ink); }
.rl-body .input-icon.eye-btn svg { display: block; }

.rl-status {
  display: flex; align-items: center; justify-content: center;
  padding-top: 24px;
}
.rl-tick {
  width: 18px; height: 18px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  border: 1px solid currentColor;
  animation: rlTickIn 240ms cubic-bezier(.2,.7,.2,1) both;
}
.rl-tick.ok { color: var(--good); background: oklch(from var(--good) l c h / 0.12); }
.rl-tick.no { color: var(--bad);  background: oklch(from var(--bad) l c h / 0.14); }
@keyframes rlTickIn {
  0%   { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

.rl-strength {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px;
}
.rl-rail {
  flex: 1; height: 2px;
  background: var(--line-2);
  position: relative;
  overflow: hidden;
}
.rl-rail-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--ink-mute);
  transition: width 320ms cubic-bezier(.2,.7,.2,1), background 240ms;
}
.rl-rail-fill.s-1, .rl-rail-fill.s-2 { background: var(--bad); }
.rl-rail-fill.s-3 { background: var(--warn); }
.rl-rail-fill.s-4 { background: var(--good); }

.rl-strength-lbl {
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
  font-feature-settings: "tnum";
}
.rl-strength-lbl.s-1, .rl-strength-lbl.s-2 { color: var(--bad); }
.rl-strength-lbl.s-3 { color: var(--warn); }
.rl-strength-lbl.s-4 { color: var(--good); }

.lf-form .lf-fields { gap: 18px; margin-bottom: 18px; }

.reg-checks {
  display: flex; flex-direction: column; gap: 12px;
  margin: 22px 0 26px;
}

.reg-mascot-wrap {
  display: flex; justify-content: center;
  margin: -8px 0 18px;
  pointer-events: none;
}
.kmonkey {
  display: inline-block;
  filter: drop-shadow(0 8px 14px oklch(0 0 0 / 0.35));
  transform-origin: 50% 60%;
  transition: transform 280ms cubic-bezier(.2,.7,.2,1);
}
.kmonkey.happy { transform: translateY(-2px) rotate(-2deg); }
.kmonkey.oops  { transform: translateY(0) rotate(2deg); }
.kmonkey.peek  { transform: translateY(-1px); }

.km-hands { transition: transform 320ms cubic-bezier(.2,.7,.2,1); }
.km-hand  { transition: transform 320ms cubic-bezier(.2,.7,.2,1); transform-origin: center; transform-box: fill-box; }

.km-cover .km-l { transform: translate(16px, 0) rotate(-4deg); }
.km-cover .km-r { transform: translate(-16px, 0) rotate(4deg); }

.km-peek .km-l  { transform: translate(16px, 14px) rotate(-2deg); }
.km-peek .km-r  { transform: translate(-16px, 14px) rotate(2deg); }

.km-idle .km-l, .km-happy .km-l, .km-oops .km-l { transform: translate(-50px, 50px) rotate(-30deg); opacity: 0; }
.km-idle .km-r, .km-happy .km-r, .km-oops .km-r { transform: translate(50px, 50px) rotate(30deg); opacity: 0; }

@keyframes kmBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
.kmonkey.idle .km-eyes circle { transform-origin: center; transform-box: fill-box; animation: kmBlink 6.5s ease-in-out infinite; }

html[data-dash-theme="light"] .auth-v3 {
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 42%, oklch(0.995 0.001 70 / 0.85) 0%, transparent 70%),
    linear-gradient(180deg, oklch(0.97 0.003 70) 0%, oklch(0.945 0.005 70) 100%);
}
html[data-dash-theme="light"] .auth-v3::after { mix-blend-mode: multiply; opacity: 0.05; }
html[data-dash-theme="light"] .lf-num,
html[data-dash-theme="light"] .lf-title em {
  background: linear-gradient(180deg, oklch(0.30 0.006 250) 0%, oklch(0.50 0.008 250) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
