/* ==========================================================================
   login_brand.css - 开放平台品牌登录页样式
   仅用于 app/admin/view/login/index.html 的品牌化重构
   设计令牌来源：view/index/home.html（门户首页品牌源）
   不依赖 Tailwind，纯 CSS 自包含
   ========================================================================== */

/* ---------- 全局基础（仅作用于本登录页，避免污染 layui 布局） ---------- */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #1a1a1a;
    background: #f0f4ff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- 设计令牌（与门户 home.html 完全一致） ---------- */
.brand-login {
    /* 颜色 */
    --bl-primary: #4f7cff;
    --bl-secondary: #6a5cff;
    --bl-gradient: linear-gradient(135deg, #4f7cff 0%, #6a5cff 100%);
    --bl-tint: #f0f4ff;
    --bl-tint-soft: #fafbff;
    /* 文本 */
    --bl-text: #1a1a1a;
    --bl-text-secondary: #555;
    --bl-text-muted: #888;
    --bl-text-faint: #999;
    /* 描边 / 圆角 */
    --bl-border: #eee;
    --bl-border-input: #e5e7eb;
    --bl-radius-card: 14px;
    --bl-radius-input: 10px;
    /* 字体 */
    --bl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- 主容器：左右分屏 ---------- */
.brand-login {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    font-family: var(--bl-font);
    box-sizing: border-box;
}

.brand-login *,
.brand-login *::before,
.brand-login *::after {
    box-sizing: border-box;
}

/* ==================== 品牌展示区 ==================== */
.brand-aside {
    position: relative;
    flex: 0 0 46%;
    max-width: 640px;
    padding: 56px 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bl-gradient);
    color: #fff;
    overflow: hidden;
}

/* 装饰光斑 */
.brand-aside-deco {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    filter: blur(2px);
    pointer-events: none;
}

.brand-aside-deco-1 {
    width: 360px;
    height: 360px;
    top: -120px;
    right: -100px;
    background: rgba(255, 255, 255, 0.10);
}

.brand-aside-deco-2 {
    width: 260px;
    height: 260px;
    bottom: -90px;
    left: -70px;
    background: rgba(255, 255, 255, 0.08);
}

.brand-aside-deco-3 {
    width: 140px;
    height: 140px;
    top: 40%;
    right: 18%;
    background: rgba(255, 255, 255, 0.06);
}

.brand-aside-inner {
    position: relative;
    z-index: 1;
}

/* Logo */
.brand-logo {
    margin-bottom: 28px;
}

.brand-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 24px rgba(31, 45, 90, 0.18);
}

/* Logo 图片（已上传 logo_image 时展示） */
.brand-logo-mark .brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* 标题 / 标语 */
.brand-name {
    margin: 0 0 12px;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-tagline {
    margin: 0 0 40px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    max-width: 420px;
}

/* 特性列表 */
.brand-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.brand-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.92);
}

.brand-point-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    padding: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* ==================== 表单主区 ==================== */
.brand-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--bl-tint);
}

/* 登录卡片 */
.brand-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius-card);
    padding: 40px 36px 32px;
    box-shadow: 0 12px 40px rgba(79, 124, 255, 0.08);
}

/* 卡片头部 */
.brand-card-head {
    margin-bottom: 28px;
}

.brand-card-head h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: var(--bl-text);
    letter-spacing: -0.3px;
}

.brand-card-head p {
    margin: 0;
    font-size: 14px;
    color: var(--bl-text-muted);
}

/* ---------- 表单体 ---------- */
.brand-form-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 输入行（沿用原 .item 类名以兼容验证码块） */
.brand-form-body .item {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: #fff;
    border: 1px solid var(--bl-border-input);
    border-radius: var(--bl-radius-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.brand-form-body .item:hover {
    border-color: #d4dfff;
}

.brand-form-body .item:focus-within {
    border-color: var(--bl-primary);
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12);
}

/* 输入框左侧图标 */
.field-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 46px;
    color: var(--bl-text-faint);
    pointer-events: none;
}

.field-icon svg {
    width: 18px;
    height: 18px;
}

.brand-form-body .item:focus-within .field-icon {
    color: var(--bl-primary);
}

/* 输入框本体 */
.brand-form-body .item input[type="text"],
.brand-form-body .item input[type="password"],
.brand-form-body .item input[name="captcha"] {
    flex: 1 1 auto;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--bl-text);
    font-family: var(--bl-font);
}

.brand-form-body .item input::placeholder {
    color: var(--bl-text-faint);
}

