/**
 * 校园报修管理系统 - 登录页面样式
 * 主题：浅色/白色企业管理风格
 */

/* ==================== 登录页面容器 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f2f5 0%, #e4e7ec 100%);
    padding: 20px;
}

/* ==================== 登录卡片 ==================== */
.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    margin-bottom: 24px;
}

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

.login-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(67, 97, 238, 0.3);
}

.login-logo svg {
    width: 36px;
    height: 36px;
    fill: white;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* ==================== 登录表单 ==================== */
.login-card .form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.login-card .form-control {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.login-card .form-control::placeholder {
    color: var(--text-muted);
}

/* ==================== 登录按钮 ==================== */
.btn-login {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    background-color: var(--primary);
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: white;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-login:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

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

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

/* 按钮loading状态 */
.btn-login .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* ==================== 错误提示 ==================== */
.error-msg {
    margin-top: 16px;
    padding: 12px 16px;
    background-color: rgba(var(--danger-rgb), 0.1);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-msg::before {
    content: "✕";
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

/* ==================== 注册链接 ==================== */
.register-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.register-link a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    margin-left: 4px;
}

.register-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==================== 测试账号区域 ==================== */
.test-accounts {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px 24px;
    width: 100%;
    max-width: 420px;
    margin-bottom: 20px;
}

.test-accounts-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-account-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.test-account-item:last-child {
    border-bottom: none;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 12px;
    min-width: 70px;
    justify-content: center;
}

.role-student {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.role-repair {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--success);
}

.role-admin {
    background: rgba(var(--warning-rgb), 0.1);
    color: var(--warning);
}

/* ==================== 底部版权 ==================== */
.login-footer {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* ==================== 注册弹窗 ==================== */
#registerModal .modal-content {
    border: none;
    border-radius: 16px;
}

#registerModal .modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

#registerModal .modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

#registerModal .modal-body {
    padding: 24px;
}

#registerModal .modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

#registerModal .form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 14px;
}

#registerModal .form-control {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: var(--radius-sm);
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }

    .login-logo {
        width: 60px;
        height: 60px;
    }

    .login-logo svg {
        width: 30px;
        height: 30px;
    }

    .login-header h2 {
        font-size: 1.25rem;
    }

    .test-accounts {
        padding: 16px 20px;
    }
}
