/* ============================================
   蜂行智造 · 数据工作台 - 登录页样式
   设计理念：专业、现代、面向服装智能制造行业
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色系 - 深蓝 */
    --color-primary: #0B1F3F;
    --color-primary-light: #142B57;
    --color-primary-dark: #061229;

    /* 强调色 - 青绿渐变 */
    --color-accent: #00D9C0;
    --color-accent-2: #00A8E8;
    --color-accent-rgb: 0, 217, 192;

    /* 中性色 */
    --color-bg: #F7F9FC;
    --color-surface: #FFFFFF;
    --color-border: #E2E8F0;
    --color-border-focus: #00A8E8;
    --color-text: #1E293B;
    --color-text-secondary: #64748B;
    --color-text-muted: #94A3B8;
    --color-error: #EF4444;
    --color-error-bg: #FEF2F2;
    --color-success: #10B981;
    --color-muted: #94A3B8; /* 辅助说明文字 */
    --color-accent-dark: #0E7490; /* 青绿深色调，用于解析中状态 */

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-login: 0 4px 20px rgba(11, 31, 63, 0.15);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* 过渡 */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Login Container --- */
.login-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* ============================================
   左侧品牌展示区
   ============================================ */
.brand-panel {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, var(--color-primary-dark) 100%);
    overflow: hidden;
    padding: 48px;
}

/* --- 背景装饰 --- */
.brand-bg-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.15;
    animation: float 12s ease-in-out infinite;
}

.shape-1 {
    width: 380px;
    height: 380px;
    background: var(--color-accent);
    top: -100px;
    right: -80px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--color-accent-2);
    bottom: -60px;
    left: -60px;
    animation-delay: 3s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--color-accent);
    top: 50%;
    right: 30%;
    opacity: 0.08;
    animation-delay: 6s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.05); }
    66% { transform: translate(-15px, 20px) scale(0.95); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* --- 品牌内容 --- */
.brand-content {
    position: relative;
    z-index: 2;
    max-width: 480px;
    width: 100%;
    color: white;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 64px;
}

.brand-name {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
}

.brand-headline h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.5px;
    margin-bottom: 56px;
}

/* --- 特性列表 --- */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 64px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(var(--color-accent-rgb), 0.3);
    transform: translateX(4px);
}

.feature-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--color-accent-rgb), 0.2), rgba(0, 168, 232, 0.2));
    border-radius: var(--radius-sm);
    color: var(--color-accent);
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feature-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.feature-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

.brand-footer {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.3px;
}

/* ============================================
   右侧登录表单区
   ============================================ */
.form-panel {
    flex: 0 0 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    padding: 48px;
}

.form-wrapper {
    width: 100%;
    max-width: 400px;
}

/* --- 表单头部 --- */
.form-header {
    margin-bottom: 40px;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.form-header p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* --- 表单组 --- */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    transition: var(--transition);
    z-index: 1;
    pointer-events: none;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-input:hover {
    border-color: #CBD5E1;
}

.form-input:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--color-accent-2);
}

/* 密码可见切换按钮 */
.password-toggle {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: 4px;
    transition: var(--transition);
    z-index: 1;
}

.password-toggle:hover {
    color: var(--color-text-secondary);
    background: #F1F5F9;
}

/* --- 错误提示 --- */
.error-msg {
    display: block;
    min-height: 18px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-error);
    transition: var(--transition);
}

.error-msg:empty {
    min-height: 0;
}

/* 租户名称 → 数字 ID 解析提示 */
.tenant-resolve-hint {
    display: block;
    min-height: 16px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-muted);
    transition: var(--transition);
}
.tenant-resolve-hint.resolving {
    color: var(--color-accent-dark);
}
.tenant-resolve-hint.ok {
    color: var(--color-success);
}
.tenant-resolve-hint.fail {
    color: var(--color-error);
}

/* 字段说明文字 */
.field-tip {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-muted);
}

.form-group.has-error .input-wrapper {
    animation: shake 0.4s ease;
}

