/* ============ Anycubic Forge Console 登录页 ============ */
/* 独立样式表，不依赖主 style.css，自带最小化 reset */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1a1a2e;
    background: #f5f6f8;
}

.hidden { display: none !important; }

/* ============ 登录页容器：分屏布局 ============ */
.login-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ============ 左侧品牌展示区 ============ */
.login-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 64px;
    background: linear-gradient(135deg, #087eff 0%, #0a5fd4 60%, #063a8c 100%);
    color: #fff;
    overflow: hidden;
}

/* 背景装饰：层叠光晕 + 几何线条 */
.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -160px;
    left: -100px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.login-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 6px;
    backdrop-filter: blur(8px);
}

.login-brand-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-brand-name strong {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.2;
}

.login-brand-name small {
    font-size: 11px;
    font-weight: 400;
    opacity: .8;
    letter-spacing: .4px;
}

/* 中部主标语 */
.login-brand-hero {
    position: relative;
    z-index: 1;
    margin: 48px 0;
}

.login-brand-hero h2 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.5px;
}

.login-brand-hero h2 .accent {
    background: linear-gradient(90deg, #ffe580 0%, #ffc940 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 第三方客户端声明卡片 */
.login-brand-notice {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-brand-notice .notice-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: rgba(255, 204, 64, 0.25);
    border-radius: 8px;
    color: #ffc940;
}

.login-brand-notice .notice-icon svg {
    width: 16px;
    height: 16px;
}

.login-brand-notice .notice-text {
    flex: 1;
    font-size: 12.5px;
    line-height: 1.6;
    opacity: .95;
}

.login-brand-notice .notice-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffe580;
}

.login-brand-notice .notice-text p {
    margin: 0;
    opacity: .9;
}

/* ============ 右侧表单区 ============ */
.login-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

/* 移动端显示的 logo（桌面端隐藏，因为左侧已有） */
.login-card .login-mobile-logo {
    display: none;
    justify-content: center;
    margin-bottom: 24px;
}

.login-card .login-mobile-logo img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.login-header {
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    letter-spacing: -.3px;
}

.login-header p {
    color: #858b95;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #4a4a5e;
    letter-spacing: .2px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    padding: 13px 16px;
    border: 1.5px solid #e4e6eb;
    border-radius: 10px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #087eff;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8, 126, 255, 0.12);
}

.form-group input::placeholder {
    color: #b0b4bd;
}

/* 区域选择器 */
.region-selector {
    display: flex;
    gap: 12px;
}

.radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4a4a5e;
    padding: 11px;
    border: 1.5px solid #e4e6eb;
    border-radius: 10px;
    background: #fafbfc;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: #b0c8f5;
    background: #f5f9ff;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #087eff;
    cursor: pointer;
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: #087eff;
    background: #eef5ff;
    color: #087eff;
    font-weight: 600;
}

/* 主按钮 */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #087eff 0%, #0a5fd4 100%);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 14px rgba(8, 126, 255, 0.32);
    margin-top: 4px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(8, 126, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(8, 126, 255, 0.3);
}

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* 记住登录 + 同意声明 */
.login-footer {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #858b95;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #087eff;
    cursor: pointer;
}

/* 错误提示 */
.error-message {
    margin-top: 16px;
    padding: 11px 14px;
    background: #fff0f0;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
    border-radius: 10px;
    font-size: 13px;
    display: none;
    text-align: center;
    animation: shake 0.4s;
}

.error-message.show { display: block; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* 加载状态 */
.login-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    color: #087eff;
    font-size: 14px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e4e6eb;
    border-top-color: #087eff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 响应式：≤960px 改为单列居中布局 ============ */
@media (max-width: 960px) {
    .login-screen {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        min-height: 100vh;
        background: linear-gradient(180deg, #f5f9ff 0%, #fff 30%);
    }

    .login-card .login-mobile-logo {
        display: flex;
    }
}

/* ============ 超小屏：≤480px ============ */
@media (max-width: 480px) {
    .login-form-panel {
        padding: 32px 20px;
    }

    .login-header h1 {
        font-size: 22px;
    }
}
