/* Partner Arcade: the login card and the signed-out header. Load after shared.css and wallet.css.
   A raised clay plate on the dimmed scene, one light from the upper right. The code slots are
   recesses pressed into the plate; each digit you type drops in as a small light key. */

/* ---------- header states: html.auth-unknown (first load), html.is-guest, signed in ---------- */
.loginkey, .top__logout { display: none; }
html.is-guest .loginkey { display: inline-block; }
html.is-guest .top__wallet .bal, html.is-guest .top__wallet .depkey:not(.loginkey),
html.auth-unknown .top__wallet .depkey { display: none; }
html:not(.is-guest):not(.auth-unknown) .top__logout { display: inline-block; }
.loginkey .depkey__face { padding: 0 20px 0 16px; }
.loginkey:hover svg { transform: translateX(2px); }
.wallet__logout { align-self: center; margin: 2px 0 4px; font-size: 14px; }

/* ---------- overlay ---------- */
.login-ov {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 64px 16px 24px; overflow-y: auto;
  background: radial-gradient(80% 70% at 50% 45%, rgba(10, 10, 10, .58), rgba(4, 4, 4, .9));
  animation: ovin .25s var(--ease);
}
.login-ov[hidden] { display: none; }
.login-ov.is-out { animation: ovout .2s ease-in forwards; }
.login-ov.is-out .login { animation: wout .2s ease-in forwards; }
html.login-lock { overflow: hidden; }

/* ---------- the card ---------- */
.login input, .login label { margin: 0; }
.login .field input { width: auto; padding: 0; border: 0; border-radius: 0; }
.login {
  position: relative; margin: 0; width: min(424px, 100%); padding: 30px 28px 24px; border-radius: 26px;
  background:
    radial-gradient(110% 55% at 100% 0%, rgba(255, 255, 255, .055), rgba(255, 255, 255, 0) 58%),
    linear-gradient(195deg, #222224, #19191b 58%, #141416);
  box-shadow: var(--clay-edge), inset 0 0 0 1px rgba(255, 255, 255, .025), -26px 40px 70px rgba(0, 0, 0, .72), -6px 10px 18px rgba(0, 0, 0, .45);
  transform-origin: 50% 40%; animation: win .42s var(--spring);
}
/* the envelope render rests on the top-right corner; its shadow falls down-left onto the plate */
.login__prop { position: absolute; right: -34px; top: -58px; width: 124px; pointer-events: none; filter: drop-shadow(-16px 24px 16px rgba(0, 0, 0, .6)); }
.login__prop img { display: block; width: 100%; height: auto; rotate: 9deg; filter: brightness(1.08); animation: bob 7s ease-in-out infinite; }
.login__close { position: absolute; left: 18px; top: 18px; min-width: 0; width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.login__close svg { width: 15px; height: 15px; }
.login__close[hidden] { display: none; }

.login__step { display: flex; flex-direction: column; }
.login__step[hidden] { display: none; }
.login__step > * { animation: rise .5s var(--ease) backwards; }
.login__step > :nth-child(2) { animation-delay: .04s; } .login__step > :nth-child(3) { animation-delay: .08s; }
.login__step > :nth-child(4) { animation-delay: .12s; } .login__step > :nth-child(n+5) { animation-delay: .16s; }

.login .eyebrow { margin: 34px 0 14px; }
.login h2 {
  margin: 0; max-width: 11ch; font: 850 clamp(32px, 7vw, 40px)/.96 var(--display); font-stretch: 88%; font-variation-settings: 'wdth' 88;
  letter-spacing: -.035em; text-wrap: balance;
}
.login__sub { margin: 14px 0 24px; max-width: 34ch; font: 400 15px/1.55 var(--sans); color: var(--t2); text-wrap: pretty; }
.login__sub b { font-weight: 500; color: var(--cream); overflow-wrap: anywhere; }

.login__form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.login__form .keycap { margin-top: 8px; }
.login .field svg { width: 18px; height: 18px; flex: none; color: var(--t3); transition: color .2s; }
.login .field:focus-within svg { color: var(--cream); }
.login .field input { font: 500 16px/1 var(--sans); font-variant-numeric: normal; }
.login .field input::placeholder { color: var(--t3); }
.login .field.is-bad { animation: nudge .38s var(--ease); }

.login__err {
  margin: 2px 0 0; padding: 11px 14px; border-radius: 14px; background: var(--error-fill); box-shadow: inset 0 0 0 1px var(--error-line);
  font: 400 13.5px/1.45 var(--sans); color: var(--error-text);
}
.login__err[hidden] { display: none; }

/* busy keycap: the label gives way to three dots that breathe */
.keycap.is-busy { pointer-events: none; }
.keycap.is-busy .keycap__face > * { opacity: 0; }
.keycap.is-busy .keycap__face { position: relative; }
.keycap.is-busy .keycap__face::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: currentColor;
  box-shadow: -14px 0 0 currentColor, 14px 0 0 currentColor; animation: dots 1s ease-in-out infinite;
}
@keyframes dots { 50% { opacity: .35; } }

.login__or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 22px 0 18px; }
.login__or .groove { height: 2px; }
.login__or span:not(.groove) { font: 500 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--t3); }

