/* ========================
   新认证页面样式 - 水平滑入版本
   ======================== */

:root {
    --primary-color: #1e88e5;
    --primary-light: #42a5f5;
    --primary-dark: #1565c0;
    --success-color: #43a047;
    --error-color: #e53935;
    --warning-color: #fb8c00;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --bg-white: #ffffff;
    --bg-light: #f5f5f5;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

    /* 蓝色渐变背景 */
    --gradient-start: #1e3c72;
    --gradient-end: #2a5298;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%) !important;
    min-height: 100vh;
    background-attachment: fixed;
    overflow: auto;
}

/* ========================
   主容器
   ======================== */

.auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: visible;
}

/* ========================
   左侧欢迎区 - 水平滑入动画
   ======================== */

.auth-left {
    width: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px 40px 0px 80px;
    color: white;
    position: relative;
    z-index: 10;
    background: transparent;
    overflow: visible;
}

.left-content {
    text-align: left;
    max-width: 680px;
    animation: slideInLeft 0.8s ease-out forwards;
    position: relative;
    z-index: 10;
    transform: translate(30px, -60px);
    /* ✅ 设置静态最终位置 */
}

/* ✅ 纯水平滑入动画：从左边滑入，Y轴保持不变 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translate(-80px, -60px);
        /* ✅ 起点：最终位置左边 110px */
    }

    to {
        opacity: 1;
        transform: translate(30px, -60px);
        /* ✅ 终点：右上方固定位置 */
    }
}

/* 欢迎文字 */
.welcome-text {
    margin-bottom: 80px;
}

.welcome-text h1 {
    font-size: 48px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 12px;
    opacity: 0.95;
    position: relative;
    z-index: 10;
    white-space: nowrap;
}

.welcome-text h2 {
    font-size: 80px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #e3f2fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 10;
    white-space: nowrap;
    overflow: visible;
}

.welcome-text h3 {
    font-size: 48px;
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 24px;
    opacity: 0.9;
    position: relative;
    z-index: 10;
    white-space: nowrap;
}

.welcome-text p {
    font-size: 18px;
    opacity: 0.85;
    line-height: 1.8;
    letter-spacing: 1px;
    font-weight: 300;
    position: relative;
    z-index: 10;
}