/* ---------- 密码显隐切换（.bind-password，JS 切换 .icon-5） ---------- */
.bind-password {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 46px;
    margin-left: auto;
    cursor: pointer;
    color: var(--bl-text-faint);
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

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

.bind-password .eye {
    width: 18px;
    height: 18px;
}

/* 默认（未加 icon-5）：密码隐藏，显示 eye-off */
.bind-password .eye-on {
    display: none;
}

.bind-password .eye-off {
    display: block;
}

/* JS 添加 icon-5 后：密码可见，显示 eye-on */
.bind-password.icon-5 .eye-on {
    display: block;
}

.bind-password.icon-5 .eye-off {
    display: none;
}

.bind-password.icon-5 {
    color: var(--bl-primary);
}

/* ---------- 验证码块（HTML 原样保留，CSS 覆盖内联宽度） ---------- */
#validatePanel {
    width: 100% !important;
    gap: 10px;
}

#validatePanel input[name="captcha"] {
    flex: 1 1 auto;
    padding-left: 14px;
}

#validatePanel .validateImg {
    flex: 0 0 auto;
    height: 44px;
    width: auto;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--bl-border-input);
}

/* ---------- 选项行：保持登录 / 忘记密码 ---------- */
.brand-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 24px;
    font-size: 14px;
}

.keep-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--bl-text-secondary);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* 自定义复选框（.icon-nocheck，JS 切换 .icon-check） */
.icon-nocheck {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid #cfd6e4;
    background: #fff;
    position: relative;
    transition: all 0.2s;
    flex: 0 0 auto;
}

.icon-nocheck:hover {
    border-color: var(--bl-primary);
}

/* 选中态（.icon-check）：渐变背景 + 白色对勾 */
.icon-nocheck.icon-check {
    background: var(--bl-gradient);
    border-color: transparent;
}

.icon-nocheck.icon-check::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.login-tip {
    cursor: pointer;
}

/* 忘记密码链接（由事件占位符注入 .forget-password） */
.forget-password {
    color: var(--bl-primary);
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.forget-password:hover {
    opacity: 0.8;
}

/* ---------- 登录按钮 ---------- */
.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: var(--bl-radius-input);
    background: var(--bl-gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--bl-font);
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 8px 20px rgba(79, 124, 255, 0.28);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(79, 124, 255, 0.36);
}

.login-btn:active {
    transform: translateY(0);
    opacity: 0.95;
}

/* ---------- 注册入口 ---------- */
.brand-form-extra {
    margin-top: 16px;
    text-align: center;
}

.register-link {
    color: var(--bl-text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.register-link:hover {
    color: var(--bl-primary);
}

/* ---------- 登录方式占位（事件内容） ---------- */
.brand-login-type {
    margin-top: 16px;
    text-align: center;
}

.brand-login-type .layui-btn-container {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* ==================== 页脚 ==================== */
.brand-footer {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--bl-text-muted);
    text-align: center;
}

.brand-footer-copy {
    line-height: 1.6;
}

.brand-footer-beian {
    color: var(--bl-text-muted);
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.6;
}

.brand-footer-beian:hover {
    color: var(--bl-primary);
}

/* ==================== 响应式 ==================== */

/* 中等屏幕：收窄品牌区 */
@media (max-width: 1100px) {
    .brand-aside {
        flex: 0 0 40%;
        padding: 48px 40px;
    }

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

/* 窄屏：上下堆叠，品牌区变为顶部头图 */
@media (max-width: 820px) {
    .brand-login {
        flex-direction: column;
    }

    .brand-aside {
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
        padding: 40px 28px 36px;
        text-align: center;
    }

    .brand-logo {
        margin-bottom: 20px;
    }

    .brand-name {
        font-size: 26px;
        margin-bottom: 8px;
    }

    .brand-tagline {
        margin: 0 auto 28px;
        font-size: 14px;
        max-width: none;
    }

    .brand-points {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 20px;
    }

    .brand-points li {
        font-size: 13px;
    }

    .brand-aside-deco-1 {
        width: 260px;
        height: 260px;
    }

    .brand-aside-deco-2 {
        width: 200px;
        height: 200px;
    }

    .brand-main {
        padding: 32px 20px;
    }

    .brand-card {
        padding: 32px 24px 28px;
    }
}

/* 超窄屏（手机） */
@media (max-width: 480px) {
    .brand-aside {
        padding: 32px 20px 28px;
    }

    .brand-points {
        display: none;
    }

    .brand-card {
        padding: 28px 20px 24px;
        border-radius: 12px;
    }

    .brand-card-head h2 {
        font-size: 22px;
    }

    .brand-form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ==================== 兼容性微调 ==================== */

/* 清除 layui-form 可能带来的默认外边距 */
.brand-card .layui-form {
    margin: 0;
    padding: 0;
}

.brand-card .layui-form-item {
    margin-bottom: 0;
}

/* 触摸设备取消 hover 抬升，避免粘滞 */
@media (hover: none) {
    .login-btn:hover,
    .brand-form-body .item:hover {
        transform: none;
    }
}

/* 尊重减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    .brand-login *,
    .brand-login *::before,
    .brand-login *::after {
        transition: none !important;
        animation: none !important;
    }
}
