/* #region zone:finance.style.login — หน้าเข้าสู่ระบบ Finance: พื้นสว่าง สำรับการ์ด และฟอร์ม */
/* Finance-only layer over the shared login-shell.css (Monitor/Desk/Map stay untouched): everything is
   scoped to .login-shell--finance and loaded last. Light world: a pale stage on the left holds the
   wallet deck; the form sits on a white panel. Motion is transform/opacity only and stops under
   prefers-reduced-motion. The form logic and its DOM belong to desk/login-mfa.js. */
.login-shell--finance {
  --fl-hero-type: clamp(36px, 3.4vw, 48px);
  --fl-card-top-type: 1.15em;
  --fl-card-value-type: 2.2em;
  --fl-card-foot-type: 0.95em;
  --fl-form-title-type: 30px;
  --fl-card-w: clamp(248px, 26vw, 380px);
  --fl-step: 420ms;
  --fl-px: 0; /* pointer/tilt lean, -1..1, written by finance-login-motion.js */
  --fl-py: 0;
  background: var(--bg);
}
html:root .login-shell--finance .password-reveal-button.u-btn {
  font-size: var(--u-body);
}
:root[data-theme='dark'] .login-shell--finance {
}

/* Stage: the pale page itself, a faint dot field and two soft lights that drift and lean with the pointer. */
.login-shell--finance .login-shell-card {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--bg);
}
.login-shell--finance .login-shell-brand {
  align-items: stretch;
  padding: clamp(var(--sp-8), 4.4vw, 72px);
  color: var(--text);
  background: var(--u-card);
}
.login-shell--finance .login-shell-brand::before,
.login-shell--finance .login-shell-brand::after {
  width: 70%;
  height: auto;
  aspect-ratio: 1;
  border: 0;
  background: none;
  left: -10%;
  top: 22%;
  right: auto;
  bottom: auto;
  translate: calc(var(--fl-px, 0) * -22px) calc(var(--fl-py, 0) * -16px);
  transition: translate 900ms var(--ease-out);
  animation: fl-drift 24s ease-in-out infinite alternate;
}
.login-shell--finance .login-shell-brand::after {
  width: 54%;
  background: radial-gradient(closest-side, var(--fl-glow-b), transparent);
  left: auto;
  top: auto;
  right: -8%;
  bottom: 4%;
  translate: calc(var(--fl-px, 0) * 18px) calc(var(--fl-py, 0) * 14px);
  animation-duration: 31s;
  animation-direction: alternate-reverse;
}
@keyframes fl-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(10%, -8%, 0) scale(1.12);
  }
}
.login-shell--finance .login-shell-brand-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-4);
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.login-shell--finance .fl-lockup {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-4);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text);
}
.login-shell--finance .fl-lockup b {
  font-weight: 700;
}
.login-shell--finance .fl-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow:
    0 0 0 1px var(--line),
    0 6px 14px -8px rgba(23, 35, 30, 0.35);
}
.login-shell--finance .fl-mark img {
  width: 32px;
  height: 32px;
  margin: 0;
}
.login-shell--finance .login-shell-brand .login-shell-name {
  margin: 0;
  max-width: none;
  font-size: var(--fl-hero-type);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text);
}
.login-shell--finance .login-shell-name span {
  display: inline-block;
  white-space: nowrap;
}
.login-shell--finance .login-shell-name span + span {
  color: var(--accent-text);
}
.login-shell--finance .login-shell-brand .login-shell-tagline {
  max-width: 46ch;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

/* The wallet deck (the toy): four ID-1 cards (85.6 x 53.98) stacked; finance-login-scene.js writes each
   card's transform. Faces carry only masked figures and our own marks. */
.login-shell--finance .fl-scene {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  min-height: 0;
  padding: var(--sp-6) 0 var(--sp-2);
}
.login-shell--finance .fl-deck {
  position: relative;
  width: var(--fl-card-w);
  aspect-ratio: 85.6 / 53.98;
  margin-top: calc(var(--fl-card-w) * 0.26);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  animation: fl-rise 700ms 120ms var(--ease-out) both;
}
.login-shell--finance .fl-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7% 7.5%;
  overflow: hidden;
  border-radius: var(--u-radius-card);
  font-size: calc(var(--fl-card-w) * 0.042);
  line-height: 1.3;
  color: var(--u-text);
  /* A sheen band and a ring motif in the corner, painted on the face so nothing spills past its edge. */
  background: var(--u-card-2);
  box-shadow: none;
  cursor: grab;
  will-change: transform;
}
.login-shell--finance .fl-card:active {
  cursor: grabbing;
}
.login-shell--finance .fl-card p {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin: 0;
}
.login-shell--finance .fl-card .fl-card-top {
  justify-content: flex-start;
  font-size: var(--fl-card-top-type);
  font-weight: 600;
}
.login-shell--finance .fl-card-top svg {
  flex: none;
  width: 1.5em;
  height: 1.5em;
}
.login-shell--finance .fl-card-figure {
  font-size: var(--fl-card-value-type);
  font-weight: 650;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.login-shell--finance .fl-card-foot {
  font-size: var(--fl-card-foot-type);
  font-weight: 500;
  letter-spacing: 0.12em;
  opacity: 0.88;
}
.login-shell--finance .fl-card .fl-card-chip {
  width: 15%;
  aspect-ratio: 1.3;
  border-radius: 18%;
  background: linear-gradient(135deg, #f1dc9c, #c8a24a 60%, #a07c2a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.login-shell--finance .fl-card--cream {
  color: var(--u-text);
  box-shadow: none;
}
.login-shell--finance .fl-card--cream .fl-card-top svg {
  color: #2f6b4a;
}
.login-shell--finance .fl-hint {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  font-size: var(--u-text-sm);
  line-height: 1.6;
  color: var(--muted);
  user-select: none;
}
.login-shell--finance .fl-hint svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--accent-text);
}
.login-shell--finance .login-shell-quote {
  max-width: 52ch;
  margin: 0;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}
