/* loginstyle.css - 零售后台登录页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
    max-height: 90vh;          /* ✅ 限制最高高度，防止溢出屏幕 */
    overflow-y: auto;          /* ✅ 内容超出时在卡片内部滚动 */
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 品牌展示区域 */
.brands-section {
    padding: 30px 25px 25px;   /* 原 40px 30px 30px，缩小上内边距 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.brands-title {
    font-size: 1.6rem;         /* 原 1.8rem，微调字号 */
    margin-bottom: 20px;       /* 原 30px，减小间距 */
    font-weight: 600;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Logo布局 */
.brands-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    flex-wrap: nowrap;
    gap: 15px;                 /* 原 20px */
}

.left-brand {
    flex: 0 0 45%;
    max-width: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-brand .brand-logo-container {
    width: 100%;
    height: 70px;              /* 原 80px，降低高度减少总高 */
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.right-brands {
    flex: 0 0 45%;
    max-width: 45%;
    display: flex;
    flex-direction: column;
    gap: 12px;                 /* 原 15px */
    height: 100%;
    justify-content: space-between;
}

.right-brands .brand-logo-container {
    width: 100%;
    height: 70px;              /* 原 80px */
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.brand-logo-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.logo-placeholder {
    width: 90%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 表单区域 */
.form-section {
    padding: 25px 25px 30px;   /* 原 35px 30px 40px，大幅缩小 */
}

.form-header {
    text-align: center;
    margin-bottom: 20px;       /* 原 30px */
}

.form-header h2 {
    color: #333;
    font-size: 1.5rem;        /* 原 1.6rem */
    margin-bottom: 5px;       /* 原 8px */
    font-weight: 600;
}

.form-header p {
    color: #666;
    font-size: 0.9rem;        /* 原 0.95rem */
}

/* 输入框 */
.input-group {
    position: relative;
    margin-bottom: 16px;      /* 原 22px */
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    height: 50px;             /* 原 54px，略微压低 */
    padding: 0 16px;
}

.input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group label {
    color: #667eea;
    margin-right: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 100%;
}

.input-group input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    height: 100%;
    padding: 0;
    min-width: 0;
}

.toggle-password {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 100%;
    padding: 0;
    margin-left: 8px;
    transition: color 0.3s;
    position: relative;
    flex-shrink: 0;
}

.toggle-password:hover {
    color: #667eea;
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: 14px;            /* 原 16px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;      /* 原 25px */
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(102, 126, 234, 0.25);
}

.login-btn:active {
    transform: translateY(0);
}

/* 底部信息 */
.footer {
    padding: 15px 25px;       /* 原 20px 30px */
    border-top: 1px solid #f0f0f0;
    text-align: center;
    color: #777;
    font-size: 0.8rem;        /* 原 0.85rem */
}

.footer p {
    margin-bottom: 10px;      /* 原 12px */
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .brands-display {
        gap: 12px;
    }

    .left-brand,
    .right-brands {
        flex: 0 0 48%;
        max-width: 48%;
    }

    .left-brand .brand-logo-container,
    .right-brands .brand-logo-container {
        height: 65px;          /* 原 75px */
    }
}

@media (max-width: 480px) {
    .login-container {
        border-radius: 16px;
        max-width: 95%;
        max-height: 85vh;      /* 手机端稍微降低最高高度 */
    }

    .brands-section {
        padding: 20px 18px 20px;
    }
    .form-section {
        padding: 20px 18px 25px;
    }

    .brands-display {
        gap: 8px;
    }

    .left-brand,
    .right-brands {
        flex: 0 0 48%;
        max-width: 48%;
    }

    .right-brands {
        gap: 8px;
    }

    .brands-title {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    .left-brand .brand-logo-container,
    .right-brands .brand-logo-container {
        height: 60px;          /* 原 70px */
    }

    .input-group {
        height: 48px;          /* 原 52px */
        padding: 0 12px;
    }

    .input-group label {
        width: 22px;
        font-size: 1rem;
        margin-right: 8px;
    }

    .toggle-password {
        width: 28px;
        font-size: 1rem;
        margin-left: 4px;
    }
}

@media (max-width: 360px) {
    .brands-display {
        gap: 6px;
    }

    .left-brand,
    .right-brands {
        flex: 0 0 48%;
        max-width: 48%;
    }

    .right-brands {
        gap: 6px;
    }

    .left-brand .brand-logo-container,
    .right-brands .brand-logo-container {
        height: 55px;          /* 原 65px */
    }

    .input-group {
        height: 46px;
        padding: 0 10px;
    }

    .input-group label {
        width: 20px;
        font-size: 0.95rem;
        margin-right: 6px;
    }

    .toggle-password {
        width: 26px;
        font-size: 0.95rem;
        margin-left: 2px;
    }
}

/* 自定义下拉框（同步压低高度） */
.custom-select {
    position: relative;
    width: 100%;
    height: 50px;              /* 与输入框统一高度 */
    margin-bottom: 16px;       /* 与输入框统一间距 */
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    padding: 0 16px;
}

.custom-select:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-select .select-icon {
    color: #667eea;
    margin-right: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 100%;
}

.custom-select .select-input {
    flex: 1;
    height: 100%;
    padding: 0 30px 0 0;
    background: transparent;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
}

.custom-select .select-placeholder {
    color: #999;
}

.custom-select .select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.custom-select.open .select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select .select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: -1px;
    width: calc(100% + 2px);
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #667eea;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    animation: fadeInDown 0.3s ease;
}

.custom-select.open .select-options {
    display: block;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-select .select-option {
    padding: 12px 16px;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select .select-option:hover {
    background-color: #f8f9fa;
    color: #667eea;
}

.custom-select .select-option.selected {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 500;
}

/* 下拉框响应式 */
@media (max-width: 480px) {
    .custom-select {
        height: 48px;          /* 原 52px */
        padding: 0 12px;
    }
    .custom-select .select-icon {
        width: 22px;
        font-size: 1rem;
        margin-right: 8px;
    }
    .custom-select .select-input {
        padding: 0 25px 0 0;
        font-size: 0.95rem;
    }
    .custom-select .select-arrow {
        right: 12px;
    }
    .custom-select .select-option {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .custom-select {
        height: 46px;
        padding: 0 10px;
    }
    .custom-select .select-icon {
        width: 20px;
        font-size: 0.95rem;
        margin-right: 6px;
    }
    .custom-select .select-input {
        padding: 0 20px 0 0;
        font-size: 0.9rem;
    }
    .custom-select .select-arrow {
        right: 10px;
        font-size: 0.7rem;
    }
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;       /* 原 25px */
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.errors {
    text-align: center;
}