﻿/* ========================================================================
   Bladekeep 登录页面样式
   与主系统风格统一：主色 #0d6efd，深色 #1a1d29
   ======================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================================================
   页面布局 - 左右分屏
   ======================================================================== */
.login-page {
    display: flex;
    min-height: 100vh;
}

/* ========================================================================
   左侧品牌面板
   ======================================================================== */
.login-brand {
    position: relative;
    width: 50%;
    background: linear-gradient(135deg, #1a1d29 0%, #2d3142 50%, #1a1d29 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 3rem;
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 440px;
    animation: fadeInUp 0.8s ease-out;
}

/* Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 2.5rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0d6efd, #5a67d8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.3);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}

/* 标题与描述 */
.brand-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.brand-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* 特性列表 */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.75);
}

.feature-item i {
    color: #0d6efd;
    font-size: 1.125rem;
    flex-shrink: 0;
}

/* 背景装饰 */
.brand-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(13, 110, 253, 0.12);
}

.deco-circle-1 {
    width: 500px;
    height: 500px;
    top: -160px;
    right: -120px;
    background: radial-gradient(circle at 30% 40%, rgba(13, 110, 253, 0.08), transparent 60%);
    animation: floatSlow 25s infinite ease-in-out;
}

.deco-circle-2 {
    width: 350px;
    height: 350px;
    bottom: -100px;
    left: -80px;
    background: radial-gradient(circle at 60% 50%, rgba(90, 103, 216, 0.06), transparent 60%);
    animation: floatSlow 20s infinite ease-in-out reverse;
}

.deco-circle-3 {
    width: 200px;
    height: 200px;
    top: 40%;
    right: 10%;
    border-color: rgba(90, 103, 216, 0.08);
    animation: floatSlow 15s infinite ease-in-out;
}

@keyframes floatSlow {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(15px, -20px); }
    50% { transform: translate(-10px, 15px); }
    75% { transform: translate(20px, 10px); }
}

/* ========================================================================
   右侧表单面板
   ======================================================================== */
.login-form-panel {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 3rem;
}

.form-wrapper {
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.6s ease-out;
}

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

.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.form-subtitle {
    font-size: 0.9375rem;
    color: #94a3b8;
    margin: 0;
}

/* ========================================================================
   错误提示
   ======================================================================== */
.login-alert {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    animation: shakeX 0.4s ease-out;
}

.login-alert i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ========================================================================
   表单字段
   ======================================================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-field {
    margin-bottom: 1.5rem;
}

.field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

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

.field-icon {
    position: absolute;
    left: 1rem;
    font-size: 1rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
}

.field-input {
    width: 100%;
    height: 48px;
    padding: 0 1rem 0 2.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.25s ease;
    outline: none;
}

.field-input::placeholder {
    color: #b0bec5;
}

.field-input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.field-input:focus {
    border-color: #0d6efd;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.field-input:focus ~ .field-icon,
.field-input-wrap:focus-within .field-icon {
    color: #0d6efd;
}

/* 密码切换按钮 */
.field-toggle-pw {
    position: absolute;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
}

.field-toggle-pw:hover {
    background: #f1f5f9;
    color: #475569;
}

/* ========================================================================
   自定义 Checkbox
   ======================================================================== */
.form-field-inline {
    margin-bottom: 1.75rem;
}

.checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #64748b;
    user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-wrap input[type="checkbox"]:checked + .checkmark {
    background: #0d6efd;
    border-color: #0d6efd;
}

.checkbox-wrap input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

/* ========================================================================
   登录按钮
   ======================================================================== */
.btn-login {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d6efd, #5a67d8);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.25);
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(13, 110, 253, 0.35);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.btn-login:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-loader {
    align-items: center;
    justify-content: center;
}

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

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

/* ========================================================================
   底部
   ======================================================================== */
.form-footer {
    margin-top: 2.5rem;
    text-align: center;
}

.form-footer p {
    font-size: 0.8125rem;
    color: #b0bec5;
    margin: 0;
}

/* ========================================================================
   动画
   ======================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================================
   响应式
   ======================================================================== */
@media (max-width: 1024px) {
    .login-brand {
        width: 45%;
        padding: 2rem;
    }
    .login-form-panel {
        width: 55%;
    }
    .brand-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }
    .login-brand {
        display: none;
    }
    .login-form-panel {
        width: 100%;
        padding: 2rem 1.5rem;
        min-height: 100vh;
    }
    /* 移动端显示移动端 Logo */
    .form-header::before {
        content: '';
        display: block;
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, #0d6efd, #5a67d8);
        border-radius: 12px;
        margin: 0 auto 1.25rem;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M5.338 1.59a61 61 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533q.18.085.293.118a1 1 0 0 0 .101.025 1 1 0 0 0 .1-.025q.114-.034.294-.118c.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.997 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.8 11.8 0 0 1-2.517 2.453 7 7 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7 7 0 0 1-1.048-.625 11.8 11.8 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 63 63 0 0 1 5.072.56z'/%3E%3Cpath d='M10.854 5.146a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7.5 7.793l2.646-2.647a.5.5 0 0 1 .708 0'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 24px;
    }
}

@media (max-width: 480px) {
    .login-form-panel {
        padding: 1.5rem 1.25rem;
    }
    .form-title {
        font-size: 1.5rem;
    }
}
