/* ========== 公共变量 ========== */
:root {
    --b2b-gray: #222831;      /* 商务灰 */
    --b2b-blue: #005792;     /* 深海蓝 */
    --b2b-orange: #e10000;   /* 活力橙 */
    --b2b-light: #f4f6f8;
    --b2b-radius: 10px;
    --b2b-shadow: 0 4px 20px rgba(0, 0, 0, .08);
}

/* ========== 公共布局 ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--b2b-light) 0%, #e0e7ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 80px; /* 顶部栏占位 */
}

/* ========== 顶部玻璃导航 ========== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    padding: 0 30px;
    z-index: 1030;
}

.top-nav .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--b2b-gray);
    font-weight: 600;
    font-size: 1.2rem;
}

.top-nav .logo-icon {
    width: 42px;
    height: 42px;
    background: var(--b2b-blue);
    border-radius: var(--b2b-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-right: 12px;
}

.top-nav .home-link {
    margin-left: auto;
    color: var(--b2b-gray);
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(244, 246, 248, 0.6);
    transition: all .3s ease;
}

.top-nav .home-link:hover {
    color: var(--b2b-blue);
    background: rgba(0, 87, 146, 0.1);
}

/* ========== 卡片容器 ========== */
.login-container,
.register-container {
    background: white;
    border-radius: var(--b2b-radius);
    box-shadow: var(--b2b-shadow);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    min-height: 500px;
    display: flex;
    margin-top: 20px;
}

.login-image-section,
.register-image-section {
    flex: 1;
    background: linear-gradient(135deg, var(--b2b-blue) 0%, var(--b2b-gray) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-image-section::before,
.register-image-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/b2b_login.jpg') center/cover no-repeat;
    opacity: 0.3;
}

.image-content {
    text-align: center;
    color: white;
    z-index: 1;
    padding: 30px;
}

/* ========== 表单区 ========== */
.login-form-section,
.register-form-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    height: 42px;
  width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px;
}

/* ========== 切换按钮 ========== */
.login-method-toggle {
    position: relative;
    display: flex;
    background: var(--b2b-light);
    border-radius: 25px;
    padding: 4px;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-method-toggle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: white;
    border-radius: 21px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    z-index: 1;
}

.login-method-toggle.sms-active::before {
    transform: translateX(100%);
}

.login-method-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--b2b-gray);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 21px;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.login-method-btn.active {
    color: var(--b2b-blue);
}

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    font-weight: 500;
    color: var(--b2b-gray);
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.form-control {
    border: 1px solid #e0e7ff;
    border-radius: var(--b2b-radius);
    padding: 10px 12px;
    font-size: 0.9rem;
    background: var(--b2b-light);
    transition: border-color .3s, box-shadow .3s;
}

.form-control:focus {
    border-color: var(--b2b-blue);
    box-shadow: 0 0 0 2px rgba(0, 87, 146, 0.1);
    background: white;
}

.btn-primary {
    background: var(--b2b-blue);
    border: none;
    border-radius: var(--b2b-radius);
    padding: 10px 20px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all .3s ease;
}

.btn-primary:hover {
    background: var(--b2b-gray);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 87, 146, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--b2b-blue);
    color: var(--b2b-blue);
    background: transparent;
    border-radius: var(--b2b-radius);
    padding: 10px 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-outline-primary:hover {
    background: var(--b2b-blue);
    color: white;
}

.input-group-text {
    background: transparent;
    border: 1px solid #e0e7ff;
    border-right: none;
    color: #6c757d;
}

.input-group .form-control {
    border-left: none;
}

/* ========== 密码强度条（仅注册页用） ========== */
.password-strength {
    height: 4px;
    background: var(--b2b-light);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: width .3s ease, background .3s ease;
    border-radius: 2px;
}

.strength-weak {
    background: var(--b2b-orange);
    width: 33%;
}

.strength-medium {
    background: #ff9800;
    width: 66%;
}

.strength-strong {
    background: #4caf50;
    width: 100%;
}

/* ========== 步骤指示器（仅注册页用） ========== */
.register-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.register-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--b2b-light);
    z-index: 1;
}

.step-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--b2b-light);
    color: var(--b2b-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    transition: all .3s ease;
}

.step-item.active .step-circle {
    background: var(--b2b-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 87, 146, 0.3);
}

.step-item.completed .step-circle {
    background: #4caf50;
    color: white;
}

.step-label {
    font-size: 0.8rem;
    color: var(--b2b-gray);
    font-weight: 500;
}

/* ========== 简化提示框（3 秒淡出） ========== */
.toast-simple {
    position: fixed;
    top: 90px;
    right: 30px;
    z-index: 1060;
    min-width: 260px;
    padding: 12px 16px;
    border-radius: var(--b2b-radius);
    box-shadow: var(--b2b-shadow);
    color: #fff;
    font-size: 0.9rem;
    transform: translateX(100%);
    transition: transform .3s ease;
}

.toast-simple.show {
    transform: translateX(0);
}

.toast-simple.success {
    background: #4caf50;
}

.toast-simple.error {
    background: var(--b2b-orange);
}

.toast-simple.warning {
    background: #ff9800;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .login-container,
    .register-container {
        flex-direction: column;
        max-width: 350px;
    }

    .login-image-section,
    .register-image-section {
        min-height: 150px;
        padding: 30px 20px;
    }

    .login-form-section,
    .register-form-section {
        padding: 30px 20px;
    }
}