/* Auth unified styles (login/register/pwreset) - White Theme */

/* CSS Variables */
:root {
    --auth-primary: #409eff;
    --auth-primary-hover: #66b1ff;
    --auth-primary-active: #3a8ee6;
    --auth-text-primary: #303133;
    --auth-text-secondary: #606266;
    --auth-text-placeholder: #909399;
    --auth-border: #dcdfe6;
    --auth-bg-page: #f5f7fa;
    --auth-bg-card: #ffffff;
    --auth-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    --auth-radius: 6px;
}

/* Base Styles */
.allow_login_code_captcha { display: none; }

/* Page Background */
.k8-login-page,
.k8-register-page {
    min-height: 100vh;
    background-color: var(--auth-bg-page);
    padding: 0;
}

/* Header - Simplified for centered layout，保证语言下拉不被主内容挡住 */
.k8-header {
    position: fixed !important;
    z-index: 10000 !important;
    overflow: visible !important;
    background: var(--auth-bg-card);
    border-bottom: 1px solid var(--auth-border);
}

/* 给页面主体添加顶部 padding，避免被固定 header 遮挡 */
.k8-login-page,
.k8-register-page {
    padding-top: 70px !important;
}

.k8-header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    overflow: visible !important;
}

.k8-header-right {
    overflow: visible !important;
}

.k8-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.k8-header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* 覆盖 layout.css 的 !important，使头部 Logo 更大 */
.k8-header-logo img {
    height: 120px !important;
    width: auto !important;
    max-width: 200px !important;
    object-fit: contain !important;
}

.k8-header-title h1 {
    font-size: 18px;
    color: var(--auth-text-primary);
    font-weight: 500;
    margin: 0;
}

.k8-header-right .arco-btn {
    color: var(--auth-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.k8-header-right .arco-btn:hover {
    color: var(--auth-primary);
}

/* Background Image - Hidden for new design */
.k8-login-bg,
.k8-register-bg {
    display: none;
}

/* Main Container - Centered Card Layout（覆盖购物车主题的左右分栏，保证整页居中） */
.k8-login-page .k8-login-container,
.k8-register-page .k8-register-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: calc(100vh - 60px) !important;
    padding: 30px 20px;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Auth Card - Single centered card, fixed 800px */
.k8-login-page .k8-auth-card,
.k8-register-page .k8-auth-card {
    background: var(--auth-bg-card);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    width: 100%;
    max-width: 800px;
    overflow: visible;
    position: relative;
    flex-shrink: 0;
}

/* Card Header - Brand/Title area, 32px padding */
.k8-card-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid var(--auth-border);
    position: relative;
}

.k8-card-header .k8-brand-logo {
    margin-bottom: 12px;
}

.k8-card-header .k8-brand-logo img {
    height: 160px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

/* 页面标题 20px 加粗 深灰 */
.k8-card-header .k8-brand-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin: 0 0 8px 0;
}

/* 副标题 14px 中灰 */
.k8-card-header .k8-brand-desc {
    font-size: 14px;
    color: var(--auth-text-secondary);
    margin: 0;
}

/* 右上角操作按钮：浅色描边圆角，文字蓝色，背景透明，距顶/右 16px */
.k8-card-action-wrap {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.k8-card-action-wrap .k8-register-btn,
.k8-card-action-wrap .k8-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    background: transparent !important;
    border: 1px solid var(--auth-primary);
    border-radius: var(--auth-radius);
    color: var(--auth-primary) !important;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.k8-card-action-wrap .k8-register-btn:hover,
.k8-card-action-wrap .k8-login-btn:hover {
    background: rgba(64, 158, 255, 0.08) !important;
    color: var(--auth-primary-hover) !important;
    text-decoration: none;
}

/* Card Body - Form area, 32px padding，表单区域水平居中 */
.k8-card-body {
    padding: 32px;
    position: relative;
}

.k8-auth-form-inner {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    text-align: left;
}
.k8-auth-form-inner .k8-form-item,
.k8-auth-form-inner .k8-input-wrapper,
.k8-auth-form-inner .k8-phone-input {
    width: 100%;
}

/* Tabs - 选中态蓝色下划线，未选中灰色文字 */
.k8-login-tabs,
.k8-register-tabs {
    display: flex;
    border-bottom: 1px solid var(--auth-border);
    margin-bottom: 24px;
}

.k8-tab-item {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--auth-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    text-align: center;
}

.k8-tab-item:hover {
    color: var(--auth-primary);
}

.k8-tab-item.active {
    color: var(--auth-primary);
    border-bottom-color: var(--auth-primary);
    font-weight: 500;
}

/* Form Styles */
.k8-login-form,
.k8-register-form {
    display: none;
}

.k8-login-form.active,
.k8-register-form.active {
    display: block;
}

/* 标签与输入框 8px，输入框之间 16px，按钮与上方 24px */
.k8-form-item {
    margin-bottom: 16px;
}

.k8-form-item:last-of-type {
    margin-bottom: 0;
}

.k8-form-item.k8-form-item-spacing-btn {
    margin-top: 24px;
    margin-bottom: 0;
}

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

.k8-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.k8-input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--auth-text-placeholder);
    z-index: 1;
    font-size: 16px;
}