/* Form column: steps as a sliding segmented track, calm focus rings, a pressable primary button. */
.login-shell--finance .login-shell-form {
  position: relative;
  margin: var(--sp-4) var(--sp-4) var(--sp-4) 0;
  border: 1px solid var(--line);
  border-radius: var(--u-radius-dialog);
  background: var(--panel);
  box-shadow: none;
}
.login-shell--finance .login-shell-form > * {
  animation: fl-rise 600ms var(--ease-out) both;
}
.login-shell--finance .login-shell-form > :nth-child(2) {
  animation-delay: 60ms;
}
.login-shell--finance .login-shell-form > :nth-child(n + 3) {
  animation-delay: 120ms;
}
.login-shell--finance .login-shell-form > h2 {
  font-size: var(--fl-form-title-type);
  line-height: 1.35;
}
.login-shell--finance .login-shell-form > p:not([id]) {
  font-size: 15px;
}
.login-shell--finance .member-login-steps {
  position: relative;
  isolation: isolate;
  gap: var(--sp-1);
  padding: var(--sp-1);
  margin-bottom: var(--sp-3);
  border-radius: 14px;
  background: var(--panel2);
}
.login-shell--finance .member-login-steps::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 6px);
  border-radius: 10px;
  background: var(--panel);
  box-shadow:
    0 1px 2px rgba(11, 32, 41, 0.1),
    0 0 0 1px var(--line);
  transition: translate var(--fl-step) var(--ease-out);
}
.login-shell--finance .member-login-steps:has(.member-login-step:nth-child(2).is-current)::before {
  translate: calc(100% + 4px) 0;
}
.login-shell--finance .member-login-step,
.login-shell--finance .member-login-step.is-current {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 0;
  background: transparent;
  transition: color var(--fl-step) var(--ease-out);
}
.login-shell--finance .member-login-step.is-current {
  color: var(--text);
}
.login-shell--finance .login-shell-form input:not(.totp-box) {
  height: 52px;
  border-radius: 14px;
  transition:
    border-color 180ms ease,
    box-shadow 240ms var(--ease-out),
    background 180ms ease;
}
.login-shell--finance .login-shell-form input:not(.totp-box):hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.login-shell--finance .login-shell-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--acc-ring);
}
.login-shell--finance .login-shell-form label {
  transition: color 180ms ease;
}
.login-shell--finance .member-login-password:has(#username:focus) label[for='username'],
.login-shell--finance .member-login-password:has(#password:focus) label[for='password'] {
  color: var(--accent-text);
}
.login-shell--finance #login-submit {
  position: relative;
  min-height: 52px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 650;
  box-shadow: 0 10px 22px -12px var(--accent);
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    transform 120ms var(--ease-out);
}
.login-shell--finance #login-submit:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: 0 4px 10px -8px var(--accent);
}
.login-shell--finance #login-submit:disabled::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: fl-spin 700ms linear infinite;
}
.login-shell--finance .member-login-back {
  align-self: flex-start;
  justify-content: flex-start;
  width: auto;
  margin-inline-start: -12px;
  transition: background 150ms ease;
}
.login-shell--finance .member-login-back:hover:not(:disabled) {
  background: var(--acc-soft);
}

