/* Original MAX auth mark, sweep, float and rotating conic glow. */
body.auth-open { background: #0d0d0d; }
.auth-screen { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; min-height: 100vh; min-height: 100svh; width: 100%; max-width: none !important; margin: 0 !important; padding: 112px 24px 92px !important; overflow: hidden; }
.auth-background { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.auth-halo { position: absolute; width: min(760px,110vw); aspect-ratio: 1; top: -470px; left: 50%; transform: translateX(-50%); opacity: .32; }
.auth-halo::after, .auth-panel-glow::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 90deg,#0cf 59.4deg,#0026ff 122.4deg,#a500c6 180deg,#0cf 241.2deg,#0026ff 298.8deg,#a500c6 360deg); filter: blur(64px); animation: max-auth-rotate 8s linear infinite; }
.auth-top { position: absolute; top: max(30px,env(safe-area-inset-top,0px)); left: max(40px,env(safe-area-inset-left,0px)); right: max(40px,env(safe-area-inset-right,0px)); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.auth-product { font-size: 23px; font-weight: 750; letter-spacing: -.7px; color: white; }
.auth-product > span { font-size: 20px; font-weight: 450; color: #9d90ae; margin-left: 4px; }
.auth-demo-badge { font-size: 12px; color: #a294b3; padding: 7px 11px; border: 1px solid #302a38; border-radius: 30px; background: #13101666; }
.auth-panel { position: relative; isolation: isolate; overflow: hidden; width: 440px; max-width: 100%; padding: 38px 38px 27px; border: 1px solid #ffffff12; border-radius: 32px; background: linear-gradient(180deg,#1b1522eb,#161419f7 43%,#151318); box-shadow: 0 20px 80px #0005, inset 0 1px 0 #ffffff05; animation: dialogIn .5s ease both; }
.auth-panel-glow { position: absolute; z-index: -1; width: 100%; aspect-ratio: 1; top: -335px; left: 0; pointer-events: none; opacity: .6; }
.auth-panel-glow::after { filter: blur(44px); }
.auth-symbol-wrap { display: flex; justify-content: center; padding: 0 0 29px; }
.auth-symbol { position: relative; display: block; width: 98px; height: 98px; background: url('assets/max-auth-logo.png') center / contain no-repeat; animation: max-auth-jump 3s linear infinite; filter: drop-shadow(0 12px 24px #6330ff2b); }
.auth-symbol::after { content: ''; position: absolute; inset: 0; -webkit-mask: url('assets/max-auth-logo.png') center / contain no-repeat; mask: url('assets/max-auth-logo.png') center / contain no-repeat; background: linear-gradient(90deg,#fff0 15%,#ffffff4d 35%,#fff0 55%) 0 0 / 200% 100%; animation: max-auth-sweep 4s linear infinite; }
.auth-heading { text-align: center; margin-bottom: 30px; }
.auth-heading h1 { font-size: 29px; letter-spacing: -1px; font-weight: 600; line-height: 1.2; color: #faf7ff; }
.auth-heading h1:focus { outline: none; }
.auth-heading p { font-size: 16px; line-height: 1.5; color: #a599b1; margin: 12px 0 0; }
.auth-form { margin: 0; }
.auth-label { display: block; margin: 0 0 8px 2px; color: #c6bcd0; font-size: 14px; }
.auth-phone-field { display: flex; gap: 11px; align-items: center; height: 58px; padding: 0 16px; border: 1px solid #39323f; border-radius: 15px; background: #0d0b11b3; color: #857491; transition: border-color .2s, box-shadow .2s; }
.auth-phone-field:focus-within { border-color: #8660ff; box-shadow: 0 0 0 3px #7247ff18; }
.auth-phone-field svg { width: 20px; height: 20px; stroke-width: 1.5; }
.auth-phone-field input { width: 100%; min-width: 0; border: 0; background: none; outline: none; box-shadow: none; font-size: 17px; color: #f6f0ff; padding: 0; letter-spacing: .2px; }
.auth-phone-field input::placeholder { color: #77697f; opacity: 1; }
.auth-field-hint { font-size: 12px; color: #8e7e9d; line-height: 1.5; margin: 9px 2px 22px; }
.auth-primary { display: block; width: 100%; min-height: 54px; border-radius: 15px; padding: 13px 20px; background: linear-gradient(108deg,#471aff 0%,#671cff 72%,#8324fb); color: #fff; font-size: 16px; font-weight: 550; box-shadow: 0 8px 24px #471aff26; transition: filter .2s, transform .2s; }
.auth-primary:hover { filter: brightness(1.12); }
.auth-secondary { min-height: 48px; width: 100%; background: none; color: #b69ae2; font-size: 14px; margin-top: 8px; padding: 10px; border-radius: 12px; }
.auth-secondary:hover { background: #ffffff04; }
.auth-note { display: flex; justify-content: center; gap: 8px; color: #796e86; padding-top: 20px; margin-top: 16px; border-top: 1px solid #ffffff09; text-align: center; }
.auth-note svg { width: 15px; height: 15px; margin-top: 3px; color: #8d78a3; }
.auth-note p { margin: 0; font-size: 12px; line-height: 1.6; }
.auth-bottom { position: absolute; bottom: max(24px,env(safe-area-inset-bottom,0px)); left: 24px; right: 24px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 24px; color: #756a81; font-size: 12px; }
.auth-bottom button { background: none; color: #9483a5; font-size: 12px; padding: 12px 0; min-height: 44px; }
.auth-error { font-size: 13px; color: #ffa4bb; margin: 10px 2px; line-height: 1.45; }
.auth-phone-field:has([aria-invalid="true"]), .auth-code[aria-invalid="true"] { border-color: #c95780; }
.auth-change-number { display: flex; align-items: center; justify-content: center; gap: 7px; margin: -10px auto 22px; padding: 10px 2px; min-height: 44px; background: none; color: #b69ddb; font-size: 14px; max-width: 100%; }
.auth-change-number svg { width: 16px; height: 16px; transform: rotate(180deg); }
.auth-change-number > span:first-of-type { color: #d0c4df; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-change-number > span:last-child { font-size: 12px; }
.auth-code-label { text-align: center; margin-bottom: 12px; }
.auth-code { display: block; width: 100%; height: 64px; border: 1px solid #493656; border-radius: 16px; background: #0c0a11; color: white; font: 500 28px/1.3 ui-monospace,monospace; letter-spacing: .35em; text-align: center; padding: 0 0 0 .35em; }
.auth-code::placeholder { color: #695978; opacity: 1; }
#codeForm .auth-field-hint { text-align: center; font-size: 13px; }
#codeForm .auth-field-hint button { color: #c6a4ff; font: inherit; letter-spacing: .6px; background: #30213f; border-radius: 6px; padding: 8px; min-height: 44px; }
#authGallery { animation: cardIn .35s ease both; }
.auth-restart { cursor: pointer; min-height: 44px; border: 0; }
.auth-symbol, .auth-symbol::after, .auth-halo::after, .auth-panel-glow::after { animation-play-state: var(--auth-play-state,running); }
.auth-paused .auth-symbol, .auth-paused .auth-symbol::after, .auth-paused .auth-halo::after, .auth-paused .auth-panel-glow::after { animation-play-state: paused; }
@keyframes max-auth-sweep { 0%,40% { background-position: 100% 0; } 50%,100% { background-position: -100% 0; } }
@keyframes max-auth-jump { 0%,100% { transform: translateY(0%); } 50% { transform: translateY(10%); } }
@keyframes max-auth-rotate { 0% { transform: rotate(0); } 50% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .auth-screen { justify-content: flex-start; padding: calc(92px + env(safe-area-inset-top,0px)) max(18px,env(safe-area-inset-right,0px)) calc(105px + env(safe-area-inset-bottom,0px)) max(18px,env(safe-area-inset-left,0px)) !important; }
  .auth-top { top: calc(18px + env(safe-area-inset-top,0px)); left: max(22px,env(safe-area-inset-left,0px)); right: max(22px,env(safe-area-inset-right,0px)); }
  .auth-product { font-size: 21px; }
  .auth-product > span { font-size: 18px; }
  .auth-demo-badge { font-size: 11px; padding: 6px 8px; }
  .auth-halo { width: 600px; top: -430px; opacity: .35; }
  .auth-panel { width: 400px; padding: 22px 12px 16px; background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .auth-panel-glow { top: -280px; opacity: .16; }
  .auth-symbol { width: 92px; height: 92px; }
  .auth-symbol-wrap { padding-bottom: 28px; }
  .auth-heading { margin-bottom: 30px; }
  .auth-heading h1 { font-size: clamp(25px,6.9vw,29px); }
  .auth-heading p { font-size: 15px; }
  .auth-phone-field { height: 58px; }
  .auth-note { margin-top: 12px; padding-top: 20px; }
  .auth-bottom { bottom: calc(8px + env(safe-area-inset-bottom,0px)); flex-direction: column; gap: 0; }
}
@media (max-height: 730px) and (max-width: 600px) {
  .auth-screen { padding-top: calc(75px + env(safe-area-inset-top,0px)) !important; }
  .auth-symbol { width: 70px; height: 70px; }
  .auth-symbol-wrap { padding-bottom: 22px; }
  .auth-heading { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-symbol, .auth-symbol::after, .auth-halo::after, .auth-panel-glow::after, .auth-panel, #authGallery { animation: none !important; }
  #motionToggle { display: none; }
}
#phoneForm .auth-primary {
    margin-top: 50px;
}

#phoneHint {
    margin: 14px 0 18px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    color: #8e879f;
}

#phoneForm .auth-primary {
    margin-top: 0;
}