@font-face {
    font-family: fontR;
    src: url("../fonts/SourceHanSansCN-Regular.otf") format("opentype");
    font-weight: 400;
}

@font-face {
    font-family: fontB;
    src: url("../fonts/SourceHanSansCN-Bold.otf") format("opentype");
    font-weight: 700;
}

:root {
    color-scheme: light;
    font-family: fontR, "微软雅黑", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body {
    color: #252d3d;
    background: #eef4fc;
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

.auth-headline h1,
.register-panel h2,
.auth-tab,
.primary-button {
    font-family: fontB, "Microsoft YaHei", sans-serif;
}

button,
a,
input[type="checkbox"] {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-rows: 1fr auto;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(0, 78, 205, 0.1) 0%, rgba(255, 255, 255, 0.7) 82%),
        url("../images/login-bg2.png") center top / cover no-repeat;
}

.auth-brand {
    position: absolute;
    top: clamp(28px, 4.2vh, 48px);
    left: clamp(32px, 5.8vw, 86px);
    z-index: 2;
}

.auth-brand a {
    display: block;
    border-radius: 4px;
}

.auth-brand img {
    display: block;
    width: clamp(300px, 30vw, 437px);
    height: auto;
    filter: drop-shadow(0 8px 20px rgba(0, 31, 119, 0.12));
}

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(120px, 13.6vh, 148px) 24px 64px;
}

.auth-headline {
    margin-bottom: clamp(24px, 3.4vh, 36px);
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 14px rgba(0, 47, 139, 0.16);
}

.auth-headline h1 {
    margin: 0;
    font-size: clamp(36px, 3.2vw, 46px);
    font-weight: 700;
    line-height: 1.3;
}

.auth-headline p {
    margin: 16px 0 0;
    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.5;
}

.auth-panel {
    width: min(100%, 480px);
    min-height: 530px;
    overflow: hidden;
    border: 1px solid rgba(214, 225, 240, 0.88);
    border-radius: 8px;
    padding: 38px 46px 34px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 70px rgba(4, 45, 112, 0.18);
}

.auth-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 46px;
    margin-bottom: 28px;
}

.auth-tab {
    position: relative;
    min-width: 96px;
    min-height: 52px;
    border: 0;
    padding: 0 4px 17px;
    color: #606b7d;
    background: transparent;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

.auth-tab::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: transparent;
    transform: translateX(-50%);
    content: "";
}

.auth-tab.is-active {
    color: #252d3d;
}

.auth-tab.is-active::after {
    background: #1f6cff;
}

.auth-tab:focus-visible,
.auth-brand a:focus-visible,
.auth-switch a:focus-visible,
.agreement a:focus-visible,
.icon-button:focus-visible,
.verification-button:focus-visible,
.primary-button:focus-visible {
    outline: 3px solid rgba(31, 108, 255, 0.34);
    outline-offset: 3px;
}

.field-group {
    min-height: 81px;
}

.field-control {
    display: flex;
    min-height: 56px;
    align-items: center;
    border: 1px solid #d5deeb;
    border-radius: 6px;
    background: #fff;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field-control:focus-within {
    border-color: #3f7fff;
    box-shadow: 0 0 0 3px rgba(31, 108, 255, 0.12);
}

.field-control.is-invalid {
    border-color: #c93636;
}

.field-control > svg {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    margin-left: 17px;
    fill: none;
    stroke: #6f7788;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.field-control input {
    width: 100%;
    min-width: 0;
    height: 54px;
    border: 0;
    padding: 0 14px;
    color: #252d3d;
    outline: 0;
    background: transparent;
    font-size: 15px;
}

.field-control input::placeholder {
    color: #7c8798;
    opacity: 1;
}

.field-error,
.agreement-error {
    min-height: 20px;
    margin: 0;
    padding: 4px 2px 0;
    color: #b42323;
    font-size: 12px;
    line-height: 16px;
}

.icon-button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 0;
    border-radius: 4px;
    margin-right: 5px;
    color: #667085;
    background: transparent;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.verification-button {
    min-width: 106px;
    min-height: 38px;
    border: 0;
    border-radius: 4px;
    margin-right: 8px;
    padding: 0 12px;
    color: #fff;
    background: #1f6cff;
    font-size: 13px;
    transition: background-color 180ms ease;
}

.verification-button:hover:not(:disabled),
.primary-button:hover:not(:disabled) {
    background: #1557d8;
}

.verification-button:disabled,
.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.68;
}

.form-status {
    min-height: 22px;
    color: #b42323;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
}

.form-status.is-success {
    color: #067647;
}

.primary-button {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: #1769f5;
    box-shadow: 0 10px 24px rgba(23, 105, 245, 0.22);
    font-size: 18px;
    font-weight: 700;
    transition: background-color 180ms ease, box-shadow 180ms ease;
}

.agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 28px;
    color: #5c6676;
    font-size: 13px;
    line-height: 1.7;
}

.agreement input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin: 3px 0 0;
    accent-color: #1769f5;
}

.agreement a,
.auth-switch a {
    color: #1769f5;
    text-decoration: none;
}

.agreement a:hover,
.auth-switch a:hover {
    text-decoration: underline;
}

.auth-switch {
    margin-top: 18px;
    color: #667085;
    font-size: 14px;
    text-align: center;
}

.auth-footer {
    display: grid;
    gap: 7px;
    padding: 26px 20px 30px;
    color: #687588;
    background: rgba(255, 255, 255, 0.94);
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

.auth-footer a {
    margin: 0 12px;
    color: #687588;
    text-decoration: none;
}

.register-panel {
    min-height: 645px;
    padding-top: 30px;
}

.register-panel h2 {
    margin: 0 0 14px;
    font-size: 24px;
    line-height: 1.4;
    text-align: center;
}

.auth-tabs--compact {
    margin-bottom: 20px;
}

.auth-tabs--compact .auth-tab {
    min-height: 44px;
    padding-bottom: 13px;
    font-size: 16px;
}

.register-form .field-group {
    min-height: 76px;
}

.agreement--register {
    margin-top: 2px;
}

.register-form .primary-button {
    margin-top: 2px;
}

@media (max-width: 1023px) {
    .auth-brand {
        position: relative;
        top: auto;
        left: auto;
        padding: 30px 24px 0;
    }

    .auth-main {
        padding: 26px 16px 50px;
    }

    .auth-headline {
        margin-bottom: 26px;
    }
}

@media (max-width: 599px) {
    .auth-brand {
        padding: 24px 18px 0;
    }

    .auth-brand img {
        width: min(86vw, 360px);
    }

    .auth-main {
        padding: 22px 14px 38px;
    }

    .auth-headline h1 {
        font-size: 28px;
    }

    .auth-headline p {
        margin-top: 10px;
        font-size: 16px;
    }

    .auth-panel,
    .register-panel {
        min-height: 0;
        border-radius: 8px;
        padding: 28px 22px 30px;
    }

    .auth-tabs {
        gap: 22px;
        margin-bottom: 24px;
    }

    .auth-tab {
        min-width: 104px;
        font-size: 18px;
    }

    .auth-footer {
        gap: 9px;
        padding: 22px 14px 26px;
        font-size: 12px;
    }

    .auth-footer span,
    .auth-footer a {
        display: inline-block;
        margin: 0 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