/* Step change: password slides back from the left, step 2 slides in and its code boxes rise one by one. */
.login-shell--finance .member-login-password:not([hidden]) {
  animation: fl-from-left var(--fl-step) var(--ease-out) both;
}
.login-shell--finance .member-login-factor:not([hidden]) {
  animation: fl-from-right var(--fl-step) var(--ease-out) both;
}
.login-shell--finance .member-mfa-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  animation: fl-pop 520ms var(--ease-out) both;
}
.login-shell--finance .member-mfa-icon svg {
  width: 24px;
  height: 24px;
}
.login-shell--finance .member-login-factor h3 {
  font-size: var(--u-text-xl);
}
.login-shell--finance .member-otp-boxes .totp-box {
  height: 60px;
  border-radius: 14px;
  font-variant-numeric: tabular-nums;
  animation: fl-rise 460ms var(--ease-out) both;
  transition:
    border-color 160ms ease,
    box-shadow 200ms var(--ease-out),
    transform 160ms var(--ease-out);
}
.login-shell--finance .member-otp-boxes .totp-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--acc-ring);
  transform: translateY(-2px);
}
.login-shell--finance .member-otp-boxes .totp-box:nth-child(1) {
  animation-delay: 120ms;
}
.login-shell--finance .member-otp-boxes .totp-box:nth-child(2) {
  animation-delay: 160ms;
}
.login-shell--finance .member-otp-boxes .totp-box:nth-child(3) {
  animation-delay: 200ms;
}
.login-shell--finance .member-otp-boxes .totp-box:nth-child(4) {
  animation-delay: 240ms;
}
.login-shell--finance .member-otp-boxes .totp-box:nth-child(5) {
  animation-delay: 280ms;
}
.login-shell--finance .member-otp-boxes .totp-box:nth-child(6) {
  animation-delay: 320ms;
}
.login-shell--finance .member-method-card {
  animation: fl-rise 460ms var(--ease-out) both;
  transition:
    border-color 160ms ease,
    box-shadow 200ms ease,
    transform 160ms var(--ease-out);
}
.login-shell--finance .member-method-card:nth-child(2) {
  animation-delay: 60ms;
}
.login-shell--finance .member-method-card:nth-child(3) {
  animation-delay: 120ms;
}
.login-shell--finance .member-method-card:active {
  transform: scale(0.98);
}

