:root {
    --auth-unit: min(1vw, 5.4px);
    --auth-purple: #a134f1;
    --auth-text: #1f285a;
    --auth-card: #f0f4fa;
}

* {
    box-sizing: border-box;
}

body.auth-page {
    --canvas: #ebecf5;
    --ink: var(--auth-text);
    margin: 0;
    background: #ebecf5;
    color: var(--auth-text);
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

:where(.auth-page button, .auth-page input) {
    font: inherit;
}

.auth-shell {
    --login-card-padding: calc(11.4 * var(--auth-unit));
    --login-field-height: calc(12 * var(--auth-unit));
    --login-field-gap: calc(2.6667 * var(--auth-unit));
    --login-options-gap: calc(1.8667 * var(--auth-unit));
    --login-submit-height: calc(13.3333 * var(--auth-unit));
    --login-submit-gap: calc(12 * var(--auth-unit));
    --login-switch-gap: calc(5.3333 * var(--auth-unit));
    --login-footer-space: calc(18.9 * var(--auth-unit));
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #fff;
}

.brand-hero {
    position: absolute;
    z-index: -1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.brand-hero-image {
    display: block;
    width: 100%;
    height: auto;
}

.auth-content {
    padding: calc(28 * var(--auth-unit)) 0 var(--login-footer-space);
}

.auth-card {
    width: calc(92 * var(--auth-unit));
    margin: 0 auto;
    padding: var(--login-card-padding) 0;
    border-radius: calc(5.3333 * var(--auth-unit));
    background-color: var(--auth-card);
}

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(80 * var(--auth-unit));
    margin: 0 auto;
}

.auth-field {
    display: flex;
    align-items: center;
    gap: calc(3.2 * var(--auth-unit));
    width: calc(78.6667 * var(--auth-unit));
    height: var(--login-field-height);
    margin-bottom: var(--login-field-gap);
    padding: 0 calc(3.4667 * var(--auth-unit));
    border-radius: calc(5.8667 * var(--auth-unit));
    background-color: #fff;
    box-shadow: 0 calc(1.3333 * var(--auth-unit)) calc(2.1333 * var(--auth-unit)) rgba(200, 207, 228, 0.25);
}

.auth-field:focus-within {
    box-shadow: 0 0 0 2px rgba(161, 52, 241, 0.22);
}

.auth-field::before {
    content: "";
    flex: 0 0 calc(3.4667 * var(--auth-unit));
    height: calc(4.2667 * var(--auth-unit));
    background: var(--auth-icon, url("../images/brand/login-user.png")) center / contain no-repeat;
}

.auth-field-lock {
    --auth-icon: url("../images/brand/login-lock.png");
}

.auth-field-phone {
    --auth-icon: url("../images/icon-phone.png");
}

.auth-field-sms,
.auth-field-code {
    --auth-icon: url("../images/icon-verify.png");
}

.auth-field-hidden {
    display: none;
}

.auth-field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.auth-field input {
    flex: 1;
    width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background-color: transparent;
    color: #0b1028;
    font-size: calc(4.2667 * var(--auth-unit));
    font-weight: 500;
}

.auth-field input::placeholder {
    color: #b9c1d6;
    opacity: 1;
}

.auth-field input:autofill {
    box-shadow: 0 0 0 100px #fff inset;
    -webkit-text-fill-color: #0b1028;
}

.auth-password-toggle {
    flex: 0 0 calc(8 * var(--auth-unit));
    height: calc(10 * var(--auth-unit));
    margin-right: calc(0.8 * var(--auth-unit));
    padding: 0;
    border: 0;
    background: url("../images/brand/login-eye-closed.png") center / calc(6.4 * var(--auth-unit)) no-repeat;
    cursor: pointer;
}

.auth-password-toggle[aria-pressed="true"] {
    background-image: url("../images/brand/login-eye-open.png");
}

.auth-options {
    display: flex;
    align-self: stretch;
    margin-top: var(--login-options-gap);
    padding-inline: calc(3.2 * var(--auth-unit));
}

.remember-row,
.auth-switch {
    font-size: calc(3.7333 * var(--auth-unit));
    font-weight: 500;
    line-height: 1.5;
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: calc(2.1333 * var(--auth-unit));
    cursor: pointer;
}

.remember-row input {
    appearance: none;
    display: grid;
    place-items: center;
    width: calc(3.7333 * var(--auth-unit));
    height: calc(3.7333 * var(--auth-unit));
    margin: 0;
    border: 1px solid #acb7ce;
    border-radius: 50%;
    background-color: #fff;
    cursor: inherit;
}

.remember-row input:checked {
    border-color: #c494f1;
    background-color: #c494f1;
}

.remember-row input:checked::after {
    content: "";
    width: 43%;
    height: 24%;
    border: solid #fff;
    border-width: 0 0 1px 1px;
    transform: translateY(-1px) rotate(-45deg);
}

.auth-submit {
    display: grid;
    place-items: center;
    width: calc(78.6667 * var(--auth-unit));
    height: var(--login-submit-height);
    margin-top: var(--login-submit-gap);
    padding: 0;
    border: 0;
    border-radius: calc(6.6667 * var(--auth-unit));
    background-color: var(--auth-purple);
    color: #fff;
    font-size: calc(4.8 * var(--auth-unit));
    font-weight: 500;
    cursor: pointer;
}

form.auth-form:invalid .auth-submit {
    opacity: .5;
}

.auth-switch {
    margin-top: var(--login-switch-gap);
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--auth-purple);
    cursor: pointer;
}

.auth-card-register {
    padding: calc(5 * var(--auth-unit)) 0;
}

.auth-card-register .auth-field {
    height: calc(11.2 * var(--auth-unit));
    margin-bottom: calc(2.1333 * var(--auth-unit));
}

.auth-card-register .auth-submit {
    height: calc(11.7333 * var(--auth-unit));
    margin-top: calc(3.2 * var(--auth-unit));
}

.auth-card-register .auth-switch {
    margin-top: calc(2.6667 * var(--auth-unit));
}

.send-sms {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 0;
    border-radius: 13px;
    background: #f2e6fc;
    color: var(--auth-purple);
    font-size: 12px;
    cursor: pointer;
}

.auth-shell :focus-visible {
    outline: 2px solid var(--auth-purple);
    outline-offset: 2px;
}

.auth-field input:focus-visible {
    outline: 0;
}

@media (max-height: 840px) {
    .auth-shell {
        --login-card-padding: calc(4.2vh + 1px);
        --login-field-height: calc(11.2 * var(--auth-unit));
        --login-field-gap: max(1.2vh, 2.1333 * var(--auth-unit));
        --login-options-gap: 0.9vh;
        --login-submit-height: calc(11.7333 * var(--auth-unit));
        --login-submit-gap: calc(2.6vh + 5.3333 * var(--auth-unit));
        --login-switch-gap: 2.2vh;
        --login-footer-space: calc(5.2vh + 5.6 * var(--auth-unit));
    }
}

@media (max-height: 740px) {
    .auth-shell {
        --login-card-padding: calc(4.8 * var(--auth-unit) + 1px);
        --login-field-gap: calc(2.1333 * var(--auth-unit));
        --login-options-gap: calc(1.0667 * var(--auth-unit));
        --login-submit-gap: calc(8.5333 * var(--auth-unit));
        --login-switch-gap: calc(2.6667 * var(--auth-unit));
        --login-footer-space: calc(11.7 * var(--auth-unit));
    }

    .remember-row,
    .auth-switch {
        line-height: 1.42;
    }
}

#mpanel2,
#mpanel3,
#mpanel4 {
    position: relative;
    z-index: 20;
}
