/* 登录 / 注册分栏布局 */

:root {
    --xy-brand: #2e91f6;
    --xy-brand-hover: #1f7ad4;
    --xy-brand-soft: #e8f3fe;
    --xy-text: #1f2937;
    --xy-text-secondary: #6b7280;
    --xy-border: #e5e7eb;
    --xy-danger: #dc2626;
    --xy-radius: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--xy-text);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* —— 左侧品牌区 —— */
.auth-brand {
    position: relative;
    flex: 0 0 42%;
    max-width: 520px;
    padding: 36px 48px 28px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(160deg, #3b9eff 0%, #2e91f6 42%, #1f7ad4 100%);
    overflow: hidden;
}

.auth-brand::after {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -8%;
    height: 48%;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(0, 60, 140, 0.35), transparent 55%),
        radial-gradient(ellipse 70% 50% at 80% 90%, rgba(0, 40, 100, 0.28), transparent 50%),
        repeating-linear-gradient(
            -18deg,
            transparent,
            transparent 18px,
            rgba(255, 255, 255, 0.04) 18px,
            rgba(255, 255, 255, 0.04) 19px
        );
    pointer-events: none;
}

.auth-brand-logo {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    width: fit-content;
}

.auth-brand-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.auth-brand-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}

.auth-brand-title {
    margin: 0 0 12px;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.2;
}

.auth-brand-slogan {
    margin: 0 0 36px;
    font-size: 16px;
    opacity: 0.92;
    line-height: 1.5;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.95;
}

.auth-feature-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-top: 1px;
}

.auth-brand-footer {
    position: relative;
    z-index: 1;
    font-size: 12px;
    opacity: 0.75;
}

/* —— 右侧表单区 —— */
.auth-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #fff;
}

.auth-panel-inner {
    width: 100%;
    max-width: 400px;
    animation: auth-fade-up 0.28s ease;
}

@keyframes auth-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-heading {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: var(--xy-text);
    line-height: 1.3;
}

.auth-subheading {
    margin: 0 0 28px;
    font-size: 14px;
    color: var(--xy-text-secondary);
    line-height: 1.5;
}

.auth-status {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: var(--xy-radius);
    background: #ecfdf5;
    color: #047857;
    font-size: 13px;
}

.auth-alert {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: var(--xy-radius);
    background: #fef2f2;
    color: var(--xy-danger);
    font-size: 13px;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--xy-text);
}

.auth-input,
.auth-input-wrap input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--xy-border);
    border-radius: var(--xy-radius);
    font-size: 14px;
    color: var(--xy-text);
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input::placeholder,
.auth-input-wrap input::placeholder {
    color: #9ca3af;
}

.auth-input:focus,
.auth-input-wrap input:focus {
    border-color: var(--xy-brand);
    box-shadow: 0 0 0 3px rgba(46, 145, 246, 0.15);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap input {
    padding-right: 44px;
}

.auth-toggle-password {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.auth-toggle-password:hover {
    color: var(--xy-brand);
}

.auth-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--xy-text-secondary);
    line-height: 1.4;
}

.auth-error {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--xy-danger);
}

.auth-error li + li {
    margin-top: 2px;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--xy-text-secondary);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--xy-brand);
    cursor: pointer;
}

.auth-link {
    color: var(--xy-brand);
    text-decoration: none;
    font-size: 14px;
}

.auth-link:hover {
    color: var(--xy-brand-hover);
    text-decoration: underline;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: var(--xy-radius);
    background: var(--xy-brand);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.auth-submit:hover {
    background: var(--xy-brand-hover);
}

.auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-switch {
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--xy-text-secondary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: #9ca3af;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--xy-border);
}

.auth-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border: 1px solid var(--xy-border);
    border-radius: var(--xy-radius);
    background: #fff;
    color: var(--xy-brand);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.auth-home-btn:hover {
    border-color: var(--xy-brand);
    background: var(--xy-brand-soft);
}

/* 密码强度 */
.auth-strength {
    margin-top: 10px;
}

.auth-strength-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--xy-text-secondary);
}

.auth-strength-label {
    font-weight: 500;
}

.auth-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    overflow: hidden;
}

.auth-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.2s, background 0.2s;
}

.auth-strength[data-level="0"] .auth-strength-fill {
    width: 0;
    background: transparent;
}

.auth-strength[data-level="1"] .auth-strength-fill {
    width: 33%;
    background: #ef4444;
}

.auth-strength[data-level="1"] .auth-strength-label {
    color: #ef4444;
}

.auth-strength[data-level="2"] .auth-strength-fill {
    width: 66%;
    background: #f59e0b;
}

.auth-strength[data-level="2"] .auth-strength-label {
    color: #d97706;
}

.auth-strength[data-level="3"] .auth-strength-fill {
    width: 100%;
    background: #22c55e;
}

.auth-strength[data-level="3"] .auth-strength-label {
    color: #16a34a;
}

/* 移动端 */
@media (max-width: 900px) {
    .auth-page {
        flex-direction: column;
    }

    .auth-brand {
        flex: none;
        max-width: none;
        padding: 20px 20px 24px;
        min-height: auto;
    }

    .auth-brand-body {
        padding: 16px 0 8px;
    }

    .auth-brand-title {
        font-size: 28px;
    }

    .auth-brand-slogan {
        margin-bottom: 20px;
        font-size: 14px;
    }

    .auth-features {
        gap: 12px;
    }

    .auth-brand-footer {
        display: none;
    }

    .auth-panel {
        padding: 28px 20px 40px;
        align-items: flex-start;
    }

    .auth-heading {
        font-size: 24px;
    }
}

/* 登录方式切换 */
.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    border-radius: var(--xy-radius);
    background: #f3f4f6;
}

.auth-tab {
    flex: 1;
    height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--xy-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-tab.is-active {
    background: #fff;
    color: var(--xy-brand);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 验证码行：输入框 + 获取按钮 */
.auth-code-row {
    display: flex;
    gap: 10px;
}

.auth-code-row .auth-input {
    flex: 1;
    min-width: 0;
}

.auth-code-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--xy-brand);
    border-radius: var(--xy-radius);
    background: #fff;
    color: var(--xy-brand);
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.auth-code-btn:hover:not(:disabled) {
    background: var(--xy-brand-soft);
}

.auth-code-btn:disabled {
    border-color: var(--xy-border);
    color: #9ca3af;
    cursor: not-allowed;
    background: #f9fafb;
}

/* 校验失败输入框描边 */
.auth-input.is-invalid,
.auth-input-wrap input.is-invalid {
    border-color: var(--xy-danger);
}

.auth-input.is-invalid:focus,
.auth-input-wrap input.is-invalid:focus {
    border-color: var(--xy-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}