.login__sso { display: flex; width: 100%; height: 52px; gap: 10px; place-content: center; align-items: center; border-radius: 17px; text-decoration: none; font-size: 15px; box-shadow: var(--sh-clay-key); }
.login__sso svg { width: 16px; height: 16px; transition: transform .3s var(--spring); }
.login__sso:hover svg { transform: translate(2px, -2px); }

.login__fine { margin: 18px 0 0; font: 400 12.5px/1.5 var(--sans); color: var(--t2); text-align: center; text-wrap: pretty; }

/* ---------- code step ---------- */
.login__back { align-self: flex-start; margin-top: 30px; font-size: 14px; }
.login__step--code h2 { margin-top: 18px; }

.otp { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 9px; border-radius: 20px; background: linear-gradient(200deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-socket); }
.otp input {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; opacity: 0;
  font-size: 16px; color: transparent; caret-color: transparent; background: none; cursor: text;
}
.otp__cell {
  position: relative; display: grid; place-items: center; height: 56px; border-radius: 13px;
  background: linear-gradient(200deg, #0c0c0d, #121213); box-shadow: inset -2px 3px 5px rgba(0, 0, 0, .7), inset 1px -1px 2px rgba(255, 255, 255, .04);
  font: 850 26px/1 var(--display); font-stretch: 100%; font-variation-settings: 'wdth' 100; font-variant-numeric: tabular-nums; color: var(--ink);
  transition: box-shadow .2s var(--ease);
}
.otp__cell.is-on {
  background: radial-gradient(130% 140% at 75% 10%, #fbfaf7 0%, #ecebe6 55%, #dcdbd6 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .9), inset 0 -2px 3px rgba(0, 0, 0, .08), 0 3px 0 #a3a29d, -5px 8px 10px rgba(0, 0, 0, .5);
  translate: 0 -3px; animation: drop .32s var(--spring);
}
@keyframes drop { from { translate: 0 -12px; scale: 1.12; opacity: 0; } }
.otp.is-focus .otp__cell.is-next { box-shadow: inset -2px 3px 5px rgba(0, 0, 0, .7), inset 0 0 0 1.5px rgba(242, 240, 236, .42); }
.otp.is-focus .otp__cell.is-next::after { content: ""; width: 2px; height: 24px; border-radius: 1px; background: var(--cream); animation: caret 1.05s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.otp.is-bad { animation: nudge .38s var(--ease); }
.otp.is-bad .otp__cell { box-shadow: inset -2px 3px 5px rgba(0, 0, 0, .7), inset 0 0 0 1.5px var(--error-line); }
.otp.is-bad .otp__cell.is-on { color: #6d3a32; }
@keyframes nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.login__hint { margin: 16px 0 0; font: 400 13px/1.5 var(--sans); color: var(--t2); text-align: center; text-wrap: pretty; }
.login__resend { margin: 8px 0 0; font: 400 14px/1.5 var(--sans); color: var(--t2); text-align: center; }
.login__resend .textlink { font-size: 14px; }
.login__resend .textlink:disabled { cursor: default; color: var(--t2); border-bottom-color: transparent; font-variant-numeric: tabular-nums; }

/* ---------- done ---------- */
.login__step--done { align-items: center; padding: 46px 0 20px; text-align: center; }
.login__done-led {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; color: var(--ink);
  background: radial-gradient(110% 110% at 75% 18%, #ffffff, #ecebe6 50%, #cfcec8);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .9), -10px 16px 22px rgba(0, 0, 0, .55), 0 0 0 10px rgba(242, 240, 236, .05), 0 0 46px rgba(242, 240, 236, .22);
  animation: pop .5s var(--spring);
}
.login__done-led svg { width: 34px; height: 34px; }
.login__done-led path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick .45s var(--ease) .18s forwards; }
@keyframes pop { from { scale: .4; opacity: 0; } }
@keyframes tick { to { stroke-dashoffset: 0; } }
.login__step--done h2 { margin: 24px auto 0; max-width: none; }
.login__step--done .login__sub { margin: 10px auto 0; }

@media (max-width: 480px) {
  .login { padding: 26px 20px 20px; }
  .login__prop { right: -10px; top: -50px; width: 98px; }
  .otp { gap: 6px; padding: 7px; }
  .otp__cell { height: 50px; font-size: 23px; }
}
