/* =====================================================================
   Sign-in: Clearance Wallet world, native app layout.
   Phone: ink stage on top, sign-in sheet rising from the bottom.
   Desktop: stage left, sheet right.
   The stage animation tells the product in one loop:
   scan (OCR) → AI extracts fields → classified by sensitivity → filed.
   ===================================================================== */

body.login-app { background: var(--ink); min-height: 100dvh; }
.lg-shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }

/* ---------- stage ---------- */
.lg-stage {
  position: relative;
  color: #fff;
  background: var(--ink);
  padding: calc(18px + var(--safe-top)) 20px 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}
.lg-brand { display: flex; align-items: center; gap: 12px; }
.lg-appicon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: #fff;
  display: grid; place-items: center;
  padding: 7px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 18px rgba(0, 0, 0, .35);
  flex: 0 0 auto;
}
.lg-appicon img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lg-appicon--tenant { width: 40px; height: 40px; border-radius: 11px; padding: 5px; margin-inline-start: -4px; }
.lg-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.lg-product { font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; }
.lg-company { color: rgba(255, 255, 255, .64); font-size: .8125rem; font-weight: 550; }
.lg-headline h1 {
  color: #fff;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.12;
  margin: 0;
  max-width: 18ch;
}
.lg-points { list-style: none; margin: 0; padding: 0; display: none; gap: 10px 22px; flex-wrap: wrap; }
.lg-points li { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .78); font-size: .875rem; font-weight: 550; }
.lg-points .bi { color: var(--brass); }

/* ---------- sheet ---------- */
.lg-sheet {
  position: relative;
  z-index: 2;
  margin-top: -24px;
  background: var(--ground);
  border-radius: 24px 24px 0 0;
  padding: 26px 20px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: sheet-rise .7s var(--ease-sheet) both;
}
@keyframes sheet-rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.lg-card { width: 100%; max-width: 420px; }
.lg-card-title { font-size: 1.75rem; font-weight: 750; letter-spacing: -.022em; margin: 0 0 4px; }
.lg-card-sub { color: var(--muted); font-size: .9375rem; margin: 0 0 20px; }
.lg-foot { margin: 22px 0 0; color: var(--muted); font-size: .8125rem; display: inline-flex; align-items: center; gap: 6px; }

