/**
 * 现代化移动端登录界面样式
 * 基于用户提供的设计截图重构
 * 兼容Ionic Framework v1.x
 */

/* ========================================================================
   主容器和背景
   ======================================================================== */
.login-container {

    /* 主背景图片 */
    background-image: url('/static/images/login_bj.webp') !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: 50% 0% !important;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
}

.login-card {
    width: 100%;
    min-height: 100vh;
    border-radius: 20px;
    padding-left: 25.5px;
    padding-right: 25.5px;
    padding-top: 18px;
    padding-bottom: 80px; /* 키보드 열릴 때 하단 여유 */
}

/* ========================================================================
   Logo区域
   ======================================================================== */
.login-logo-section {
    text-align: center;
    margin-bottom: 21.5px;
    /*padding-top: 36px;*/
}

.login-logo {
    width: 180px;
    height: auto;
    /* 移除滤镜效果，显示原始logo颜色 */
}

/* ========================================================================
   表单区域
   ======================================================================== */
.login-form-section {
    width: 100%;
}

.login-input-group {
    margin-bottom: 10px;
    position: relative;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 12px 30px 12px 0;
    border-radius: 5px;
    min-height: 48px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.login-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-input-icon {
    width: 14.5px;
    height: 16px;
    margin: 0 15px;
    flex-shrink: 0;
    opacity: 0.6;
    /* 图片图标样式 */
}

.login-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    outline: none;
    height: 24px;
    line-height: 24px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.login-input::placeholder {
    color: #999;
    opacity: 1;
    line-height: 24px;
    vertical-align: middle;
}

/* 兼容不同浏览器的placeholder样式 */
.login-input::-webkit-input-placeholder {
    color: #999;
    opacity: 1;
    line-height: 24px;
}

.login-input::-moz-placeholder {
    color: #999;
    opacity: 1;
    line-height: 24px;
}

.login-input:-ms-input-placeholder {
    color: #999;
    opacity: 1;
    line-height: 24px;
}

.login-input::-ms-input-placeholder {
    color: #999;
    opacity: 1;
    line-height: 24px;
}

.login-clear-btn {
    color: #ccc;
    font-size: 18px;
    margin-right: 12px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.login-clear-btn:hover {
    color: #999;
}

/* ========================================================================
   复选框区域
   ======================================================================== */
.login-checkbox-group {
    margin: 10px 0;
}

.login-checkbox-item {
    height:35px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 靠左对齐 */
    flex-wrap: wrap;
    gap: 0;
    position: relative; /* 为绝对定位的checkbox提供定位上下文 */
    padding: 7px 0 0 0px; /* 为最左边的checkbox留出空间 */
}

.login-checkbox {
    font-size: 14.5px;
    color: #ffffff;
    border: none;
    background: transparent;
    padding: 0 !important; /* 清除所有padding，使用绝对定位 */
    position: static; /* 重置position，让内部的checkbox和checkbox-icon使用绝对定位 */
    margin-left: 0 !important; /* 确保checkbox组件本身在最左边 */
}

/* 复选框文字标签样式 */
.login-checkbox-item .login-checkbox {
    margin-left: 0 !important;
}

.login-checkbox .checkbox-icon {
    border-color: #3b82f6 !important;
    background: transparent !important;
}

/* 勾选状态时的背景色和边框 - 蓝色背景+边框 */
.login-checkbox-item .checkbox input:checked + .checkbox-icon,
.login-checkbox-item ion-checkbox.checkbox-checked .checkbox-icon,
.item-checkbox.checkbox-checked .checkbox-icon,
.item-checkbox .checkbox input:checked + .checkbox-icon,
ion-checkbox.checkbox-checked .checkbox-icon,
label.item-checkbox.checkbox-checked .checkbox-icon {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    border-width: 2px !important;
    border-style: solid !important;
}

/* 重新定位checkbox到最左边 */
.login-checkbox-item .checkbox {
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
    padding: 0 !important;
}

/* 已在上方统一定义勾选状态的背景色 */

.login-terms-link {
    color: #ff0;
    font-size: 16px;
    text-decoration: none;
    border-bottom: 10px solid transparent;
    transition: border-color 0.2s ease;
}

.login-terms-link:hover {
    border-bottom-color: #3b82f6;
}

/* 注册账号链接靠右对齐 */
.login-register-link {
    margin-left: auto;
    cursor: pointer;
}

/* ========================================================================
   登录按钮
   ======================================================================== */
.login-button-section {
    margin: 10px 0 15px 0;
}

.login-button-primary {
    width: 100%;
    background: #a83838;
    border: none;
    border-radius: 5.5px;
    padding: 9px 0;
    font-size: 17px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.login-button-primary:hover {
    background: #8f2f2f;
}

.login-button-primary:active {
    background: #7a2828;
}

/* .login-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 53, 74, 0.4);
}

.login-button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(212, 53, 74, 0.3);
} */

/* ========================================================================
   在线客服
   ======================================================================== */
.login-customer-service {
    text-align: center;
    margin-top: 22px;

}

.login-service-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.login-service-link:hover {
    color: #3b82f6;
    transform: scale(1.05);
}

.login-service-link i {
    font-size: 18px;
}

/* ========================================================================
   底部功能按钮区域
   ======================================================================== */
.login-bottom-actions {
    display: flex;
    justify-content: center;
    gap: 45px;
    margin-top: 70px;

    padding: 55px 0 18px 0;
}

.login-action-item {
    flex: 0 0 auto;
}

.login-action-link {
    font-size: 14.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    transition: all 0.2s ease;
}

.login-action-link:hover {
    color: #333;
    transform: translateY(-2px);
}

.login-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 24px;
    transition: all 0.3s ease;
}

.login-icon-download {
    background: transparent;
}

.login-icon-speed {
    background: transparent;
}

.login-icon-home {
    background: transparent;
}

.login-action-label {
    font-size: 14.5px;
    text-align: center;
    white-space: nowrap;
    color: white;
}

/* 图标图片样式 */
.login-action-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 50%;
}

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

/* 小屏设备 (320px-375px) */
@media (max-width: 375px) {
    .login-card {
        width: 100%;
        padding: 18px 25.5px 0;
    }

    .login-input-wrapper {
        padding: 10px 30px 10px 0;
        min-height: 44px;
    }

    .login-input {
        font-size: 15px;
        height: 24px;
        line-height: 24px;
    }

    .login-input::placeholder,
    .login-input::-webkit-input-placeholder,
    .login-input::-moz-placeholder,
    .login-input:-ms-input-placeholder {
        line-height: 24px;
    }

    .login-button-primary {
        padding: 14px 0;
        font-size: 16px;
    }

    .login-bottom-actions {
        gap: 20px;
    }

    .login-action-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* 大屏设备 (>414px) */
@media (min-width: 414px) {
    .login-card {
        width: 100%;
        padding: 18px 25.5px 0;
    }

    .login-logo {
        width: 210px;
    }

    .login-bottom-actions {
        gap: 40px;
    }

    .login-action-icon {
        width: 55px;
        height: 55px;
        font-size: 26px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .login-card {
        margin-top: 20px;
        margin-bottom: 10px;
        padding: 20px;
    }

    .login-logo-section {
        margin-bottom: 20px;
    }

    .login-logo {
        width: 150px;
    }

    .login-bottom-actions {
        margin-top: 15px;
        margin-bottom: 5px;
    }
}

/* ========================================================================
   动画效果
   ======================================================================== */
.login-card {
    animation: slideInUp 0.6s ease-out;
}

.login-action-item {
    animation: fadeInUp 0.8s ease-out;
}

.login-action-item:nth-child(2) {
    animation-delay: 0.1s;
}

.login-action-item:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================================
   兼容性修复
   ======================================================================== */

/* 覆盖Ionic默认样式 */
.login-container.has-header {
    top: 0;
}

.login-container .scroll-content {
    overflow-y: auto;
}

/* 确保输入框在iOS和所有移动设备上正确显示 */
.login-input {
    font-size: 16px !important;
    transform: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    line-height: 24px !important;
}

/* iOS特殊修复 - 确保placeholder垂直居中 */
.login-input::-webkit-input-placeholder {
    line-height: 24px !important;
    position: relative !important;
    top: 0 !important;
}

/* Android特殊修复 */
.login-input:-moz-placeholder {
    line-height: 24px !important;
}

/* 修复Ionic checkbox默认样式 */
.login-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* 确保checkbox-icon和其内部勾选标记居中对齐 */
.login-checkbox .checkbox-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-radius: 3px !important;
    position: relative !important;
    vertical-align: middle !important;
    overflow: visible !important;
    z-index: 1 !important;
}

/* 清除未勾选状态下的所有伪元素 */
.login-checkbox:not(.checkbox-checked) .checkbox-icon:before,
.login-checkbox:not(.checkbox-checked) .checkbox-icon:after {
    display: none !important;
}

/* 清除所有状态下的after伪元素 */
.login-checkbox .checkbox-icon:after {
    display: none !important;
}

/* 勾选标记使用Unicode字符 - 使用更高优先级的选择器 */
.login-checkbox-item .checkbox input:checked + .checkbox-icon:before,
.login-checkbox-item ion-checkbox.checkbox-checked .checkbox-icon:before,
.login-checkbox.checkbox-checked .checkbox-icon:before,
label.login-checkbox.checkbox-checked .checkbox-icon:before {
    content: '✓' !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10 !important;
    text-align: center !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
}

/* 确保勾选标记在所有情况下都可见 */
.login-checkbox-item .checkbox input:checked + .checkbox-icon:before,
.login-checkbox-item ion-checkbox.checkbox-checked .checkbox-icon:before,
.login-checkbox.checkbox-checked .checkbox-icon:before,
.item-checkbox.checkbox-checked .checkbox-icon:before,
ion-checkbox.checkbox-checked .checkbox-icon:before,
label.login-checkbox.checkbox-checked .checkbox-icon:before {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* 复选框容器的额外兼容性处理 */
.login-checkbox-item .item-checkbox {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 !important;
}

/* 覆盖Ionic的所有checkbox变体 */
.item-checkbox .checkbox-icon,
ion-checkbox .checkbox-icon,
.login-checkbox-item ion-checkbox .checkbox-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-radius: 3px !important;
    border-color: #3b82f6 !important;
    background: transparent !important;
    position: relative !important;
    overflow: visible !important;
    z-index: 1 !important;
}

/* 清除所有checkbox变体未勾选状态下的伪元素 */
.item-checkbox:not(.checkbox-checked) .checkbox-icon:before,
.item-checkbox:not(.checkbox-checked) .checkbox-icon:after,
ion-checkbox:not(.checkbox-checked) .checkbox-icon:before,
ion-checkbox:not(.checkbox-checked) .checkbox-icon:after {
    display: none !important;
}

/* 所有checkbox变体的勾选状态背景色和边框 - 使用更高优先级 */
.login-checkbox-item .checkbox input:checked + .checkbox-icon,
.login-checkbox-item ion-checkbox.checkbox-checked .checkbox-icon,
.item-checkbox.checkbox-checked .checkbox-icon,
.item-checkbox .checkbox input:checked + .checkbox-icon,
ion-checkbox.checkbox-checked .checkbox-icon,
label.item-checkbox.checkbox-checked .checkbox-icon {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    border-width: 2px !important;
    border-style: solid !important;
}
}

/* 确保所有checkbox变体的勾选标记都使用Unicode字符居中显示 */
.login-checkbox-item .checkbox input:checked + .checkbox-icon:before,
.item-checkbox.checkbox-checked .checkbox-icon:before,
.item-checkbox .checkbox input:checked + .checkbox-icon:before,
ion-checkbox.checkbox-checked .checkbox-icon:before,
.login-checkbox-item ion-checkbox.checkbox-checked .checkbox-icon:before {
    content: '✓' !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10 !important;
    text-align: center !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
}

/* 确保checkbox在小屏幕设备上也正常显示 */
@media (max-width: 375px) {
    .login-checkbox .checkbox-icon,
    .item-checkbox .checkbox-icon,
    ion-checkbox .checkbox-icon {
        width: 18px !important;
        height: 18px !important;
    }

    .login-checkbox-item .checkbox input:checked + .checkbox-icon:before,
    .login-checkbox.checkbox-checked .checkbox-icon:before,
    .item-checkbox.checkbox-checked .checkbox-icon:before,
    .item-checkbox .checkbox input:checked + .checkbox-icon:before,
    ion-checkbox.checkbox-checked .checkbox-icon:before {
        font-size: 14px !important;
    }
}

/* 中等屏幕设备的字体大小 */
@media (min-width: 376px) and (max-width: 414px) {
    .login-checkbox-item .checkbox input:checked + .checkbox-icon:before,
    .login-checkbox.checkbox-checked .checkbox-icon:before,
    .item-checkbox.checkbox-checked .checkbox-icon:before,
    .item-checkbox .checkbox input:checked + .checkbox-icon:before,
    ion-checkbox.checkbox-checked .checkbox-icon:before {
        font-size: 16px !important;
    }
}

/* 大屏幕设备的字体大小 */
@media (min-width: 415px) {
    .login-checkbox-item .checkbox input:checked + .checkbox-icon:before,
    .login-checkbox.checkbox-checked .checkbox-icon:before,
    .item-checkbox.checkbox-checked .checkbox-icon:before,
    .item-checkbox .checkbox input:checked + .checkbox-icon:before,
    ion-checkbox.checkbox-checked .checkbox-icon:before {
        font-size: 18px !important;
    }
}

/* 针对高分辨率屏幕的优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-checkbox .checkbox-icon {
        border-width: 1.5px !important;
    }
}

/* 修复触摸高亮 */
.login-action-link,
.login-service-link,
.login-terms-link,
.login-button-primary {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 确保在所有设备上的滚动性能 */
.login-container {
    -webkit-overflow-scrolling: touch;
    /* 标准的滚动行为，为现代浏览器提供平滑滚动 */
    scroll-behavior: smooth;
}

/* ========================================================================
   注册页面特有样式
   ======================================================================== */

/* 验证码图标文字 */
.login-input-icon-text {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    z-index: 1;
}

/* 验证码输入框容器 */
.login-code-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 验证码输入框 */
.login-code-input {
    flex: 1;
    margin-right: 10px;
}

/* 验证码图片 */
.login-code-image {
    width: 100px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.login-code-image:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

/* 已有账号登录链接区域 */
.register-login-link-section {
    margin-top: 15px;
    text-align: center;
}

.register-login-link {
    color: #ff0;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    padding: 8px 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.register-login-link:hover {
    color: #fff;
    text-decoration: underline;
}
