.top-actions{display:flex;gap:10px;align-items:center}

.auth-page{min-height:100vh;background:#fff}
.auth-header{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:112px}
.auth-header .brand{font-size:1.35rem;color:var(--accent)}
.auth-header .brand-logo{width:48px;height:48px}
.auth-header>.auth-link{white-space:nowrap}
.auth-main{max-width:970px;margin-block:42px 70px}
.auth-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);align-items:start;gap:clamp(28px,6vw,68px)}
.auth-form-card{padding-block:0 12px}
.auth-card h1{font-size:clamp(1.8rem,4vw,2.45rem);letter-spacing:-.04em;margin-bottom:26px}

.wechat-card{width:100%;max-width:350px;justify-self:center;margin-block-start:4px;padding:20px 14px 16px;text-align:center;background:#f7f4ff;border:1px solid #e5def6;border-radius:24px}
.auth-form-card h1,.wechat-card h2{line-height:1.2}
.wechat-card h2{font-size:1.3rem;margin-bottom:8px}
.wechat-card .auth-note{max-width:22em;margin-inline:auto}
#wechat-qr iframe{display:block;width:min(300px,100%);height:400px;zoom:.88;border:0;border-radius:14px;margin:14px auto 4px;background:white}
#wechat-qr-status:empty{display:none}

.auth-card fieldset{border:0;margin:0;padding:0;min-width:0}
.auth-card label{display:block;font-weight:700;margin:0 0 8px}
.auth-card input{width:100%;min-width:0;min-height:56px;padding:12px 20px;border:1px solid #e2ddef;border-radius:29px;background:#faf8fd;color:var(--ink)}
.auth-card input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.field-row{margin-bottom:18px}
.field-row{display:flex;align-items:center;gap:10px}
.grouped-field{min-height:56px;padding-inline:17px;border:1px solid #e2ddef;border-radius:29px;background:#faf8fd}
.grouped-field input{padding:12px 3px;min-height:54px;border:0;background:transparent}
.grouped-field input:focus-visible{outline:0}
.grouped-field:focus-within{outline:2px solid var(--accent);outline-offset:1px}
.grouped-field .auth-link,.phone-prefix{flex:none}
.grouped-field .auth-link{border-inline-start:1px solid #ddd5ee;padding-inline-start:12px;white-space:nowrap}
.phone-prefix{color:var(--muted);font-weight:700}

.password-row{position:relative}
.password-row input{padding-inline-end:60px}
.password-toggle{position:absolute;inset-inline-end:7px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:42px;height:42px;padding:0;border:0;border-radius:50%;background:#eeebf4;color:var(--ink)}
.password-toggle:hover{background:#e4dff0}
.password-toggle[aria-pressed="false"] .password-slash{display:none}

.auth-link{color:var(--accent);text-decoration:underline;text-underline-offset:3px;background:none;border:0;padding:5px 0;font:inherit;font-weight:650}
.auth-note,.auth-agreement{font-size:.9rem;line-height:1.6}
.auth-agreement{margin-block:8px 20px}
.auth-agreement a{color:var(--accent);text-decoration:underline}
.feedback{color:var(--accent)}
.feedback:empty{display:none}
.submit{width:100%;min-height:54px;border-radius:29px}
.auth-password-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.auth-switch{display:flex;justify-content:center;flex-wrap:wrap;gap:8px 20px;margin-top:14px}
.auth-main [hidden]{display:none}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

@media(max-width:740px){
  .top-actions{gap:6px}
  .top-actions .button{padding-inline:9px}
  .auth-header{gap:8px;min-height:74px}
  .auth-header .brand{font-size:1.05rem}
  .auth-header .brand-logo{width:38px;height:38px}
  .auth-header>.auth-link{font-size:.9rem}
  .auth-main{margin-block:19px 42px}
  .auth-layout{grid-template-columns:1fr;gap:24px}
  .auth-form-card{padding-block:4px}
  .wechat-card{margin-block-start:0}
}
@media(max-width:380px){.top-actions{width:100%}.grouped-field{padding-inline:12px}}

.registration-layout{display:block;max-width:480px;margin-inline:auto}
.registration-layout .auth-form-card{padding:clamp(16px,4vw,32px);border:1px solid var(--line);border-radius:24px;background:white}
#registration-fields{margin-block:4px 0}

.captcha-dialog{width:min(470px,calc(100% - 24px));max-height:90dvh;padding:20px;border:1px solid var(--line);border-radius:22px;background:#fff;color:var(--ink)}
.captcha-dialog::backdrop{background:#211b3590}
.captcha-header{display:flex;align-items:center;gap:14px;margin-bottom:14px}
.captcha-header h2{font-size:1.2rem;margin:0 auto 0 0}
.captcha-board{position:relative;overflow:hidden;border-radius:12px}
.captcha-board img{display:block;width:100%;height:auto}
.captcha-tiles{position:absolute;inset:0;display:grid;grid-template:repeat(2,1fr)/repeat(4,1fr)}
.captcha-tiles button{border:2px solid transparent;border-radius:10px;background:transparent;color:var(--accent);font-weight:750;text-align:start;align-content:start;padding:5px}
.captcha-tiles button:hover,.captcha-tiles button:focus-visible{border-color:var(--accent);outline-offset:-4px}
.captcha-tiles button[aria-pressed="true"]{border-color:var(--accent);background:#6546d618;opacity:1}
.captcha-prompt{margin:12px 0 0;padding:10px;border-radius:10px;background:var(--light);text-align:center}