/* Stock Identity form → native fields */
.lg-card h1, .lg-card section > h2, .lg-card form > h2, .lg-card h3, .lg-card hr { display: none; }
.lg-card .row { display: block; margin: 0; }
.lg-card [class*="col-"] { width: 100%; max-width: 100%; flex: 0 0 100%; padding: 0; margin: 0; }
.lg-card .row > div:last-child:not(:first-child) { display: none; }
.lg-card .form-floating { margin-bottom: 12px !important; }
.lg-card .form-floating > .form-control {
  height: 58px;
  min-height: 58px;
  padding: 1.5rem 1rem .5rem;
  font-size: 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.lg-card .form-floating > label { padding: 1.05rem 1rem; color: var(--muted); font-weight: 500; font-size: .9375rem; }
.lg-card .form-floating > .form-control:focus ~ label,
.lg-card .form-floating > .form-control:not(:placeholder-shown) ~ label { color: var(--muted); transform: scale(.8) translateY(-.55rem) translateX(.15rem); }
.lg-card .form-floating > label::after { background: transparent !important; }
.lg-card .checkbox { margin: 6px 0 18px !important; }
.lg-card .checkbox label { display: inline-flex; align-items: center; gap: 10px; font-size: .9375rem; font-weight: 500; color: var(--ink-2); margin: 0; min-height: 44px; }
.lg-card .checkbox .form-check-input { width: 1.25em; height: 1.25em; margin: 0; }
.lg-card #login-submit, .lg-card button[type="submit"] {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  font-size: 1.0625rem;
  font-weight: 650;
  background: var(--ink);
  border: 0;
  color: #fff;
}
.lg-card #login-submit:hover { background: #2A2E37; }
.lg-card #login-submit:active { transform: scale(.98); }
.lg-card form p { margin: 14px 0 0; text-align: center; }
.lg-card form p a { color: var(--ink) !important; font-weight: 600; font-size: .9375rem; text-decoration: none; }
.lg-card form p a:hover { text-decoration: underline; }
/* Self-registration and resend links stay off a secure repository sign-in */
.lg-card #resend-confirmation, .lg-card a[href*="Register"], .lg-card a[href*="ResendEmailConfirmation"] { display: none; }
.lg-card p:has(> a[href*="Register"]), .lg-card p:has(> #resend-confirmation) { display: none; }
.lg-card .text-danger { font-size: .875rem; }
.lg-card .validation-summary-errors { background: #F8E3E1; color: #7E1B15; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.lg-card .validation-summary-valid { display: none; }

/* ---------- desktop split ---------- */
@media (min-width: 992px) {
  .lg-shell { grid-template-rows: none; grid-template-columns: minmax(0, 1.15fr) minmax(440px, .85fr); }
  .lg-stage { padding: 40px 56px 44px; gap: 28px; justify-content: space-between; min-height: 100dvh; }
  .lg-appicon { width: 60px; height: 60px; border-radius: 16px; }
  .lg-product { font-size: 1.1875rem; }
  .lg-points { display: flex; }
  .lg-sheet { margin: 0; border-radius: 0; justify-content: center; padding: 48px; animation: none; }
  .lg-card { background: var(--surface); border-radius: var(--r-lg); padding: 36px 34px; box-shadow: var(--depth-2); }
}

/* =====================================================================
   The scene: 360 × 300 design box, scaled per viewport.
   One 10s loop; every part keys off the same clock.
   ===================================================================== */
.scene-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.scene { position: relative; width: 360px; height: 300px; --t: 10s; transform-origin: top center; }
@media (max-width: 400px) { .scene { transform: scale(.86); margin-bottom: -42px; } }
@media (min-width: 992px) { .scene { transform: scale(1.28); margin: 20px 0 84px; } }
@media (min-width: 1400px) { .scene { transform: scale(1.45); margin-bottom: 136px; } }

.doc {
  position: absolute; left: 22px; top: 8px; width: 170px; height: 220px;
  background: #fff; border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 28px rgba(0, 0, 0, .45);
  animation: doc var(--t) infinite;
  transform-origin: center;
}
.doc-title { position: absolute; left: 14px; top: 14px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--ink); }
.doc .ln { position: absolute; left: 14px; height: 6px; border-radius: 3px; background: #C9CDD5; }
.doc .ln-soft { background: #E1E4E9; }
.doc .ln-strong { background: #8A909C; height: 8px; }
.doc-seal { position: absolute; left: 14px; bottom: 16px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #E1E4E9; }

.beam {
  position: absolute; left: 16px; width: 182px; height: 2px; top: 18px;
  background: var(--brass);
  box-shadow: 0 0 12px 2px rgba(201, 162, 74, .55), 0 -18px 22px -8px rgba(201, 162, 74, .28);
  border-radius: 2px;
  opacity: 0;
  animation: beam var(--t) infinite;
}
.hit {
  position: absolute; border: 1.5px solid var(--brass); border-radius: 5px;
  background: rgba(201, 162, 74, .10);
  opacity: 0; transform: scale(.94);
}
.hit-1 { left: 31px; top: 43px; width: 114px; height: 16px; animation: hit1 var(--t) infinite; }
.hit-2 { left: 31px; top: 81px; width: 134px; height: 16px; animation: hit2 var(--t) infinite; }
.hit-3 { left: 108px; top: 175px; width: 80px; height: 18px; animation: hit3 var(--t) infinite; }

.fields {
  position: absolute; left: 164px; top: 36px; width: 186px;
  background: var(--surface); color: var(--ink);
  border-radius: 14px; padding: 10px 12px 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  animation: fields var(--t) infinite;
}
.fields-head { font-size: 11px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.fields-head .bi { color: var(--brass); }
.fld { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; padding: 6px 0; border-top: 1px solid var(--line); opacity: 0; transform: translateX(-8px); }
.fld span { color: var(--muted); }
.fld b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fld-1 { animation: fld1 var(--t) infinite; }
.fld-2 { animation: fld2 var(--t) infinite; }
.fld-3 { animation: fld3 var(--t) infinite; }

.classify {
  position: absolute; left: 196px; top: 166px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--sens-operational); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(6px) scale(.96);
  animation: classify var(--t) infinite;
}
.classify .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.classify em { font-style: normal; font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }

.mini-wallet { position: absolute; left: 10px; right: 10px; top: 244px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mp {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  height: 50px; padding: 6px 8px; border-radius: 10px;
  font-size: 9.5px; font-weight: 650; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}
.mp b { font-size: 15px; font-weight: 750; line-height: 1; position: relative; height: 15px; font-variant-numeric: tabular-nums; }
.mp-g { background: var(--sens-general); color: var(--sens-general-ink); }
.mp-o { background: var(--sens-operational); animation: mp-receive var(--t) infinite; }
.mp-m { background: var(--sens-management); }
.mp-b { background: var(--sens-board); color: #fff; }
.mp-b b { color: var(--brass); }
.mp-o i { font-style: normal; position: absolute; left: 0; top: 0; }
.mp-o .n-old { animation: n-old var(--t) infinite; }
.mp-o .n-new { opacity: 0; animation: n-new var(--t) infinite; }

.scene-caption { position: relative; height: 22px; width: 100%; max-width: 360px; }
.cap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: .8125rem; font-weight: 600; color: rgba(255, 255, 255, .78); opacity: 0; }
.cap .bi { color: var(--brass); }
.cap-1 { animation: cap1 var(--t) infinite; }
.cap-2 { animation: cap2 var(--t) infinite; }
.cap-3 { animation: cap3 var(--t) infinite; }

/* ---------- the clock ---------- */
@keyframes doc {
  0%   { opacity: 0; transform: translateY(10px); }
  5%   { opacity: 1; transform: none; }
  52%  { opacity: 1; transform: none; }
  64%  { opacity: 0; transform: translate(34px, 214px) scale(.16); }
  100% { opacity: 0; transform: translate(34px, 214px) scale(.16); }
}
@keyframes beam {
  0%, 5%  { opacity: 0; top: 18px; }
  8%      { opacity: 1; top: 22px; }
  36%     { opacity: 1; top: 220px; }
  40%     { opacity: 0; top: 224px; }
  100%    { opacity: 0; top: 224px; }
}
@keyframes hit1 { 0%, 11% { opacity: 0; transform: scale(.94); } 13% { opacity: 1; transform: none; } 50% { opacity: 1; transform: none; } 56%, 100% { opacity: 0; } }
@keyframes hit2 { 0%, 17% { opacity: 0; transform: scale(.94); } 19% { opacity: 1; transform: none; } 50% { opacity: 1; transform: none; } 56%, 100% { opacity: 0; } }
@keyframes hit3 { 0%, 31% { opacity: 0; transform: scale(.94); } 33% { opacity: 1; transform: none; } 50% { opacity: 1; transform: none; } 56%, 100% { opacity: 0; } }
@keyframes fields { 0%, 10% { opacity: 0; transform: translateY(6px); } 13% { opacity: 1; transform: none; } 74% { opacity: 1; transform: none; } 80%, 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes fld1 { 0%, 13% { opacity: 0; transform: translateX(-8px); } 16% { opacity: 1; transform: none; } 74% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes fld2 { 0%, 19% { opacity: 0; transform: translateX(-8px); } 22% { opacity: 1; transform: none; } 74% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes fld3 { 0%, 33% { opacity: 0; transform: translateX(-8px); } 36% { opacity: 1; transform: none; } 74% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes classify { 0%, 41% { opacity: 0; transform: translateY(6px) scale(.96); } 45% { opacity: 1; transform: none; } 74% { opacity: 1; transform: none; } 80%, 100% { opacity: 0; } }
@keyframes mp-receive {
  0%, 62% { transform: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); }
  66%     { transform: translateY(-5px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 2px var(--brass); }
  74%     { transform: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 2px var(--brass); }
  84%, 100% { transform: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); }
}
@keyframes n-old { 0%, 63% { opacity: 1; } 65%, 96% { opacity: 0; } 99%, 100% { opacity: 1; } }
@keyframes n-new { 0%, 63% { opacity: 0; transform: translateY(4px); } 66%, 95% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes cap1 { 0%, 3% { opacity: 0; } 6%, 36% { opacity: 1; } 39%, 100% { opacity: 0; } }
@keyframes cap2 { 0%, 38% { opacity: 0; } 41%, 58% { opacity: 1; } 61%, 100% { opacity: 0; } }
@keyframes cap3 { 0%, 60% { opacity: 0; } 63%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }

/* Reduced motion: the finished state, still. */
@media (prefers-reduced-motion: reduce) {
  .doc, .beam, .hit, .fields, .fld, .classify, .mp-o, .mp-o i, .cap, .lg-sheet { animation: none !important; }
  .doc, .hit, .fields, .fld, .classify { opacity: 1 !important; transform: none !important; }
  .beam, .mp-o .n-new, .cap-1, .cap-2 { opacity: 0 !important; }
  .cap-3 { opacity: 1 !important; }
}