.form-group.has-error .form-input {
    border-color: var(--color-error);
    background: var(--color-error-bg);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* --- 表单选项 --- */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-box {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--color-border);
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-box svg {
    opacity: 0;
    transform: scale(0.5);
    transition: var(--transition);
}

.custom-checkbox:checked + .checkbox-box {
    background: linear-gradient(135deg, var(--color-accent-2), var(--color-accent));
    border-color: transparent;
}

.custom-checkbox:checked + .checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

.custom-checkbox:focus + .checkbox-box {
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.15);
}

.remember-label {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.forgot-link {
    font-size: 13px;
    color: var(--color-accent-2);
    text-decoration: none;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* --- 登录按钮 --- */
.btn-login {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 4px;
    color: white;
    cursor: pointer;
    background: linear-gradient(135deg, var(--color-accent-2) 0%, var(--color-accent) 100%);
    box-shadow: 0 4px 14px rgba(0, 168, 232, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    box-shadow: 0 6px 20px rgba(0, 168, 232, 0.4);
    transform: translateY(-1px);
}

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

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 表单提示 --- */
.form-tip {
    text-align: center;
    font-size: 13px;
    margin-top: 16px;
    min-height: 20px;
    color: var(--color-error);
    opacity: 0;
    transition: var(--transition);
}

.form-tip.show {
    opacity: 1;
}

.form-tip.success {
    color: var(--color-success);
}

/* --- 底部 --- */
.form-footer {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid var(--color-success);
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0; transform: scale(1.4); }
}

.copyright {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
}

.icp-record {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 8px;
}

.icp-record a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.icp-record a:hover {
    color: var(--color-accent-2);
    text-decoration: underline;
}

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 1200px) {
    .form-panel {
        flex: 0 0 440px;
        padding: 40px;
    }

    .brand-headline h1 {
        font-size: 34px;
    }
}

@media (max-width: 968px) {
    .login-container {
        flex-direction: column;
    }

    .brand-panel {
        min-height: auto;
        padding: 40px 32px;
    }

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

    .brand-headline {
        margin-bottom: 24px;
    }

    .brand-headline h1 {
        font-size: 28px;
    }

    .brand-subtitle {
        margin-bottom: 24px;
    }

    .brand-features {
        flex-direction: row;
        gap: 12px;
        margin-bottom: 24px;
        overflow-x: auto;
    }

    .feature-item {
        flex-shrink: 0;
        min-width: 200px;
        padding: 12px 16px;
    }

    .brand-footer {
        text-align: center;
    }

    .form-panel {
        flex: 1;
        padding: 32px;
    }
}

@media (max-width: 480px) {
    .brand-panel {
        padding: 24px 20px;
    }

    .brand-features {
        display: none;
    }

    .form-panel {
        padding: 24px 20px;
    }

    .form-header {
        margin-bottom: 24px;
    }

    .form-header h2 {
        font-size: 22px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-footer {
        margin-top: 24px;
    }
}


/* ============ 岗位角色选择器 ============ */
/* 复用 .form-input 基础样式，补齐 select 特有的箭头与内边距 */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2300A8E8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.form-select option {
    color: #1E293B;
    background: #FFFFFF;
    padding: 8px;
}

/* ============================================
   素版登录页（精简单卡片布局）
   ============================================ */
.login-container--plain {
    justify-content: center;
    align-items: center;
    background-color: #EAF6F0;
    background-image: url("../assets/login-bg.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 24px;
}

.login-container--plain .form-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: 420px;
    background: transparent;
    padding: 0;
}

.login-container--plain .form-wrapper {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 36px 32px 28px;
    box-shadow: var(--shadow-md);
}

.login-container--plain .form-header {
    margin-bottom: 28px;
}

.login-container--plain .form-header h2 {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0;
}

.login-container--plain .form-footer {
    margin-top: 20px;
    gap: 0;
}

@media (max-width: 640px) {
    .login-container--plain {
        padding: 16px;
    }

    .login-container--plain .form-wrapper {
        padding: 28px 20px 22px;
        border-radius: 10px;
    }
}