/* 功能特性 */
.features {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 10;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    opacity: 0.9;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.feature-item i {
    font-size: 28px;
    width: 36px;
    text-align: center;
    color: #e3f2fd;
    flex-shrink: 0;
}

.feature-item span {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.feature-item:hover {
    opacity: 1;
    transform: translateX(12px);
}

/* ========================
   右侧表单区
   ======================== */

.auth-right {
    width: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 60px 0 40px;
    position: relative;
    z-index: 5;
    background: transparent;
    overflow: hidden;
}

/* 卡片 */
.auth-card {
    width: 100%;
    max-width: 640px;
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideInRight 0.8s ease-out forwards;
    position: relative;
    z-index: 5;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 卡片头部 */
.card-header {
    padding: 36px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    gap: 18px;
    color: white;
}

.brand-logo {
    font-size: 44px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    flex-shrink: 0;
}

.brand-info {
    flex: 1;
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.brand-desc {
    font-size: 13px;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* 表单容器 */
.form-container {
    position: relative;
    padding: 36px 32px;
    max-height: 65vh;
    overflow-y: auto;
}

.form-container::-webkit-scrollbar {
    width: 6px;
}

.form-container::-webkit-scrollbar-track {
    background: transparent;
}

.form-container::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 3px;
}

.form-container::-webkit-scrollbar-thumb:hover {
    background: #757575;
}

.auth-form {
    opacity: 0;
    display: none;
    transition: opacity 0.3s ease;
}

.auth-form.active {
    opacity: 1;
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 表单标题 */
.form-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* 表单 */
.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

.form-label i {
    color: var(--primary-color);
    width: 16px;
    font-size: 14px;
}

/* 输入框 */
.form-input {
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: all 0.3s ease;
    outline: none;
}

.form-input:hover {
    border-color: var(--primary-light);
    background: #fafafa;
}

.form-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-input::placeholder {
    color: #bdbdbd;
    font-size: 13px;
}

/* 密码输入框 */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-input {
    width: 100%;
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #bdbdbd;
    cursor: pointer;
    font-size: 15px;
    transition: color 0.3s ease;
    padding: 4px;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* 表单错误提示 */
.form-error {
    font-size: 11px;
    color: var(--error-color);
    display: none;
    margin-top: -4px;
}

.form-error.active {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 密码强度指示 */
.password-strength {
    margin-top: 6px;
}

.strength-bar {
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: var(--error-color);
    transition: all 0.3s ease;
}

.strength-fill.weak {
    width: 33%;
    background: var(--error-color);
}

.strength-fill.medium {
    width: 66%;
    background: var(--warning-color);
}

.strength-fill.strong {
    width: 100%;
    background: var(--success-color);
}

.strength-text {
    font-size: 11px;
    color: var(--text-secondary);
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-top: -4px;
    gap: 10px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
}

.checkbox input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox span {
    font-size: 13px;
}

.checkbox:hover {
    color: var(--text-primary);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
    padding: 13px 24px;
    font-size: 15px;
}

/* 表单切换 */
.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-switch p {
    margin: 0;
}

.link-button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 0;
    font-size: 13px;
}

.link-button:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 复选框组 */
.checkbox-group {
    margin-top: -4px;
}

.checkbox-group .checkbox {
    align-items: flex-start;
}

.checkbox-group .checkbox span {
    line-height: 1.5;
    font-size: 12px;
}

.checkbox-group a {
    color: var(--primary-color);
    text-decoration: none;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

/* 卡片底部 */
.card-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: #fafafa;
}

.card-footer p {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.3px;
}

/* ========================
   加载指示器
   ======================== */

.auth-loading {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================
   Toast 提示
   ======================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 14px;
    animation: slideInToast 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================
   响应式设计
   ======================== */

@media (max-width: 1400px) {
    .auth-left {
        padding: 100px 35px 60px 70px;
    }

    .auth-right {
        padding: 40px 50px 40px 35px;
    }

    .left-content {
        transform: translate(20px, -45px);
        /* ✅ 调整静态位置 */
    }

    /* ✅ 纯水平滑入 */
    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translate(-60px, -45px);
        }

        to {
            opacity: 1;
            transform: translate(20px, -45px);
        }
    }

    .welcome-text h1 {
        font-size: 32px;
    }

    .welcome-text h2 {
        font-size: 52px;
    }

    .welcome-text h3 {
        font-size: 32px;
    }

    .welcome-text p {
        font-size: 15px;
    }

    .auth-card {
        max-width: 460px;
    }
}

@media (max-width: 1200px) {
    .auth-left {
        width: 40%;
        padding: 80px 30px 60px 60px;
    }

    .auth-right {
        width: 60%;
        padding: 40px 45px 40px 30px;
    }

    .left-content {
        max-width: 320px;
        transform: translate(10px, -30px);
        /* ✅ 调整静态位置 */
    }

    /* ✅ 纯水平滑入 */
    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translate(-50px, -30px);
        }

        to {
            opacity: 1;
            transform: translate(10px, -30px);
        }
    }

    .welcome-text h1 {
        font-size: 28px;
    }

    .welcome-text h2 {
        font-size: 44px;
    }

    .welcome-text h3 {
        font-size: 28px;
    }

    .welcome-text p {
        font-size: 14px;
    }

    .feature-item span {
        font-size: 14px;
    }

    .auth-card {
        max-width: 440px;
    }
}

@media (max-width: 992px) {
    .auth-left {
        width: 100%;
    }

    .auth-right {
        width: 100%;
    }

    .auth-container {
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px 20px;
        gap: 30px;
    }

    .auth-left {
        padding: 60px 20px;
        text-align: center;
        justify-content: center;
        align-items: center;
    }

    .left-content {
        text-align: center;
        max-width: 100%;
        transform: translate(0, 0);
        /* ✅ 移动端不偏移 */
    }

    .auth-right {
        padding: 0;
        max-width: 100%;
    }

    /* ✅ 移动端改为竖直动画 */
    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .welcome-text {
        margin-bottom: 40px;
    }

    .welcome-text h1 {
        font-size: 24px;
    }

    .welcome-text h2 {
        font-size: 36px;
    }

    .welcome-text h3 {
        font-size: 24px;
    }

    .welcome-text p {
        font-size: 13px;
    }

    .features {
        flex-direction: row;
        justify-content: center;
        gap: 30px;
        flex-wrap: wrap;
    }

    .feature-item {
        flex-direction: column;
        align-items: center;
        padding: 12px;
    }

    .feature-item:hover {
        transform: translateY(-5px);
    }

    .auth-card {
        max-width: 520px;
        width: 100%;
    }
}

@media (max-width: 640px) {
    body {
        overflow: auto;
    }

    .auth-container {
        min-height: auto;
        padding: 20px;
        gap: 20px;
    }

    .auth-left {
        padding: 40px 20px;
    }

    .welcome-text {
        margin-bottom: 30px;
    }

    .welcome-text h1 {
        font-size: 18px;
    }

    .welcome-text h2 {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .welcome-text h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .welcome-text p {
        font-size: 13px;
    }

    .features {
        flex-direction: column;
        gap: 12px;
    }

    .feature-item {
        flex-direction: row;
        align-items: center;
        padding: 8px 0;
    }

    .feature-item i {
        font-size: 22px;
    }

    .feature-item span {
        font-size: 12px;
    }

    .auth-card {
        border-radius: 12px;
        max-width: 100%;
    }

    .card-header {
        padding: 24px;
        gap: 12px;
    }

    .brand-logo {
        font-size: 32px;
        width: 48px;
        height: 48px;
    }

    .brand-name {
        font-size: 18px;
    }

    .form-container {
        padding: 24px;
    }

    .form-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .form {
        gap: 14px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-block {
        padding: 11px 20px;
        font-size: 14px;
    }

    .card-footer {
        padding: 14px 24px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 15px;
        gap: 15px;
    }

    .auth-left {
        padding: 30px 15px;
    }

    .welcome-text h1 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .welcome-text h2 {
        font-size: 24px;
    }

    .welcome-text h3 {
        font-size: 16px;
    }

    .welcome-text p {
        font-size: 12px;
    }

    .features {
        gap: 12px;
    }

    .feature-item {
        gap: 12px;
        padding: 6px 0;
    }

    .feature-item i {
        font-size: 20px;
        width: 26px;
    }

    .feature-item span {
        font-size: 12px;
    }

    .auth-card {
        border-radius: 10px;
    }

    .card-header {
        padding: 20px;
        gap: 10px;
    }

    .brand-logo {
        font-size: 28px;
        width: 44px;
        height: 44px;
    }

    .brand-name {
        font-size: 16px;
        margin-bottom: 2px;
    }

    .brand-desc {
        font-size: 11px;
    }

    .form-container {
        padding: 20px;
    }

    .form-title {
        font-size: 18px;
        margin-bottom: 18px;
    }

    .form-label {
        font-size: 12px;
    }

    .form-input {
        padding: 9px 11px;
        font-size: 13px;
    }

    .card-footer {
        padding: 12px 20px;
        font-size: 10px;
    }
}

/* ========================
   深色模式（可选）
   ======================== */

@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --border-color: #424242;
        --bg-light: #212121;
        --bg-white: #1e1e1e;
    }

    body {
        background: linear-gradient(135deg, #0d1b2a 0%, #1a2f4a 100%) !important;
        background-attachment: fixed;
    }

    .form-input {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: #424242;
    }

    .form-input:hover {
        background: #333333;
        border-color: #505050;
    }

    .form-input::placeholder {
        color: #707070;
    }

    .card-footer {
        background: #262626;
        border-top-color: #424242;
    }

    .auth-card {
        background: #1a1a1a;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}