/* ============================================
   登录页面样式 - 维修记录存档管理系统
   ============================================ */

/* CSS 变量（与主样式保持一致） */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #ebf0ff;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #ecc94b;
    --danger: #f56565;
    --info: #4299e1;
    
    --bg: #1a1a2e;
    --bg-card: rgba(255,255,255,0.05);
    --bg-card-solid: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    
    --glow-primary: rgba(102, 126, 234, 0.3);
    --glow-secondary: rgba(118, 75, 162, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ===== 科技感动态背景 ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-animation .gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    animation: orbFloat 20s ease-in-out infinite;
}

.bg-animation .orb1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary), transparent);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.bg-animation .orb2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary), transparent);
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}

.bg-animation .orb3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #4299e1, transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.9); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}

/* ===== 粒子容器 ===== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* ===== 登录容器 ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* ===== 登录卡片 ===== */
.login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 60px rgba(102, 126, 234, 0.06);
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    position: relative;
    z-index: 2;
    animation: cardFadeIn 0.6s ease-out;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary), #4299e1, var(--primary));
    background-size: 400% 400%;
    z-index: -1;
    animation: borderGlow 4s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: calc(var(--radius-lg) - 1px);
    background: #ffffff;
    z-index: -1;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== 登录头部 ===== */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4), 0 0 40px rgba(102, 126, 234, 0.15);
    position: relative;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4), 0 0 40px rgba(102, 126, 234, 0.15); }
    50% { box-shadow: 0 4px 30px rgba(102, 126, 234, 0.6), 0 0 60px rgba(102, 126, 234, 0.25); }
}

.login-header .logo i {
    font-size: 34px;
    color: #fff;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* ===== 错误消息 ===== */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    border-radius: var(--radius-sm);
    color: #fc8181;
    font-size: 14px;
    margin-bottom: 20px;
    animation: shake 0.4s ease-in-out;
    backdrop-filter: blur(10px);
}

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

.error-message i {
    font-size: 16px;
    flex-shrink: 0;
}

/* ===== 登录表单 ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    position: relative;
    margin-bottom: 0;
}

.login-form .form-group .input-icon,
.login-form .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    z-index: 1;
    transition: color 0.3s;
    pointer-events: none;
}

.login-form .form-group:focus-within .input-icon,
.login-form .form-group:focus-within .input-icon {
    color: var(--primary);
}

.login-form .form-group input[type="text"],
.login-form .form-group input[type="password"] {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    background: #ffffff;
    color: var(--text-primary);
    font-family: inherit;
    letter-spacing: 0.5px;
}

.login-form .form-group input[type="text"]:focus,
.login-form .form-group input[type="password"]:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.login-form .form-group:focus-within .input-icon {
    color: var(--primary);
}

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

/* ===== 密码切换按钮 ===== */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.3s;
    z-index: 1;
}

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

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

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.remember-me span {
    transition: color 0.2s;
}

.remember-me:hover span {
    color: var(--text-primary);
}

/* ===== 登录按钮 ===== */
.login-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-size: 200% 200%;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    letter-spacing: 4px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    background-position: right center;
}

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

.login-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    transform: scale(0.5);
}

.login-btn:hover::after {
    opacity: 1;
    transform: scale(1);
}

.login-btn i {
    font-size: 16px;
}

/* ===== 底部版权 ===== */
.login-card > p {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ===== 装饰圆 ===== */
.decoration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.decoration .circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
}

.decoration .c1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    top: -150px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.decoration .c2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    bottom: -80px;
    left: -80px;
    animation: float 10s ease-in-out infinite reverse;
}

.decoration .c3 {
    width: 200px;
    height: 200px;
    background: var(--primary);
    bottom: 50%;
    right: -40px;
    animation: float 6s ease-in-out infinite 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .login-container {
        padding: 12px;
    }
    
    .login-card {
        padding: 28px 24px;
        border-radius: var(--radius);
    }
    
    .login-header .logo {
        width: 60px;
        height: 60px;
        border-radius: 14px;
    }
    
    .login-header .logo i {
        font-size: 26px;
    }
    
    .login-header h1 {
        font-size: 20px;
    }
    
    .login-form .form-group input[type="text"],
    .login-form .form-group input[type="password"] {
        padding: 12px 12px 12px 40px;
        font-size: 14px;
    }
    
    .login-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .bg-animation .orb1 {
        width: 300px;
        height: 300px;
        top: -80px;
        left: -100px;
    }
    
    .bg-animation .orb2 {
        width: 200px;
        height: 200px;
        bottom: -50px;
        right: -60px;
    }
    
    .bg-animation .orb3 {
        display: none;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 24px 16px;
    }
}