.k8-input-wrapper .arco-input,
.k8-input-wrapper input,
.k8-input-wrapper .form-control {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    font-size: 14px;
    color: var(--auth-text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.k8-input-wrapper .arco-input:focus,
.k8-input-wrapper input:focus,
.k8-input-wrapper .form-control:focus {
    border-color: var(--auth-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}

/* 输入框提示文字 14px 浅灰 */
.k8-input-wrapper .arco-input::placeholder,
.k8-input-wrapper input::placeholder,
.k8-input-wrapper .form-control::placeholder {
    color: var(--auth-text-placeholder);
    font-size: 14px;
}

/* Phone input with area code - 输入框占满剩余宽度，左对齐 */
.k8-phone-input {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.k8-phone-input .k8-input-wrapper {
    flex: 1;
    min-width: 0;
}

.k8-area-code .arco-dropdown {
    display: inline-block;
}

.k8-area-code .k8-area-code-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: #fff;
    color: var(--auth-text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.k8-area-code .k8-area-code-btn:hover {
    border-color: var(--auth-primary);
}

/* Code input with button */
.k8-input-wrapper.code-input .arco-input,
.k8-input-wrapper.code-input input {
    padding-right: 110px;
}

/* 次要按钮（获取验证码）：蓝色填充，宽度自适应，6px 圆角 */
.k8-input-wrapper.code-input .arco-btn {
    position: absolute;
    right: 4px;
    z-index: 2;
    height: 34px;
    padding: 0 16px;
    font-size: 14px;
    background: var(--auth-primary);
    border: 1px solid var(--auth-primary);
    border-radius: var(--auth-radius);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.k8-input-wrapper.code-input .arco-btn:hover {
    background: var(--auth-primary-hover);
    border-color: var(--auth-primary-hover);
    color: #fff;
}

.k8-input-wrapper.code-input .arco-btn:disabled {
    background: #f5f7fa;
    border-color: var(--auth-border);
    color: var(--auth-text-placeholder);
    cursor: not-allowed;
}

/* Input group for验证码 */
.k8-login-page .input-group {
    display: flex;
    align-items: center;
}

.k8-login-page .input-group .form-control {
    flex: 1;
    height: 42px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius) 0 0 var(--auth-radius);
    padding: 0 12px;
}

.k8-login-page .input-group .input-group-append .btn {
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--auth-border);
    border-left: none;
    border-radius: 0 var(--auth-radius) var(--auth-radius) 0;
    background: #fff;
    color: var(--auth-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.k8-login-page .input-group .input-group-append .btn:hover {
    background: var(--auth-primary);
    color: #fff;
}

/* Actions row */
.k8-login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.k8-login-switch a {
    font-size: 14px;
    color: var(--auth-primary);
    text-decoration: none;
    cursor: pointer;
}

.k8-login-switch a:hover {
    text-decoration: underline;
}

.k8-forgot-pwd {
    font-size: 14px;
    color: var(--auth-text-secondary);
    text-decoration: none;
}

.k8-forgot-pwd:hover {
    color: var(--auth-primary);
}

/* 主按钮：蓝色填充 #409eff，文字白色，宽度 100%，6px 圆角 */
.k8-submit-btn {
    width: 100%;
    height: 44px;
    font-size: 16px;
    font-weight: 500;
    background: var(--auth-primary);
    border: none;
    border-radius: var(--auth-radius);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.k8-submit-btn:hover {
    background: var(--auth-primary-hover);
}

.k8-submit-btn:active {
    background: var(--auth-primary-active);
}

/* 右上角按钮在 .k8-card-action-wrap 内已单独定义；此处兜底（非 wrap 内）保持描边样式 */
.k8-card-body > .arco-btn.k8-register-btn,
.k8-card-body > .arco-btn.k8-login-btn {
    display: none;
}

/* Agreement */
.k8-agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
}

.k8-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.k8-checkbox-input {
    margin: 0;
    cursor: pointer;
}

.k8-checkbox-text {
    font-size: 13px;
    color: var(--auth-text-secondary);
    line-height: 1.5;
}

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

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

/* Other Login */
.k8-other-login {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-border);
    text-align: center;
}

.k8-other-login-title {
    font-size: 13px;
    color: var(--auth-text-placeholder);
    margin-bottom: 16px;
}

.k8-other-login-list {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.k8-other-login-list a {
    display: block;
    width: 40px;
    height: 40px;
}

.k8-other-login-list img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Card Footer - Links, 32px 内边距 */
.k8-card-footer {
    padding: 24px 32px 32px;
    text-align: center;
    border-top: 1px solid var(--auth-border);
}

.k8-card-footer p {
    font-size: 14px;
    color: var(--auth-text-secondary);
    margin: 0;
}

.k8-card-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.k8-card-footer a:hover {
    text-decoration: underline;
}

/* Form control override */
.k8-login-page .form-control,
.k8-login-page .input-group-append,
.k8-register-page .form-control,
.k8-register-page .input-group-append .btn,
.k8-register-page .input-group-prepend .form-control {
    height: 42px;
}

.k8-login-page .form-control,
.k8-register-page .form-control {
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    color: var(--auth-text-primary);
}

.k8-login-page .form-group,
.k8-register-page .form-group {
    margin-bottom: 20px;
}

.k8-login-page .input-group-append img {
    height: 40px;
    object-fit: cover;
}

/* Register page specific */
.k8-register-page .form-control,
.k8-register-page .input-group-append .btn,
.k8-register-page .input-group-prepend .form-control,
.k8-register-page .arco-input,
.k8-register-page .arco-btn {
    border-radius: var(--auth-radius) !important;
}

/* Hide/Show logic for tabs */
.k8-login-form,
.k8-register-form {
    display: none;
}

.k8-login-form.active,
.k8-register-form.active {
    display: block;
}

/* Dropdown menu - 强制最高 z-index 避免被主内容挡住 */
.k8-header-right .arco-dropdown,
.k8-header-right .arco-dropdown * {
    z-index: 99999 !important;
}
.k8-header-right .arco-dropdown {
    position: relative;
}
.k8-header-right .arco-dropdown-list {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 140px;
    padding: 4px 0;
    background: var(--auth-bg-card);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    display: none;
}

.k8-header-right .arco-dropdown:hover .arco-dropdown-list {
    display: block;
}

.k8-header-right .arco-dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--auth-text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.k8-header-right .arco-dropdown-option:hover {
    background: #f5f7fa;
}

.k8-header-right .arco-dropdown-option-active {
    color: var(--auth-primary);
    background: #ecf5ff;
}

.k8-header-right .arco-dropdown-option-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.k8-header-right .arco-dropdown-option-text {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .k8-header-container {
        padding: 0 16px;
    }

    .k8-header-logo img {
        height: 30px;
        max-width: 140px;
    }

    .k8-header-title h1 {
        font-size: 16px;
    }

    .k8-login-container,
    .k8-register-container {
        padding: 20px 16px;
    }

    .k8-login-container > div,
    .k8-register-container > div {
        max-width: 100%;
    }

    .k8-card-header {
        padding: 24px 20px 16px;
    }

    .k8-card-header .k8-brand-logo img {
        height: 100px;
        max-width: 120px;
    }

    .k8-card-header .k8-brand-title {
        font-size: 20px;
    }

    .k8-card-body {
        padding: 24px 20px;
    }

    .k8-card-footer {
        padding: 16px 20px 24px;
    }

    .k8-tab-item {
        padding: 10px 12px;
        font-size: 14px;
    }

    .k8-input-wrapper .arco-input,
    .k8-input-wrapper input,
    .k8-input-wrapper .form-control,
    .k8-login-page .input-group .form-control,
    .k8-login-page .input-group .input-group-append .btn {
        height: 40px;
    }

    .k8-area-code .k8-area-code-btn {
        height: 40px;
        padding: 0 10px;
        font-size: 13px;
    }

    .k8-submit-btn {
        height: 42px;
        font-size: 15px;
    }

    .k8-login-actions {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .k8-other-login-list {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .k8-header-left {
        gap: 12px;
    }

    .k8-header-logo img {
        height: 26px;
        max-width: 100px;
    }

    .k8-header-title h1 {
        font-size: 14px;
    }

    .k8-card-header .k8-brand-title {
        font-size: 18px;
    }

    .k8-card-header .k8-brand-desc {
        font-size: 13px;
    }

    .k8-login-tabs,
    .k8-register-tabs {
        margin-bottom: 20px;
    }

    .k8-form-item {
        margin-bottom: 16px;
    }

    .k8-input-wrapper.code-input .arco-btn {
        padding: 0 10px;
        font-size: 12px;
    }

    .k8-card-footer p {
        font-size: 13px;
    }
}