/* A wrong answer shakes the visible step once (the step animation stays first so it never replays). */
.login-shell--finance .member-login-password:not([hidden]).fl-shake {
  animation:
    fl-from-left var(--fl-step) var(--ease-out) both,
    fl-shake 380ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.login-shell--finance .member-login-factor:not([hidden]).fl-shake {
  animation:
    fl-from-right var(--fl-step) var(--ease-out) both,
    fl-shake 380ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Success: a drawn check over the form while the page opens Finance. */
.login-shell--finance .login-shell-form > .fl-success {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-4);
  max-width: none;
  margin: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  animation: fl-fade 240ms ease-out both;
}
.login-shell--finance .fl-success svg {
  width: 72px;
  height: 72px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-shell--finance .fl-success circle {
  fill: var(--acc-soft);
  stroke-width: 3;
  stroke-dasharray: 190;
  animation: fl-draw 560ms var(--ease-out) both;
}
.login-shell--finance .fl-success path {
  stroke-width: 4;
  stroke-dasharray: 40;
  animation: fl-draw 380ms 320ms var(--ease-out) both;
}
.login-shell--finance .fl-success p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

@keyframes fl-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}
@keyframes fl-from-right {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
}
@keyframes fl-from-left {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
}
@keyframes fl-pop {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-10deg);
  }
}
@keyframes fl-shake {
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(2px);
  }
}
@keyframes fl-spin {
  to {
    transform: rotate(1turn);
  }
}
@keyframes fl-fade {
  from {
    opacity: 0;
  }
}
@keyframes fl-draw {
  from {
    stroke-dashoffset: 190;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@media (min-width: 1180px) {
  .login-shell--finance .login-shell-name span {
    display: block;
  }
}
@media (max-width: 1024px) {
  .login-shell--finance .login-shell-brand {
    padding: var(--sp-8) var(--sp-6) var(--sp-8) var(--sp-8);
  }
  .login-shell--finance .login-shell-form {
    padding: 40px 28px;
  }
}
/* Phone: a compact header (lockup, headline, a small deck at the side) so the form starts above the fold. */
@media (max-width: 759px) {
  .login-shell--finance {
    --fl-card-w: clamp(124px, 34vw, 168px);
  }
  .login-shell--finance .login-shell-card {
    grid-template-columns: 1fr;
  }
  .login-shell--finance .login-shell-brand {
    padding: var(--sp-4) var(--sp-4) var(--sp-2);
  }
  .login-shell--finance .login-shell-brand-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'lock deck'
      'name deck';
    align-items: end;
    gap: var(--sp-2) var(--sp-4);
    max-width: 560px;
  }
  .login-shell--finance .fl-lockup {
    grid-area: lock;
    align-self: start;
    margin: 0;
    font-size: 14px;
  }
  .login-shell--finance .fl-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }
  .login-shell--finance .fl-mark img {
    width: 28px;
    height: 28px;
  }
  .login-shell--finance .login-shell-brand .login-shell-name {
    grid-area: name;
    font-size: var(--u-text-2xl);
    line-height: 1.3;
  }
  .login-shell--finance .login-shell-name span {
    display: block;
  }
  .login-shell--finance .fl-scene {
    grid-area: deck;
    padding: 0 var(--sp-2) var(--sp-2) 0;
  }
  .login-shell--finance .login-shell-brand .login-shell-tagline,
  .login-shell--finance .login-shell-quote,
  .login-shell--finance .fl-hint {
    display: none;
  }
  .login-shell--finance .login-shell-form {
    align-self: start;
    margin: var(--sp-2) var(--sp-3) calc(var(--sp-3) + env(safe-area-inset-bottom));
    padding: var(--sp-6) var(--sp-4) 28px;
    border-radius: var(--u-radius-card);
  }
  .login-shell--finance .login-shell-form > h2 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell--finance *,
  .login-shell--finance *::before,
  .login-shell--finance *::after,
  .login-shell--finance .login-shell-brand::before,
  .login-shell--finance .login-shell-brand::after {
    animation: none !important;
    transition: none !important;
  }
  .login-shell--finance .fl-hint {
    display: none;
  }
  .login-shell--finance .fl-card {
    cursor: default;
  }
}
/* #endregion */
