/* The existing Loader Sign geometry is unchanged. Uniform spin, entrance and
   exit use separate elements so a leaving screen never interrupts rotation. */
html:has(.auth-page),body:has(.auth-page),.auth-page{overscroll-behavior-x:none}
.entry-loader-screen,.entry-welcome{min-height:100dvh;display:grid;place-items:center;background:var(--canvas,#0d0e0f);padding:32px}
.entry-loader-screen{opacity:1;transition:opacity 280ms cubic-bezier(.2,.7,.3,1)}
.entry-loader-exit,.entry-loader-presence,.entry-loader-spin{display:block;width:fit-content}
.entry-loader-exit{transform:none;transition:transform 280ms cubic-bezier(.2,.7,.3,1)}
.entry-loader-presence{animation:entry-loader-appear 320ms cubic-bezier(.2,.7,.3,1) both}
.entry-loader-spin{transform-origin:50% 50%;will-change:transform;animation:entry-sign-rotation 2200ms linear infinite}
.entry-loader-sign{display:block;width:120px;height:120px;background:var(--semantic-logotype-sign,#505865);-webkit-mask:url('/assets/loader-sign.svg') center/contain no-repeat;mask:url('/assets/loader-sign.svg') center/contain no-repeat}
/* Compatibility with the pre-JavaScript, single-span loader. */
.entry-loader-screen>.entry-loader-sign{animation:entry-sign-rotation 2200ms linear infinite}
.entry-loader-screen.is-leaving{opacity:0}
.entry-loader-screen.is-leaving .entry-loader-exit{transform:translateY(-6px) scale(.95)}
.entry-load-error-screen{--entry-error-surface:#1C1F24;--entry-error-footer:#24282E;min-height:100dvh;display:grid;place-items:center;box-sizing:border-box;padding:32px 24px;background:var(--canvas,#0D0E0F)}
.entry-load-error-card{width:min(100%,440px);min-width:0;overflow:hidden;border:0;border-radius:24px;background:var(--entry-error-surface);animation:entry-surface-in 240ms ease-out both}
.entry-load-error-content{display:flex;flex-direction:column;align-items:center;padding:32px;gap:0;text-align:center}
.entry-load-error-icon{display:flex;align-items:center;justify-content:center;width:52px;height:52px;margin-bottom:20px;border-radius:50%;background:var(--entry-error-footer);color:var(--text-secondary,#A4ABB3)}
.entry-load-error-icon svg{display:block;width:24px;height:24px;flex:none}
.entry-load-error-content h1{max-width:100%;margin:0;font-family:'Inter Platform',sans-serif;font-size:24px;font-weight:600;line-height:1.3;letter-spacing:-.5px;color:var(--text,#FCFCFC);text-wrap:balance}
.entry-load-error-content p{max-width:100%;margin:14px 0 0;font-size:15px;font-weight:400;line-height:23px;color:var(--text-secondary,#A4ABB3);text-wrap:balance}
.entry-load-error-footer{display:flex;justify-content:center;align-items:center;padding:20px 24px;background:var(--entry-error-footer)}
.entry-load-error-footer .btn{display:inline-flex;flex:0 1 auto;width:max-content;max-width:100%;height:44px;min-height:44px;margin:0;padding:0 20px;border:0;border-radius:12px;background:#FCFCFC;color:#0D0E0F;font-size:15px;font-weight:600;line-height:20px;transition:background-color 220ms ease,color 220ms ease,box-shadow 220ms ease}
.entry-load-error-footer .btn:hover:where(:not([data-action-hover-blocked],[data-action-hover-blocked] *,[data-action-hover-owner-blocked])){background:#DDE1E6;color:#0D0E0F}
.entry-load-error-footer .btn:focus-visible{outline:2px solid var(--text-secondary,#A4ABB3);outline-offset:4px}
html[data-theme="light"] .entry-load-error-screen{--entry-error-surface:var(--panel-alt);--entry-error-footer:var(--panel-hover)}
@media(max-width:480px){.entry-load-error-screen{padding:24px 20px}.entry-load-error-card{border-radius:24px}.entry-load-error-content{padding:28px 24px}.entry-load-error-content h1{font-size:22px;letter-spacing:-.35px}.entry-load-error-content p{font-size:14px;line-height:22px}.entry-load-error-footer{padding:20px 24px}.entry-load-error-break{display:none}}
@media(prefers-reduced-motion:reduce){.entry-load-error-card{animation:none}.entry-load-error-footer .btn{transition:none}}
html[data-theme="light"] .entry-loader-sign{background:var(--semantic-logotype-sign,#A4ABB3)}
@keyframes entry-sign-rotation{from{transform:rotate(0turn)}to{transform:rotate(1turn)}}
@keyframes entry-loader-appear{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none}}

/* Auth steps leave fully before their replacement is committed. Only opacity
   and a small translation animate; intrinsic form size and page layout stay
   unchanged. Shared entrance parameters prevent a second animation when the
   explicit incoming state is removed from an is-entering screen. */
.auth-page.is-entering .auth-card,
.auth-page .auth-card[data-auth-transition="in"]{animation:auth-step-in 220ms cubic-bezier(.2,.7,.3,1) both}
.auth-page .auth-card[data-auth-transition="out"]{animation:auth-step-out 180ms cubic-bezier(.4,0,.6,1) both}
.auth-page .auth-card[data-auth-transition]{pointer-events:none}
.app-shell.is-entering{animation:entry-surface-in 320ms ease-out both}
@keyframes auth-step-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes auth-step-out{from{opacity:1;transform:none}to{opacity:0;transform:translateY(-4px)}}
@keyframes entry-surface-in{from{opacity:0}to{opacity:1}}

/* Hover, focus and autofill share one active input surface. */
/* Static Graphite 1150 matches the dark content canvas in both auth themes. */
.auth-page{overflow:visible;background:#0D0E0F}
.auth-page::before,.auth-page::after{content:none;animation:none;box-shadow:none;will-change:auto}
.auth-card{--auth-card-padding-block:28px;--auth-card-padding-inline:0px;--auth-control-gap:20px;--auth-footer-gap:24px;padding:var(--auth-card-padding-block) var(--auth-card-padding-inline)}
@media(max-width:760px){.auth-card{--auth-card-padding-block:24px;--auth-card-padding-inline:8px}}
.auth-card .auth-input input{transition:background-color 160ms ease,box-shadow 160ms ease}
.auth-card .auth-input input:is([name="username"],[name="password"]),
.auth-card .auth-input input:is([name="username"],[name="password"]):is(:hover,:focus,:focus-visible){border:0;outline:0;box-shadow:none}
.auth-card .auth-input input:is(:hover,:focus),
.auth-card .auth-input:is(:hover,:focus-within) input{background:#24282E;border:0;box-shadow:none}
.auth-card .auth-input input:focus-visible{outline:none}
/* Safari's autofill background is UA-important. Confine that native yellow
   paint to the content box; the existing opaque inset owns the rounded edge. */
.auth-card .auth-input input:is([name="username"],[name="password"])[data-text-input-viewport]{background-clip:content-box!important}
.auth-card .auth-input input:is(:autofill,:-webkit-autofill){-webkit-text-fill-color:#FCFCFC;caret-color:#FCFCFC;box-shadow:0 0 0 1000px #1A1C1F inset}
.auth-card .auth-input input:is(:autofill,:-webkit-autofill):is(:hover,:focus){box-shadow:0 0 0 1000px #24282E inset}
/* WebKit can show a suggested password in clear text even with type=password.
   Keep the native password rendering and override only its ink. */
.auth-card .auth-password>input{-webkit-text-fill-color:var(--org-autofill-ink);caret-color:var(--org-autofill-ink)}
.auth-card .auth-password>input::placeholder{-webkit-text-fill-color:currentColor}
.auth-card .auth-input{position:relative;min-height:48px}
/* Safari's native credentials control uses its own 24px square on Cocoa.
   The 48px field therefore has 12px at top/bottom/right without an eye slot.
   Accepted credentials still reserve the existing separate checkmark slot. */
.auth-card .auth-input input[name="username"]{padding-right:12px}
.auth-card.is-credentials-verified .auth-input input[name="username"]{padding-right:52px}
.auth-card .auth-password{--auth-password-slot:48px}
.auth-card .auth-password input[name="password"]{padding-right:var(--auth-password-slot)}
/* Share one painted colour between the permanent field surface and the
   native autofill cover, even if WebKit rebuilds its editor on eye clicks. */
@property --auth-password-paint{syntax:"<color>";inherits:true;initial-value:#1A1C1F}
.auth-card .auth-password.text-input-surface{
 --auth-password-paint:#1A1C1F;
 background-color:var(--auth-password-paint);border-radius:14px
}
.auth-card .auth-password.text-input-surface:is(:hover,:focus-within){--auth-password-paint:#24282E}
.auth-card .auth-password.text-input-surface>input[data-text-input-viewport]{
 background-color:transparent!important;background-image:none!important;
 box-shadow:inset 0 0 0 1000px var(--auth-password-paint)!important;
 transition:none!important
}
/* Keep the browser-owned Passwords control and its native hit target. Its
   trailing UA margin otherwise adds an unequal gap before our centred eye. */
.auth-card .auth-input input:is([name="username"],[name="password"])::-webkit-credentials-auto-fill-button{margin-inline-end:0}
/* Reserve the text-to-Passwords gap inside WebKit's native trailing layout.
   The end correction keeps its proven key/eye/right geometry unchanged. */
.auth-card .auth-password input[name="password"]::-webkit-credentials-auto-fill-button{margin-inline-start:12px;margin-inline-end:-1px}
.auth-card .auth-password:is(:hover,:focus-within) input{background:#24282E}
.auth-card .auth-password:is(:hover,:focus-within) input:is(:autofill,:-webkit-autofill){box-shadow:0 0 0 1000px #24282E inset}
.auth-card .auth-password>.auth-password-toggle{
 position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;
 width:var(--auth-password-slot,48px);height:48px;margin:0;padding:0;border:0;border-radius:14px;z-index:2;
 background:transparent;color:#6B7481;outline:0;box-shadow:none;
 transition:color 160ms ease
}
.auth-card .auth-password>.auth-password-toggle[hidden]{display:none}
.auth-card .auth-password>.auth-password-toggle:is(:hover:where(:not([data-action-hover-blocked],[data-action-hover-blocked] *,[data-action-hover-owner-blocked])),:focus-visible){background:transparent;color:#FCFCFC;outline:0;box-shadow:none}
.auth-card .auth-input>.auth-credential-check{
 position:absolute;top:50%;right:16px;display:flex;align-items:center;justify-content:center;
 width:20px;height:20px;color:var(--green,#32D74B);pointer-events:none;
 opacity:0;visibility:hidden;transform:translateY(-50%) scale(.8);
 transition:opacity 160ms ease,transform 180ms ease,visibility 0s linear 180ms
}
.auth-card.is-credentials-verified .auth-input>.auth-credential-check{
 opacity:1;visibility:visible;transform:translateY(-50%) scale(1);transition-delay:0s
}
.auth-card .auth-submit-loader{
 display:block;flex:0 0 20px;width:20px;height:20px;box-sizing:border-box;
 border:2px solid currentColor;border-right-color:transparent;border-radius:50%;
 animation:spin 800ms linear infinite
}
@media(prefers-reduced-motion:reduce){.auth-card .auth-submit-loader{animation:none!important}}
/* Login typography and spacing follow the user's latest form adjustments. */
.auth-card[data-form="login"]{display:flex;flex-direction:column;--auth-footer-color:#5b626b}
.auth-card[data-form="login"] .auth-brand{margin:0 0 34px}
.auth-card[data-form="login"] .auth-input{margin:0}
.auth-card[data-form="login"] .auth-input+.auth-input{margin-top:var(--auth-control-gap)}
.auth-card[data-form="login"] .auth-input input::placeholder{font-size:15px}
.auth-card[data-form="login"] .auth-remember{margin:var(--auth-control-gap) 0 0}
.auth-card[data-form="login"]>.btn-primary{font-size:16px;margin:var(--auth-control-gap) 0 0}
.auth-card:is([data-form="login"],[data-form="entry-code"])>.btn-primary[aria-disabled="true"]{background:#FFFFFF;color:#0D0E0F;opacity:1;transition:none;pointer-events:none;cursor:default}
.auth-footer{
 --auth-footer-rest-gap:calc(var(--auth-footer-gap) - var(--auth-control-gap));
 position:relative;min-width:0;height:calc(20px + var(--auth-footer-rest-gap));margin-top:var(--auth-control-gap)
}
/* Reserve scroll room for the expanded feedback on short viewports. */
.auth-footer::after{content:"";position:absolute;inset:0 0 auto;height:calc(var(--auth-submit-height) + var(--auth-footer-gap) + 20px);pointer-events:none}
.auth-footer>.btn{display:block;width:max-content;max-width:100%;height:20px;min-height:0;padding:0;border:0;border-radius:0;background:transparent;color:var(--auth-footer-color,#5b626b);font-size:14px;font-weight:500;line-height:20px;margin:0 auto;text-align:center}
.auth-card[data-form="entry-code"]>:is(.btn-primary,.auth-recovery-code-link){display:flex;margin-top:var(--auth-control-gap)}
.auth-card[data-form="entry-code"]>.auth-recovery-code-link{text-align:center}
.auth-card[data-form="entry-code"]>.auth-recovery-code-link[aria-disabled="true"]{pointer-events:none;opacity:.5}
.auth-footer>.btn:not(:disabled):is(:hover:where(:not([data-action-hover-blocked],[data-action-hover-blocked] *,[data-action-hover-owner-blocked])),:focus-visible){color:#878F9A}
.auth-footer>.btn:is(:focus,:focus-visible){outline:0;box-shadow:none}
.auth-footer>.btn:focus-visible{background:transparent;text-decoration:underline;text-underline-offset:3px}
.auth-footer>.btn:disabled{color:var(--auth-footer-color,#5b626b);background:transparent;opacity:1;pointer-events:none;cursor:default;text-decoration:none;transition:none}
@media(prefers-reduced-motion:no-preference){
 .auth-card .auth-input input{transition:background-color 220ms ease,color 220ms ease,border-color 220ms ease,box-shadow 220ms ease,opacity 220ms ease}
 .auth-card>.btn,.auth-footer>.btn{transition:background-color 220ms ease,color 220ms ease,border-color 220ms ease,box-shadow 220ms ease,opacity 220ms ease}
 .auth-card .auth-password.text-input-surface{transition:--auth-password-paint 220ms ease}
 .auth-card .auth-password>.auth-password-toggle{transition:color 220ms ease}
 .auth-recovery-overlay :is(.btn,.icon-button){transition:background-color 220ms ease,color 220ms ease,border-color 220ms ease,box-shadow 220ms ease,opacity 220ms ease}
}
/* The footer expands beneath the controls while its resting height anchors them. */
.auth-footer>:is(.entry-credentials-slot,.entry-code-slot){
 display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;min-width:0;margin-bottom:var(--auth-footer-rest-gap);
 transition:grid-template-rows 220ms cubic-bezier(.2,.7,.3,1),margin-bottom 220ms cubic-bezier(.2,.7,.3,1)
}
.auth-footer>:is(.entry-credentials-slot,.entry-code-slot).is-visible{grid-template-rows:minmax(0,1fr);margin-bottom:var(--auth-footer-gap)}
.auth-footer .entry-auth-error{
 min-height:var(--auth-submit-height);margin:0;padding:12px 16px;border:0;border-radius:12px;
 display:flex;align-items:safe center;justify-content:center;
 background:#24282E;color:#FCFCFC;font-size:15px;font-weight:400;line-height:22px;
 text-align:center;text-wrap:balance;overflow-wrap:break-word;
 opacity:0;visibility:hidden;transform:translateY(8px);
 transition:opacity 180ms ease,transform 220ms cubic-bezier(.2,.7,.3,1),visibility 0s linear 220ms
}
.auth-footer>.is-visible>.entry-auth-error{opacity:1;visibility:visible;transform:none;transition-delay:0s}
@media(max-width:480px){
 .auth-footer .entry-auth-error{padding:4px 12px;line-height:20px}
}
.auth-card-code{max-width:396px}
.entry-auth-heading{text-align:center;margin:0 0 28px}
.auth-card .entry-auth-heading h1{font-family:'Inter Platform',sans-serif;font-size:26px;line-height:1.25;margin:0 0 8px;letter-spacing:-.6px}
.entry-auth-heading p{color:#878F9A;font-size:14px;line-height:1.6}
.otp-field{position:relative;display:block;margin:24px 0 0;cursor:text}
.auth-card .otp-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;z-index:1;cursor:text;font-size:18px;caret-color:transparent}
.otp-cells{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.otp-cell{min-width:0;height:58px;border:0;background:#1A1C1F;border-radius:14px;display:flex;align-items:center;justify-content:center;color:#FCFCFC;font-size:25px;font-weight:600;font-variant-numeric:tabular-nums;transition:background-color 160ms ease}
.otp-cell:hover:where(:not([data-action-hover-blocked],[data-action-hover-blocked] *,[data-action-hover-owner-blocked])){background:#24282E}
.otp-field:focus-within{outline:0;box-shadow:none}
.otp-field:focus-within .otp-cell.is-active{background:#24282E;box-shadow:none}
.auth-card .otp-input:is(:focus,:focus-visible){border:0;outline:0;box-shadow:none}
.entry-auth-error{text-align:center;min-height:18px}

/* Centre the avatar and greeting together, including a wrapped greeting. */
.entry-welcome{
 --avatar-size:168px;
 position:relative;height:100dvh;min-height:100dvh;padding:0;overflow:hidden
}
.entry-welcome-content{position:relative;display:flex;flex-direction:column;align-items:center;gap:18px;width:100%;height:auto;max-width:none;padding:0 16px}
.entry-welcome-avatar{position:relative;flex:0 0 auto;width:var(--avatar-size);height:var(--avatar-size);border:1px solid var(--border);border-radius:50%;overflow:hidden;display:grid;place-items:center;background:var(--panel-hover);box-shadow:0 0 0 8px var(--canvas);font-size:28px}
.entry-welcome-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.entry-welcome h1{margin:0;width:100%;font-family:'Inter Platform',sans-serif;text-align:center;font-size:clamp(24px,3vw,36px);font-weight:600;line-height:1.35;letter-spacing:-.8px;overflow-wrap:anywhere}
.entry-welcome.is-entering .entry-welcome-content{animation:entry-welcome-in 240ms ease both}
@keyframes entry-welcome-in{from{opacity:0}to{opacity:1}}
@media(max-width:760px){
 .entry-loader-sign{width:88px;height:88px}.entry-loader-screen{padding:24px}
 .auth-card-code{max-width:360px}.otp-cells{gap:8px}.otp-cell{height:52px;border-radius:12px;font-size:23px}
 .auth-card .entry-auth-heading h1{font-size:24px}
 .auth-card[data-form="login"] .auth-brand{margin-bottom:28px}
 .entry-welcome{--avatar-size:140px}
}
/* Reserve feedback without pushing OTP controls off a short phone screen.
   Smaller keyboard viewports retain normal document scrolling. */
@media(max-width:760px) and (max-height:640px){
 .auth-card-code{--auth-card-padding-block:12px}
 .auth-card-code .auth-brand{margin-bottom:16px}
 .auth-card-code .entry-auth-heading{margin-bottom:16px}
 .auth-card-code .otp-field{margin-top:16px}
}
@media(max-width:360px){
 .entry-welcome{--avatar-size:128px}
}
@media(max-height:500px){
 .entry-welcome{--avatar-size:100px}
 .entry-welcome h1{font-size:22px}
}
@media(max-height:360px){.entry-welcome{--avatar-size:80px}}
@media(prefers-reduced-motion:reduce){
 .entry-loader-screen,.entry-loader-exit,.entry-loader-presence,.entry-loader-spin,
 .entry-loader-sign,.entry-welcome-content,.entry-welcome-avatar,
 .entry-welcome h1,
 .auth-page.is-entering .auth-card,.auth-page .auth-card[data-auth-transition],.app-shell.is-entering,
 .auth-card .auth-input input,.auth-password-toggle,.auth-credential-check,.auth-footer>:is(.entry-credentials-slot,.entry-code-slot),.entry-credentials-error,.entry-code-error,.otp-cell{animation:none!important;transition:none!important}
}
